Skip to content

Palette: search what exists, go there (Cmd+K) - #35

Draft
aurph wants to merge 1 commit into
mainfrom
feat/command-palette
Draft

aurph wants to merge 1 commit into
mainfrom
feat/command-palette

Conversation

@aurph

@aurph aurph commented Sep 16, 2026

Copy link
Copy Markdown
Owner

Bottom line: press Cmd+K anywhere and type where you want to go. "texas" lands on My Grid with Texas chosen, "ccj" opens the Cameco stock page, "abilene" lists the Abilene clusters and takes you to the detail page. GridTilt has 235 cluster pages, dozens of ticker pages, and 51 state views that are only reachable by knowing where to click; now they are one keystroke away.

What it searches

Only what already exists, nothing invented: the 12 sections, the 51 My Grid states (choosing one sets the state and opens the page), the tracked tickers from the supply-chain config, every cluster detail page, and the research posts. Ranking is a pure function in lib/palette.ts (7 tests): label prefix beats word match beats hint/keyword match, ties break pages > states > stocks > clusters > research.

Cost discipline: clusters and research load lazily from their file-backed endpoints on first open. The palette never touches a quote API.

Wiring

Self-contained component that owns its Cmd+K/Ctrl+K hotkey and a gt-open-palette event; App.tsx just mounts it, the G-chord handler is untouched. The top nav gains a search button with the ⌘K hint, and the ? shortcuts panel lists the binding. Combobox/listbox semantics with aria-activedescendant, in line with the keyboard-access pass from #21.

Known limit: no mobile entry point yet (the nav button is md-and-up and phones have no hotkey); a follow-up can surface it on the phone nav.

Verification

tsc 0, 491/491 tests (7 new), build green. Driven in a real browser: hotkey open, typed queries, arrow/enter navigation, the nav button, escape close - each landing URL asserted, including the My Grid state select reading "TX" after choosing Texas.

Touches only App.tsx, top-nav.tsx, and new files, so it stays clear of the other open PRs.

🤖 Generated with Claude Code

https://claude.ai/code/session_019VHXaB2wsfodFneo1VvANN

A quick-open over the app's existing destinations: the pages, the 51
My Grid states, the tracked tickers from the supply-chain config, the
cluster detail pages, and the research posts. Typing texas lands on
My Grid with Texas chosen; ccj opens the Cameco page; abilene lists
the Abilene clusters. Pure ranking in lib/palette.ts (7 tests) over
static and file-backed lists - the palette never touches a quote API,
so opening it costs at most two cached JSON reads.

Self-contained component: it owns the Cmd+K/Ctrl+K hotkey and the
gt-open-palette event, so App.tsx only mounts it and the G-chord
handler is untouched. Top nav gains the search button; the shortcuts
panel lists the binding. Combobox/listbox semantics per the a11y pass.

tsc 0, 491 tests, build green. Driven in a real browser: hotkey,
typed queries, arrow/enter, nav button, escape.

Claude-Session: https://claude.ai/code/session_019VHXaB2wsfodFneo1VvANN
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant