Repository navigation
Rank prompt library searches in one list - #5148
Merged
Merged
Conversation
Once a query is typed, the picker shows a single list instead of Starred
and Recent sections. Prompts that start with the query come first, then
fuzzy score, with starred and then newer prompts breaking ties. A starred
prompt appears once, as its starred row. The search RPC and
`bb prompts search --json` now return `{ prompts }` with a `kind` per row.
Searching no longer inserts a status row above the list: results stay in
place, and the search icon becomes a spinner only for searches slower
than 300 ms.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
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.
Human comments
What was wrong
Prompt Library searches kept the browse layout: a Starred section ranked by fuzzy score, then a Recent section ranked by fuzzy score. A starred prompt therefore beat a better match, prompts that start with the query could be buried under weaker substring matches (
Deploy later…anddeploy the preview…were 6th and 7th of 8 fordeploy), and starred prompts appeared twice (once per section). Separately, each search inserted a "Searching prompts…" row above the list, so the list jumped down and back on every keystroke.What changed
plugins/prompt-library/ranking.ts:rankByQuerymarks prefix matches (case-insensitive, whitespace-collapsed) and sorts prefix matches first, then fuzzy score, keeping input order (recency) for ties.compareRankis exported for merging.plugins/prompt-library/server.ts: with a query, starred and history matches are merged into one list ranked by prefix, then score, then starred, then recency; history rows whose text is starred are dropped so each prompt appears once. Browsing (empty query) is unchanged: starred, then recent.plugins/prompt-library/contract.ts:searchoutput changed from{ starred, recent }to{ prompts }, each row withkind: "starred" | "recent". This also changesbb prompts search --json. Text output follows the same order.plugins/prompt-library/app.tsx: while searching, section headers are hidden and rows are keyed by prompt text, so the selection follows a prompt when starring/unstarring moves it. The status row is gone: results stay in place during a search, the search icon becomes a spinner only for searches slower than 300 ms, and the first "Loading prompts…" message renders inside the empty list.SKILL.md) andPLUGIN_OVERVIEW.mddescribe the ranking and the new output shape.How you verified
pnpm exec turbo run test typecheck lint --filter='...[origin/main]'(prompt library and bundled plugins), plusturbo run test --filter=@bb/web -- src/marketplace.server.test.ts: one test checks the full order (prefix + starred, prefix + newer, prefix + older, fuzzy + starred, fuzzy + newer, weak fuzzy match), including a capitalised prefix and removal of the duplicate starred row.app.test.tsx: no section headers while searching, and the selection follows an unstarred prompt. This test fails without the text-keyed rows.app.test.tsx: results stay in place with no status row while a search is pending, and the spinner appears only after 300 ms. This test fails against the old status row.pnpm start:worktreeinstance with seeded history:bb prompts searchchecks ranking, project and thread scopes, multi-word queries, extra whitespace, no-match queries, the flag constraint, and star/unstar round trips. Unstarring moves a prompt from [codex] Bundle Claude Code SDK CLI support file #4 to [codex] Update sidebar manager row presentation #6 and re-starring moves it back.🤖 Generated with Claude Code