From 81f32a1faad91d0953484a8c778a4f4eba71ef8a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Padez?= Date: Fri, 21 Aug 2026 03:48:46 +0000 Subject: [PATCH] spotlight: ctrl-space, type a few letters, go MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The dock is full and cannot grow. Once navigation lives here it is free to be a short list of what you actually use rather than a complete one — which is the other half of this and is not done yet. It INDEXES THE DOCK rather than keeping a list of its own. The dock is already the composed, permission-filtered answer to "what can this account open here": the shell's screens, plus whatever installed plugins contribute, minus anything canVisit refuses. A second list would be a second answer to one question, and it would be wrong the day somebody installs a plugin. So a new plugin appears in Spotlight for the reason it appears in the dock — because it is installed — and nothing here is edited. Settings sections are added, because they are what people hunt for and the dock deliberately does not carry them. Those ARE hand-listed, which is a real cost written down in the file: a section added to IntegrationsSettings will not appear until someone adds it here. The alternative couples five settings screens to the shell to save five lines. Matching is subsequence, not substring, and lives in its own file so it can be tested with strings: "chq" finds Command HQ, "apik" finds API keys, "fi" gives Files rather than Profile. The weights encode what "the right result" means — exact label, then prefix, then word boundaries, then adjacency, with shortness breaking ties so "Chat" beats "Chat history". Labels are worth about three times hints, and paths almost nothing, so a path fragment finds an item without ever outranking a real label. Nine tests cover the ORDER rather than the matching, because returning the right set is easy and returning it with the right thing first is the product. ctrl-space, not alt-space: the more macOS-shaped chord is already load-bearing for the owner. Not cmd-k either — that belongs to the browser on some platforms and to text fields on others. Mounted beside the header and the dock rather than inside the content region, so it still gets you off a screen that is maximised, erroring or mid-navigation. Co-Authored-By: Claude Opus 5 --- .../Dashboard/Layout/DashboardLayout.tsx | 4 + .../Dashboard/Layout/Spotlight/Spotlight.tsx | 189 ++++++++++++++++++ .../Dashboard/Layout/Spotlight/match.test.ts | 67 +++++++ .../Dashboard/Layout/Spotlight/match.ts | 93 +++++++++ .../Layout/Spotlight/useSpotlightItems.ts | 81 ++++++++ 5 files changed, 434 insertions(+) create mode 100644 src/apps/officer-web/Screens/Dashboard/Layout/Spotlight/Spotlight.tsx create mode 100644 src/apps/officer-web/Screens/Dashboard/Layout/Spotlight/match.test.ts create mode 100644 src/apps/officer-web/Screens/Dashboard/Layout/Spotlight/match.ts create mode 100644 src/apps/officer-web/Screens/Dashboard/Layout/Spotlight/useSpotlightItems.ts diff --git a/src/apps/officer-web/Screens/Dashboard/Layout/DashboardLayout.tsx b/src/apps/officer-web/Screens/Dashboard/Layout/DashboardLayout.tsx index 2b8a1cb6..b3491b8d 100644 --- a/src/apps/officer-web/Screens/Dashboard/Layout/DashboardLayout.tsx +++ b/src/apps/officer-web/Screens/Dashboard/Layout/DashboardLayout.tsx @@ -7,6 +7,7 @@ import { ScreenErrorFallback } from './ScreenErrorFallback'; import { Background } from './Background'; import { Header } from './Header'; import { Dock, CORE_DOCK_ITEMS, dockItemsFromPlugins, defaultDockPaths } from './Dock'; +import { Spotlight } from './Spotlight/Spotlight'; import { useIsTouch } from './useIsTouch'; import { usePageTitleSync } from '@/state/usePageTitle'; import { RouteGate } from './RouteGate'; @@ -47,6 +48,9 @@ export function DashboardLayout({ children }: DashboardLayoutProps) { return (