From c2040656bd7fec3873985c5a4b9e529836d55024 Mon Sep 17 00:00:00 2001 From: "alexei.dolgolyov" Date: Sat, 28 Mar 2026 14:31:13 +0300 Subject: [PATCH] feat: EntityPicker component, replace dropdowns with command palette Port EntityPalette pattern from wled-screen-controller as Svelte 5 component. Full-screen modal with search, keyboard navigation (Arrow keys, Enter, Escape), grouped items, current-item accent, auto-scroll, backdrop blur. Replace inline image browser dropdowns on Projects and Quick Deploy pages with EntityPicker. Add EntityPickerItem type and i18n keys. --- web/src/lib/components/EntityPicker.svelte | 425 +++++++++++++++++++++ web/src/lib/i18n/en.json | 4 + web/src/lib/i18n/ru.json | 4 + web/src/lib/types.ts | 9 + web/src/routes/deploy/+page.svelte | 80 ++-- web/src/routes/projects/+page.svelte | 119 +++--- 6 files changed, 529 insertions(+), 112 deletions(-) create mode 100644 web/src/lib/components/EntityPicker.svelte diff --git a/web/src/lib/components/EntityPicker.svelte b/web/src/lib/components/EntityPicker.svelte new file mode 100644 index 0000000..2b02a6c --- /dev/null +++ b/web/src/lib/components/EntityPicker.svelte @@ -0,0 +1,425 @@ + + + +{#if open} + + +
+ + + +
+ +
+{/if} + + diff --git a/web/src/lib/i18n/en.json b/web/src/lib/i18n/en.json index 0a8478a..fdf49ed 100644 --- a/web/src/lib/i18n/en.json +++ b/web/src/lib/i18n/en.json @@ -376,6 +376,10 @@ "dark": "Dark", "system": "System" }, + "entityPicker": { + "search": "Search...", + "noResults": "No results found" + }, "language": { "en": "English", "ru": "Russian" diff --git a/web/src/lib/i18n/ru.json b/web/src/lib/i18n/ru.json index a4e56b2..fe1a4c6 100644 --- a/web/src/lib/i18n/ru.json +++ b/web/src/lib/i18n/ru.json @@ -376,6 +376,10 @@ "dark": "Тёмная", "system": "Системная" }, + "entityPicker": { + "search": "Поиск...", + "noResults": "Ничего не найдено" + }, "language": { "en": "Английский", "ru": "Русский" diff --git a/web/src/lib/types.ts b/web/src/lib/types.ts index 204398c..832ed89 100644 --- a/web/src/lib/types.ts +++ b/web/src/lib/types.ts @@ -137,6 +137,15 @@ export interface StageEnv { updated_at: string; } +/** Item for the EntityPicker command-palette component. */ +export interface EntityPickerItem { + value: string; + label: string; + description?: string; + icon?: string; + group?: string; +} + /** Volume mount configuration for a project. */ export interface Volume { id: string; diff --git a/web/src/routes/deploy/+page.svelte b/web/src/routes/deploy/+page.svelte index b88fdc5..52df090 100644 --- a/web/src/routes/deploy/+page.svelte +++ b/web/src/routes/deploy/+page.svelte @@ -1,7 +1,8 @@