From 7acff56abbdcd40a92e803eea7eb1e643bc55ca0 Mon Sep 17 00:00:00 2001 From: ajnart Date: Mon, 24 Aug 2026 09:15:50 +0200 Subject: [PATCH] fix(spotlight): stabilize catalog search --- .../advanced/keyboard-shortcuts/index.mdx | 5 +- .../docs/management/search-engines/index.mdx | 8 +- .../board/board-apps-spotlight-registrar.tsx | 1 + .../layout/header/lazy-spotlight.tsx | 8 +- packages/api/src/router/board.ts | 153 ++++++++-------- .../search-engine/search-engine-router.ts | 15 ++ .../src/components/actions/group-actions.tsx | 8 +- .../src/components/spotlight.module.css | 6 +- .../spotlight/src/components/spotlight.tsx | 3 + packages/spotlight/src/lib/catalog.ts | 96 ++++++++++ .../apps-search-group.tsx | 17 +- .../boards-search-group.tsx | 12 +- .../src/modes/app-integration-board/index.tsx | 4 +- .../integrations-search-group.tsx | 14 +- .../external/search-engines-search-group.tsx | 38 ++-- .../src/modes/home/context-specific-group.tsx | 17 ++ packages/spotlight/src/modes/home/context.tsx | 1 + .../modes/home/home-search-engine-group.tsx | 169 +++++++----------- packages/spotlight/src/modes/home/index.tsx | 10 +- packages/translation/src/lang/en.json | 7 +- .../src/bookmarks/bookmarks-widget.tsx | 6 +- 21 files changed, 359 insertions(+), 239 deletions(-) create mode 100644 packages/spotlight/src/lib/catalog.ts diff --git a/apps/docs/docs/advanced/keyboard-shortcuts/index.mdx b/apps/docs/docs/advanced/keyboard-shortcuts/index.mdx index e1eb51562..4c3bca3fe 100644 --- a/apps/docs/docs/advanced/keyboard-shortcuts/index.mdx +++ b/apps/docs/docs/advanced/keyboard-shortcuts/index.mdx @@ -23,8 +23,9 @@ Homarr has the following keyboard shortcuts: Search is designed as the fastest route to Homarr. Start typing after `MOD` + `K` to find local apps, boards, integrations, pages, commands, and preferences without entering a separate mode first. Local Homarr results appear -before external search and Assistant fallbacks. Commands include opening the board switcher without leaving the -keyboard. +before configured search-engine actions and Assistant fallbacks. Commands include opening the board switcher without +leaving the keyboard. Type `!` to enter Web mode when you want to browse configured engine shortcuts or discover +DuckDuckGo bangs; bang discovery is excluded from ordinary Search results. Use the dedicated shortcuts above to start in apps, Assistant, or preferences. Inside search, choose a mode to narrow the same query when needed. Media request search is available only when a supported Seerr integration is configured. diff --git a/apps/docs/docs/management/search-engines/index.mdx b/apps/docs/docs/management/search-engines/index.mdx index 186853d8c..0afe333d4 100644 --- a/apps/docs/docs/management/search-engines/index.mdx +++ b/apps/docs/docs/management/search-engines/index.mdx @@ -7,9 +7,13 @@ tags: # Search Engines -Using the search engines, terms can be quickly searched simply by opening the search bar at the top or using the keyboard shortcut `CTRL + K`. +Using the search engines, terms can be quickly searched simply by opening the search bar at the top or using the keyboard shortcut `MOD + K`. The management page provides a searchable list with the shortcut, URL template, source, and available row actions for each engine. +The default **Search** mode lists every configured search engine as a fallback action for the current query. To discover +engines by shortcut, switch to **Web** with `!`. DuckDuckGo bang discovery is intentionally limited to Web mode so an +ordinary search term never expands into similarly named bang providers. + You can add any search engine that has a search URL that accepts a search term as a parameter. ## Create search engine @@ -26,6 +30,8 @@ The name can be chosen freely. It will be displayed in the search box popover. Prefix that is used to choose the search engine in the popover using the keyboard. It is recommended that this value is kept short (for example `g` for Google and `e` for Ecosia). +Type `!` in Spotlight to browse these shortcuts and, when DuckDuckGo bangs are enabled in preferences, discover +additional bang providers. ### Configuration diff --git a/apps/nextjs/src/components/board/board-apps-spotlight-registrar.tsx b/apps/nextjs/src/components/board/board-apps-spotlight-registrar.tsx index 157d14e94..721301860 100644 --- a/apps/nextjs/src/components/board/board-apps-spotlight-registrar.tsx +++ b/apps/nextjs/src/components/board/board-apps-spotlight-registrar.tsx @@ -48,6 +48,7 @@ export const BoardAppsSpotlightRegistrar = () => { return [ { id: app.id, + dedupeKey: `app:${app.id}`, name: app.name, icon: app.iconUrl, interaction() { diff --git a/apps/nextjs/src/components/layout/header/lazy-spotlight.tsx b/apps/nextjs/src/components/layout/header/lazy-spotlight.tsx index 823ec01bd..427988c74 100644 --- a/apps/nextjs/src/components/layout/header/lazy-spotlight.tsx +++ b/apps/nextjs/src/components/layout/header/lazy-spotlight.tsx @@ -57,12 +57,8 @@ export const LazySpotlight = () => { return isMounted || isPreloaded ? ( <> {isPreloaded &&