Repository navigation
fix: filter the command palette's pages and Pro hints by the query - #284
Open
RobertSigmundsson wants to merge 1 commit into
Open
RobertSigmundsson wants to merge 1 commit into
RobertSigmundsson wants to merge 1 commit into
Conversation
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
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
matchesQuery(label, query)helper (case-insensitive substring, blank query keeps everything) is used for pages, Pro hints and fibers; empty groups are hidden.server/static/distis 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) andnpm run build(tsc + vite) pass, as in CI.eslintclean 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.pytest/ruff/mypyunaffected.Verified by
@RobertSigmundsson.