Skip to content

fix: filter the command palette's pages and Pro hints by the query - #284

Open
RobertSigmundsson wants to merge 1 commit into
acidkill:mainfrom
RobertSigmundsson:fix/command-palette-filter
Open

RobertSigmundsson wants to merge 1 commit into
acidkill:mainfrom
RobertSigmundsson:fix/command-palette-filter

Conversation

@RobertSigmundsson

Copy link
Copy Markdown
Contributor

Summary

  • The Ctrl/Cmd+K palette now narrows pages and Pro hints to the query; a query that matches nothing shows the empty state.
  • One small matchesQuery(label, query) helper (case-insensitive substring, blank query keeps everything) is used for pages, Pro hints and fibers; empty groups are hidden.
  • Adds a vitest unit test, a Playwright spec and a CHANGELOG entry. The bundle in server/static/dist is left for the release build.

Why

Typing "Graph" in the palette still listed all 10 pages and both Pro hints (12 options). <Command shouldFilter={false}> is there because fibers are matched by summary and neurons server-side, but it also switches off cmdk's filtering for the static items, which nothing filtered by hand. Running them through the same helper as the fibers restores the expected narrowing without touching the fiber and neuron paths.

Test plan

  • npm ci && npm run test (vitest, 24 passed) and npm run build (tsc + vite) pass, as in CI.
  • eslint clean on the changed files.
  • e2e/command-palette.spec.ts (Playwright): "Graph" leaves exactly one option; a query that matches nothing leaves none. Fails against the 3.12.0 bundle (12 options instead of 1), passes with the fix.
  • No Python changes; pytest/ruff/mypy unaffected.

Verified by

@RobertSigmundsson.

The palette renders with shouldFilter={false} because fibers and neurons are
matched by hand, which also switched off cmdk's filtering for the static
items: typing "Graph" still listed all 10 pages and both Pro hints. Match
them against the query like the fibers, and add a unit test plus a
Playwright spec ("Graph" leaves exactly one option; no match leaves none).

This branch has not been deployed

No deployments
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