Un-merge the stage top bar filter from the global command palette - #278
Merged
Conversation
The magnifier and Cmd+K were tested as one merged surface (global-search-morph.test.tsx), matching the PR #246 behavior the owner wants undone. Replaces it with two suites: one for the top-bar magnifier as a per-page filter that never touches the palette's open store, and one for Cmd+K as its own surface reachable from any route, including one with no stage top bar. Updates plugins-page.test.tsx for the "Filter …" labels replacing "Search …".
PR #246 replaced the magnifier's modal palette with an inline morph, but in doing so wired the top-bar magnifier straight into the global command palette — conflating "filter this page" with "search everywhere," which the owner has now flagged more than once (docs/DECISIONS.md → Search). StageSearch is now a plain per-page filter: it takes a page's own value/onChange and morphs into a text input, never touching the palette's open store. StageTopBar renders it only when a page passes a `filter`, so a page with nothing to filter shows no magnifier at all. CommandPaletteProvider now renders react-ui's modal `CommandPalette` directly instead of handing data down to StageSearch through context, so Cmd+K (and the existing context-menu item) work from any route, including one that renders no stage top bar of its own — fixing the 404 dead end. Files, Skills, and Plugins already rendered their own filter input next to the magnifier; that duplicate is gone, and the magnifier now drives each page's existing filter state directly (relabelled "Filter …", never "Search …", so it never reads as a second search surface).
DESIGN.md's Search section and docs/command-palette.md described the pre-fix state (one surface, two doors that resolve to the same UI). Rewritten to match docs/DECISIONS.md: the magnifier filters the current page, Cmd+K opens the global palette as its own surface, and neither opens the other.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
PR #246 replaced the top-bar magnifier's centered dialog with react-ui's
CommandPaletteInlinemorphing out of the magnifier — a real fix, but it wired the magnifier straight into the global command palette. The owner has flagged this more than once (docs/DECISIONS.md→ Search): the magnifier filters whatever page you're on;Cmd+Kis the separate global palette. Neither should open the other.StageSearch(the magnifier) is now a plain per-page filter: a page hands in its ownvalue/onChange, and it morphs into a text input — it no longer touches the palette's open store at all.StageTopBarrenders it only when a page passes afilterprop, so a page with nothing to filter (Agents, Routines) shows no magnifier at all — no more controls that do nothing.CommandPaletteProvidernow renders react-ui's modalCommandPalettedirectly instead of handing data down through context toStageSearch, mounted once aboveAppShellinapp.tsx. That also fixesCmd+Kbeing inert on a 404 —routeHasNoStageTopBarmeant noStageTopBar(and so no palette) ever mounted for an unmatched route; the palette no longer depends on it.DESIGN.md→ Search anddocs/command-palette.mdto describe the two separate surfaces.Which pages now drive their existing filter from the magnifier: Files ("Filter files"), Skills ("Filter skills"), Plugins ("Filter plugins"/"Filter skills" by tab). Agents and Routines have no filter, so they show no magnifier.
Linear: CL-6565
Test plan
bun run typecheck(apps/web)bunx eslinton every changed filebun test ./src ./test(apps/web) — 833 pass, 0 failstage-search-filter.test.tsx: typing in a page's filter never opens the global palette; Escape clears then collapses; a page with no filter renders no magnifier; 40px hit target intactglobal-command-palette.test.tsx:Cmd+Kopens the palette from an ordinary route and from an unmatched one (404); route change closes it; result selection still navigates to the entity's own slug