Skip to content

feat(app): add session message search - #45037

Closed
iwiznia wants to merge 3 commits into
anomalyco:devfrom
iwiznia:message-search
Closed

iwiznia wants to merge 3 commits into
anomalyco:devfrom
iwiznia:message-search

Conversation

@iwiznia

@iwiznia iwiznia commented Aug 25, 2026 •

Copy link
Copy Markdown

Issue for this PR

Closes #19143

Type of change

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

What does this PR do?

Adds Cmd/Ctrl+F session-message search in the desktop timeline. It reuses the existing find controller to highlight matches and support next/previous navigation without changing the file-viewer behavior.

How did you verify your code works?

Ran the app with npx --yes [email protected] run dev:desktop and tested manually.
Also added automated tests.

Screenshots / recordings

Screen.Recording.2026-08-25.at.2.04.31.PM.mov

Checklist

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

@github-actions github-actions Bot added the needs:compliance This means the issue will auto-close after 2 hours. label Aug 25, 2026
@github-actions

Copy link
Copy Markdown
Contributor

The following comment was made by an LLM, it may be inaccurate:

Found a potential duplicate:

PR #41049: feat(app): cmd+F to search session with highlighting
#41049

This appears to be the same feature - adding Cmd+F search capability to the session with highlighted matches. This earlier PR may have already implemented or attempted this functionality. You should review it to determine if it was merged, closed, or abandoned, and whether the current PR (45037) duplicates or improves upon that work.

@github-actions github-actions Bot removed the needs:compliance This means the issue will auto-close after 2 hours. label Aug 25, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Thanks for updating your PR! It now meets our contributing guidelines. 👍

hunterchristian added a commit to chipp-ai/opencode that referenced this pull request Sep 23, 2026
Search within the current session's message history -- open with
<leader>f or /find (alias /search), type a query, step between
matches with Enter/Shift+Enter, Esc to close.

Ported from upstream anomalyco#4714 (67 reactions/35
comments). Unusually, the relevant PRs (anomalyco#45037, anomalyco#48470) were still
open and unreviewed rather than bot-closed -- but neither actually
targets the TUI: both add Cmd/Ctrl+F search to the web/desktop
timeline instead. anomalyco#45037's approach (reusing the file viewer's search
by scanning the rendered page) can't carry over to a terminal UI.
anomalyco#48470's approach -- find matches directly from message data (text,
reasoning, tool inputs, error rows), then scroll to the hit -- doesn't
depend on a browser, so its matching logic (partSearchText,
findMatches) is ported directly into a new
packages/tui/src/util/session-find.ts. Its browser-only parts (DOM
highlighting, the web find-bar, file-viewer shortcut sharing) have no
TUI equivalent and were rewritten as a real terminal find-bar
component plus new match-navigation and scroll-target logic.

Four new overridable keybinds (session_find <leader>f,
session_find_next/previous/close). Matched parts get a highlighted
background, stronger on the current match; a collapsed "Thought"
block auto-opens while it holds the current match.

Known gaps: word-level highlighting only works in user messages
(assistant/reasoning/tool rows highlight as a whole block -- the
terminal renderer can't highlight part of a markdown block); tool
output isn't searched, only tool inputs, matching anomalyco#48470's own
choice; a match inside a hidden/collapsed region is counted but has
nothing on screen to jump to; only the current session is searched,
no cross-session search; keybinds docs and generated SDK types don't
list the new keys yet.

New packages/tui/test/util/session-find.test.ts (11 tests, adapted
from anomalyco#48470's own test file) and packages/tui/test/cli/tui/
session-find.test.tsx (2 tests rendering the real find bar). Verified
against this fork's current dev, including the expandable-pasted-
text-placeholders feature which touches two of the same files with
no conflict: bun typecheck clean; full packages/tui suite 228 pass.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
@github-actions

Copy link
Copy Markdown
Contributor

Automated PR Cleanup

Thank you for contributing to opencode.

Due to the high volume of PRs from users and AI agents, we periodically close older PRs using automated criteria so maintainers can focus review time on the most active and community-supported contributions.

This PR was closed because it matched the following cleanup criteria:

  • The PR was created more than 1 month ago
  • The PR had fewer than 2 positive reactions
  • Positive reactions are counted as thumbs-up, heart, celebration, or rocket reactions on the PR

PRs created within the last month are not affected by this cleanup.

If you believe this PR was closed incorrectly, or if you are still actively working on it, please leave a comment explaining why it should be reopened. A maintainer can review and reopen it if appropriate.

Thanks again for taking the time to contribute.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE]: Implement message search (Cmd+F / Ctrl+F) in the Desktop App

1 participant