Repository navigation
feat(app): add previous and next match buttons to conversation search - #64865
Conversation
There was a problem hiding this comment.
This works as described. I opened the session-transcript-find story in Chromium for both the base and this PR. Starting at 1/4, clicking next twice gives 3/4 and previous then gives 2/4. The input keeps focus, and at 0/0 both buttons are disabled. tsc -b in packages/app and search-machine.test.ts both pass.
Public API: unchanged. The change only adds UI inside packages/app, with no new i18n keys.
One thing worth fixing: the bar is still a fixed 200px, so the two buttons take space from the query field. In the story it shrinks from about 112px to about 56px (see inline comment).
Related: #4714
| {c.result.activeDisplay()}/{c.result.count()} | ||
| </span> | ||
| </Show> | ||
| <For each={[-1, 1]}> |
There was a problem hiding this comment.
The bar container is still fixed at w-[200px], so these two 20px buttons come out of the text field. In the story the input goes from about 112px on the base to about 56px here. That's fine for trail with 2/4, but a longer query or a count like 12/134 will leave very little of the query visible. Could you widen the bar to make up for the buttons (it is already capped by max-w-[50vw])?



Issue for this PR
Closes #64825
Type of change
What does this PR do?
The conversation search bar (Cmd/Ctrl+F) only let you step through matches with the keyboard (Enter / Shift+Enter, ↑ / ↓), so it looked like only the first result was reachable. This adds up and down buttons next to the match count, same as the file search bar already has.
The buttons call the existing
result.move(-1 | 1), are disabled when there are no matches, and keep focus in the input. Their labels reuse the already translatedui.fileSearch.previousMatch/ui.fileSearch.nextMatchstrings, so there are no new i18n keys.No feature flag. It's two buttons on an existing control that call an action the keyboard already triggers.
How did you verify your code works?
bun typecheckinpackages/appsession-transcript-findstory in Chrome via Playwright: clicking next twice goes 1/4 → 3/4, previous goes back to 2/4, input keeps focus. With a query that has no matches (0/0) both buttons are disabled.Screenshots / recordings
Taken from the
session-transcript-findstory, dark theme.Checklist
Added by the opencode bot (AI-generated).
Related: #4714