mirror of
https://seed.radicle.dev/rad:z4V1sjrXqjvFdnCUbxPFqd5p4DtH5.git
synced 2026-11-20 22:00:43 +08:00
Rename the search bar placeholder
Signed-off-by: Rūdolfs Ošiņš <rudolfs@osins.org>
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
import * as Search from "@app/lib/search";
|
||||
import * as modal from "@app/lib/modal";
|
||||
import * as router from "@app/lib/router";
|
||||
import { searchPlaceholder } from "@app/lib/shared";
|
||||
import { unreachable } from "@app/lib/utils";
|
||||
|
||||
import Icon from "@app/components/Icon.svelte";
|
||||
@@ -131,7 +132,7 @@
|
||||
}
|
||||
}}
|
||||
on:submit={search}
|
||||
placeholder="Search a RID…">
|
||||
placeholder={searchPlaceholder}>
|
||||
<svelte:fragment slot="left">
|
||||
<Icon name="magnifying-glass" />
|
||||
</svelte:fragment>
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
|
||||
import ColorPaletteModal from "@app/App/ColorPaletteModal.svelte";
|
||||
import HotkeysModal from "@app/App/HotkeysModal.svelte";
|
||||
import { searchPlaceholder } from "@app/lib/shared";
|
||||
|
||||
const onKeydown = (event: KeyboardEvent) => {
|
||||
if (event.key === "Escape") {
|
||||
@@ -17,7 +18,7 @@
|
||||
case "/": {
|
||||
event.preventDefault();
|
||||
const searchInput: HTMLElement | null = document.querySelector(
|
||||
'*[placeholder="Search a RID…"]',
|
||||
`*[placeholder="${searchPlaceholder}"]`,
|
||||
);
|
||||
searchInput?.focus();
|
||||
break;
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
// This file is shared between tests and the UI code. It should only contain
|
||||
// basic JS primitives, so that it works in both browser and node environments.
|
||||
|
||||
export const searchPlaceholder = "Enter an RID…";
|
||||
@@ -1,7 +1,6 @@
|
||||
import { searchPlaceholder } from "@app/lib/shared";
|
||||
import { test, expect } from "@tests/support/fixtures.js";
|
||||
|
||||
const searchPlaceholder = "Search a RID…";
|
||||
|
||||
test("global hotkeys", async ({ page }) => {
|
||||
await page.goto("/");
|
||||
await page.locator("body").press(`/`);
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { searchPlaceholder } from "@app/lib/shared";
|
||||
import {
|
||||
test,
|
||||
expect,
|
||||
@@ -7,7 +8,7 @@ import {
|
||||
|
||||
test("navigate to existing project", async ({ page }) => {
|
||||
await page.goto("/");
|
||||
const searchInput = page.getByPlaceholder("Search a RID…");
|
||||
const searchInput = page.getByPlaceholder(searchPlaceholder);
|
||||
await searchInput.click();
|
||||
await searchInput.fill(`${rid}`);
|
||||
await searchInput.press("Enter");
|
||||
@@ -18,7 +19,7 @@ test("navigate to existing project", async ({ page }) => {
|
||||
|
||||
test("navigate to a project that does not exist", async ({ page }) => {
|
||||
await page.goto("/");
|
||||
const searchInput = page.getByPlaceholder("Search a RID…");
|
||||
const searchInput = page.getByPlaceholder(searchPlaceholder);
|
||||
await searchInput.click();
|
||||
|
||||
const nonExistantId = "rad:zAAAAAAAAAAAAAAAAAAAAAAAAAAA";
|
||||
|
||||
Reference in New Issue
Block a user