Repository navigation
feat(web): Search finds threads, commands and settings in one grouped list - #1061
Merged
Merged
Conversation
Add project and "Bring in Codex conversation" lived inside the command palette, which switched modes on the text in its field: typing a path turned Search into a folder browser that could create a project on Enter. A clone or import that finished after the palette closed could also call the wrong caller back or navigate anyway. Both flows are now their own dialogs, each with a small store that loads at startup and a body that loads on first open. Every opening is a session: an operation's callback, navigation and close happen only if its session is still open, otherwise a notice says what was added with an Open button. A typed path in Search adds an "Add project at <path>" row on top of the results instead of changing modes. App-wide shortcuts stand down while the palette or either dialog is open, and each dialog returns focus to whatever opened it. The plan for the rest of the palette work is in docs/design/command-palette.md.
The palette's commands were a hand-built list inside one component, each
behind its own if, so commands the app already had (the panel's tabs,
switching model, stashing a message, the theme commands) were never offered,
and the Keybindings page made up its own labels ("Diff: Toggle"). The palette
also opened on about 30 commands, with recent threads below them.
One catalog in packages/shared names every command, and a build fails when
a shortcut command has no name. Whoever owns a behavior registers its
handler, with the same guard its button or shortcut uses, and the palette
offers what is registered. The palette now opens on the five most recent
threads, then four suggested commands learned on this device, then a row
into every command. Keybindings takes its names and groups from the catalog.
The open palette no longer redraws while a reply streams, except the part
that decides Wrap up or Reopen, which still reads the inbox on every token.
The palette searched threads and commands only, kept its groups in a fixed order, and said "No matching commands, projects, or threads" while the message search was still running. A setting like terminal text size could not be found, and a thread named exactly what you typed sat under every command that mentioned the word. Search now covers threads, commands, settings and projects through one pure module. Each source keeps its own matcher, and every match gets a tier from its own words, so the group holding the best match comes first. Settings results use the same availability rules as Settings search and open their page with the row lit, and Back returns to the chat. The palette says when it is still searching messages, names a computer that failed or stopped early, and offers close matches only when nothing matched. Recent threads follow this device's last visits.
The palette was a small box inside a box that showed eight two-line rows, faded its secondary text, and had one hidden filter (typing ">"). Add project and the Codex import shared the box with no title to say which was open. Each kind of result now sits in its own quiet filled group, in a wider single surface with one-line rows. Filters for All, Threads, Commands, Settings and Projects sit under the field with a count each, and Tab moves between them. In All a group shows five rows and a "Show all" row. Escape clears the text, then the filter, then closes. The palette draws its own list so the highlight follows the row the user chose when message matches arrive late. Add project and the Codex import take the same look and name their step in a title row.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This branch was successfully 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.
The command palette is also the app's search (the sidebar's Search field opens it), and it did neither job well:
The causes were structural. Every command was typed by hand inside one 3,289-line component that was also the Add project wizard and the Codex importer, and ranking ran inside each group.
The plan, the reviews it went through and what each step built differently are in
docs/design/command-palette.md. A working mockup of the look is beside it.What changed, one commit per step
packages/shared/src/appCommands.tsnames every command, and a shortcut command without a name fails the build. Whoever owns a behavior registers its handler (apps/web/src/commands/commandHandlers.ts), with the same guard its button or shortcut uses. About 25 commands that had no palette row arrive, the theme commands from feat: custom themes that agents make, with live art behind frosted glass #827 among them. The Keybindings page takes its names from the same list. The palette opens on recent threads.paletteSearch.ts) puts every match on one scale, so the group holding the best match leads. Settings results use the availability rules Settings search uses and open their page with the row lit. The palette says when it is still searching messages and names a computer that failed or stopped early. Commands now match from the start of a word.Things a user will notice
Checks
Known gaps, listed as follow-ups in the plan