Skip to content

feat(app): add find bar to session timeline - #48088

Closed
cdz620 wants to merge 1 commit into
anomalyco:devfrom
cdz620:session-find
Closed

cdz620 wants to merge 1 commit into
anomalyco:devfrom
cdz620:session-find

Conversation

@cdz620

@cdz620 cdz620 commented Sep 9, 2026 •

Copy link
Copy Markdown

Issue for this PR

N/A — small UX gap reported directly: the session transcript has no in-page search.

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

Adds mod+f in-page search to the session timeline in the app/desktop UI.

The timeline is virtualized, so a purely DOM-based find would miss off-screen content. Matches are therefore computed from row data (user/assistant text, reasoning, tool call inputs, error rows), the active match is scrolled into view through the virtualizer, and rendered hits are highlighted with the CSS Custom Highlight API under the same opencode-find names/colors the pierre file viewer already uses. Highlights rebuild as rows mount and unmount during scrolling.

The timeline registers as a find host in the existing pierre file-find registry (new registerFindHost / activateFindHost exports), so mod+f / mod+g routing is shared with the file viewer and only one find bar is active at a time. File tabs keep their existing shortcut behavior and win via defaultPrevented. The bar itself is the existing FileSearchBar component with the existing ui.fileSearch.* i18n keys, so no new strings were added.

One non-obvious fix: bottom-follow must be paused synchronously (new onPauseScroll prop wired to autoScroll.pause) before navigating to a match. Otherwise the anchor-bottom resize handlers race the find scroll and pull the viewport back down, making far-away matches unreachable.

How did you verify your code works?

  • New find.test.ts covers search-text extraction and match computation (7 tests pass). Full app unit suite passes except one pre-existing i18n failure that also fails on dev.
  • Interactive verification in Chromium against bun dev + a local server with seeded sessions:
    • mod+f opens the bar even while the composer is focused; counts show n/m, 0/0 on no match.
    • Enter / shift+Enter cycle with wrap-around; mod+g / mod+shift+g navigate while open.
    • In a 77-row session, searching an off-screen match scrolled from the bottom to the exact row with the hit highlighted in view.
    • Escape closes the bar and clears all highlights.
  • The find path is inert while closed: the match memo short-circuits on open === false and the keydown listener only does modifier checks for unrelated keys.

Screenshots / recordings

Happy to provide a recording on request; verified interactively as described above.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

Add mod+f in-page search for the session transcript. Matches are computed
from row data (user/assistant text, reasoning, tool inputs, errors) so the
virtualized timeline can scroll off-screen matches into view, then rendered
hits are highlighted with the CSS Custom Highlight API. Enter / shift+Enter
and mod+g / mod+shift+g cycle matches, Escape closes.

The pierre file-find host registry is exported so the timeline joins the
existing mod+f routing and only one find bar is active at a time. Bottom
follow is paused synchronously before navigating so anchor-bottom resize
handlers cannot race the find scroll.
@github-actions github-actions Bot added the needs:compliance This means the issue will auto-close after 2 hours. label Sep 9, 2026
@github-actions

github-actions Bot commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

This PR doesn't fully meet our contributing guidelines and PR template.

What needs to be fixed:

  • PR description is missing required template sections. Please use the PR template.

Please edit this PR description to address the above within 2 hours, or it will be automatically closed.

If you believe this was flagged incorrectly, please let a maintainer know.

@github-actions

github-actions Bot commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

This pull request has been automatically closed because it was not updated to meet our contributing guidelines within the 2-hour window.

Feel free to open a new pull request that follows our guidelines.

@github-actions github-actions Bot removed the needs:compliance This means the issue will auto-close after 2 hours. label Sep 9, 2026
@github-actions github-actions Bot closed this Sep 9, 2026
@cdz620 cdz620 mentioned this pull request Sep 11, 2026
3 of 6 tasks
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