Skip to content

Native chat: Cmd/Ctrl+F finds in the chat - #26517

Merged
brennanb2025 merged 7 commits into
mainfrom
brennanb2025/native-chat-cmd-f
Oct 9, 2026
Merged

brennanb2025 merged 7 commits into
mainfrom
brennanb2025/native-chat-cmd-f

Conversation

@brennanb2025

@brennanb2025 brennanb2025 commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 7 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​1206 $\color{#cf222e}{\Huge{\mathbf{−}}}$​2 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​1204
Prod 30 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​1171 $\color{#cf222e}{\Huge{\mathbf{−}}}$​224 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​947

ELI5

In a native chat, pressing Cmd+F (Ctrl+F on Windows and Linux) now opens a small find bar inside the chat. Type a word and the matching text in the conversation is highlighted, with a count like "2/5". Enter goes to the next match, Shift+Enter to the previous one, and Escape closes the bar and puts you back where you were typing.

What Changed

Before

  • In a chat tab, Cmd/Ctrl+F did nothing.
  • In a terminal tab shown as a chat, Cmd/Ctrl+F opened the terminal's search bar on top of the chat. That bar searched the hidden terminal text, not the conversation on screen.

After

  • Cmd/Ctrl+F anywhere in the focused chat, including the message box, opens a find bar at the top-right of the conversation.
  • Matches in the conversation are highlighted as you type, and the bar shows the current match and the total, or "No results".
  • Only the conversation is searched. The sidebar, tab titles, other panes and your unsent message are not.
  • Enter and Shift+Enter, or the bar's arrow buttons, move between matches. The conversation scrolls to each one, including sideways inside a wide code block or a tool output box.
  • Moving to an earlier match stops the chat from jumping back to the newest message. It follows new output again once you return to the bottom, as it does after any manual scroll.
  • Escape closes the bar and clears the highlights. If the bar is open and you press Escape in the message box, the first Escape closes the bar. A second Escape stops the agent, as before.
  • Pressing Cmd/Ctrl+F again while the bar is open selects the search text. Reopening the bar brings back the last search.
  • Paste, copy and select-all work in the find field.
  • The shortcut can be changed in Settings → Shortcuts, under a new "Chat" group ("Find in chat").
  • In a terminal tab shown as a chat, Cmd/Ctrl+F opens this chat find instead of the hidden terminal's search. In a plain terminal it still opens terminal search.
  • A PDF viewer no longer takes Cmd/Ctrl+F from other panes. Before, an open PDF anywhere in the window, even in a split or a workspace you weren't looking at, could open its own find when you pressed Cmd/Ctrl+F in a chat. Now a PDF answers Cmd/Ctrl+F when its split is the one in focus, or when the key press comes from inside it. That includes right after opening it from its tab or the file explorer.
  • The web client is unchanged: Cmd/Ctrl+F there still opens the browser's own find.

Limits

  • The chat keeps only the messages near the visible area loaded, and collapsed tool output and thinking aren't shown. Text in those places isn't found until you scroll to it or expand it. The count can change as you scroll and more messages load.
  • Searching the whole conversation history, loaded or not, is a possible follow-up.

How it works

  • The bar is part of the chat itself, so it moves, resizes and closes with the chat.
  • The search walks only the visible text of the conversation. It skips hidden labels, hover-only buttons and text cut off by a box that doesn't scroll.
  • Matches are painted with the browser's highlight feature, which colors text without changing the page. Orca's markdown preview search already worked this way, and this PR moves that search-and-highlight code into a shared module (lib/dom-text-search-highlights.ts) that both use. The markdown preview behaves exactly as before.
  • While the bar is open, the search refreshes when messages stream in, load, or are expanded. When nothing changes, it does no work, and none at all while the bar is closed.

Why

The first version of this PR showed the bar as a separate floating panel over the window and used the browser's page search. Review found that this didn't fit a chat inside Orca's multi-pane window:

  • it searched and counted text in the sidebar and other panes;
  • the panel stayed over unrelated panes after switching tabs, covering the terminal search bar and pane menus;
  • Cmd/Ctrl+V in the panel pasted into the message box;
  • Escape could stop the agent instead of closing the bar.

A find bar that lives in the chat and searches only the conversation avoids all of these. It also reuses search code Orca already had for the markdown preview, instead of adding a second window, a preload script and new messages between processes.

Differences from the common pattern, a window-wide find bar in its own view:

  • Searches only the chat, with the bar inside the chat (intended). Orca's window has a sidebar, splits and other panes, and window-wide matches pulled the user out of the chat.
  • Opened only from a chat (intended). The terminal, editor, browser and settings already own Cmd/Ctrl+F.
  • Translated labels and a rebindable shortcut (intended). Same as Orca's other find shortcuts.

Linked Issue

N/A (maintainer request)

Visual Proof

Before: Cmd/Ctrl+F in a chat tab did nothing, so there is nothing to capture.

After (Orca dev build on macOS, hidden window, a seeded 64-turn chat with "pelican" 12 times and a workspace named pelican-flamingo-repo):

Find opened from the message box, light theme (3/4; the sidebar's "pelican" isn't counted)
Dark theme
Stepping scrolls a wide code line sideways to the match
Three seconds after stepping up: no jump back to the newest message
A word that's only in the sidebar: "No results"
Paste goes into the find field, not the message box
Narrow window: the bar fits inside the chat
A plain terminal still opens its own search

Testing

  • New unit tests cover:

    • opening from the message box and the conversation, and not from outside the chat or in the web client;
    • searching only the conversation, and keeping two open chats' highlights apart;
    • refreshing while messages stream or load;
    • stepping and scrolling into nested boxes, and leaving follow-to-bottom only when the chat actually scrolls;
    • Escape order against the real message-box handler;
    • focus return, including to an approval card that arrived while the bar was open;
    • paste;
    • the terminal yielding Cmd/Ctrl+F inside a chat;
    • the PDF shortcut across splits, its own tab, the file explorer and the floating workspace panel.
  • Existing markdown preview, PDF find, chat scroll and keybinding suites pass.

  • pnpm tc:web, pnpm tc:node and orca-ci-checks (22/22) pass.

  • Live QA in an Orca dev build on macOS (hidden window, isolated profile, stand-in agent), at 5273a07, passed:

    • open from the message box;
    • matches in the chat only;
    • stepping, including sideways in a code block, with no jump back to the bottom;
    • Escape returns focus and keeps the draft;
    • reopening keeps the query;
    • paste into the find field;
    • light and dark themes;
    • a narrow window;
    • terminal search unchanged in a plain terminal.
      Not checked live: Windows and Linux, a terminal tab in chat view, an approval card arriving while find is open (covered by unit tests), and a real streaming reply.
  • I manually tested these changes locally

  • Automated tests added/updated, or explained why not below

Review

A review summary will be posted as a comment.

Agent skill upstream boundary

  • Not applicable, or this change copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Notes

  • Cross-platform: Cmd+F on macOS, Ctrl+F on Windows and Linux, through the keybinding registry.
  • SSH and remote: the find runs in the window on what's already rendered, so local and remote chats behave the same.
  • Web client and mobile: unchanged.
  • Saved settings: only the new shortcut entry. Older versions ignore it.

Author: @BrennanKB5

Mod+F inside a focused native chat opens a find bar at the chat's top-right
corner. The bar is a separate sandboxed view stacked over the main window, so
its own input is never a match; main runs the window's find-in-page and relays
the match count back. Enter/Shift+Enter step, Escape closes and clears.

Also stops the terminal search bar from opening over a chat that covers a
terminal pane.
Replaces the window-level find panel with a find bar inside the chat.
The panel searched the whole window, pasted into the composer, outlived
its chat, and let Escape interrupt the agent.

- Searches only the transcript text the reader can see and paints matches
  with CSS highlights, reusing the markdown preview's search, now shared
  as lib/dom-text-search-highlights.ts.
- Re-searches as the transcript streams or scrolls, keeping the current
  match; a step leaves "follow latest" like a reader scroll.
- Escape closes the bar first and returns focus; paste and editing keys
  stay in the bar's input.
- Terminal guard yields any chat.find chord inside a chat cover; a PDF
  no longer takes Mod+F from another surface.
- Escape: the chat root's React capture handler closes the bar before the
  composer's own capture handler can interrupt the turn.
- One visibility rule for picking and revealing a match: typing no longer
  scrolls to a match that is already on screen, and the bar's real rect,
  not a full-width band, decides what it covers.
- Reveal scrolls nested scroll boxes (code lines, tool output, thinking);
  text cut off by a box that cannot scroll is not counted.
- PDF find opens from its own tab and the file explorer again, but not
  from another group, a chat, or a text field.
- Prompt cards no longer take focus from the find input; clicks on the
  bar keep typing in it; buttons keep their own Enter.
- A match whose row scrolled away restarts from the first visible match.
- Streamed text growth re-searches every 120 ms instead of every frame,
  and searches reuse their Range objects.
- Hover-only row chrome is marked and skipped instead of read by opacity.
- Chat find stays off in the web client, where the browser's find keeps
  Mod+F.
- The text matcher moves to lib/text-match-ranges.ts with neutral names.
- Text that held a match re-searches before the next paint: React
  rewrites a growing text node whole, collapsing its ranges, so the
  streaming paragraph's highlights no longer blink. Other text growth
  keeps the 120 ms re-search.
- A disclosure's height animation ending re-searches, so an output
  opened while find is open is counted.
- A prompt card that arrived while the find bar held focus gets it when
  find closes.
- A reveal that cannot scroll no longer stops following the latest.
- PDF find follows the panel's chord owner (its tab is the active tab
  of the focused group, the rule the browser pane uses), so it no longer
  takes Mod+F from a chat, terminal or browser in another split, and it
  opens again after clicking its own editor header.
The floating workspace panel keeps its own focused group, so a PDF that
owns its panel's chords no longer takes Mod+F from a chat in the other
surface (main window vs floating panel), matching how the browser pane
scopes a floating workspace's chords.
@brennanb2025 brennanb2025 changed the title Native chat: Cmd/Ctrl+F opens find in window Native chat: Cmd/Ctrl+F finds in the chat Oct 8, 2026
@brennanb2025

Copy link
Copy Markdown
Contributor Author

Review summary

The problem: in a native chat, Cmd/Ctrl+F did nothing. In a terminal tab shown as a chat, it opened the terminal's search over the chat, and that search looked through the hidden terminal text, not the conversation.

What changes for you: Cmd/Ctrl+F in a chat opens a find bar inside the chat:

  • Matches in the conversation are highlighted, with a count like "3/4", or "No results".
  • Enter and Shift+Enter move between matches and scroll to each one, including sideways inside wide code blocks.
  • Moving to an earlier match stops the chat jumping back to the newest message.
  • Escape closes the bar and puts focus back where you were. With the bar open, the first Escape in the message box closes the bar; a second Escape stops the agent, as before.
  • Only the conversation is searched, not the sidebar or other panes.
  • It finds only what the chat has loaded. That limit was accepted from the start.

The design changed during review

The first version put the bar in a separate floating panel over the window and used the browser's whole-page search. Round 1 showed that this doesn't fit a chat inside Orca's multi-pane window:

  • Cmd/Ctrl+V in the bar pasted into the chat's message box.
  • The panel stayed over other panes after a tab switch, covering the terminal search bar and pane menus.
  • Matches included the sidebar and other panes.
  • Escape could stop the agent instead of closing the bar.

The maintainer chose the cleanest fix: a bar that lives in the chat and searches only the conversation. It reuses Orca's markdown-preview search-and-highlight code, which moves into a shared module and behaves the same as before. The floating panel, its preload script and its main-process code are all removed.

What review fixed (5 rounds plus a readiness pass)

  • Round 1 (first design): paste, the panel outliving the chat, whole-window matches, Escape interrupting the agent, the first Cmd+F typing into the message box, the stale position, and the stuck view after a crash. All are gone with the redesign.
  • Round 2:
    • Escape still reached the message box's interrupt first. Its handler runs earlier than the first fix assumed.
    • Typing a query scrolled the chat up half a screen per keystroke.
    • Matches inside code blocks and tool output were counted but never scrolled into view.
    • An approval card could take focus from the find field mid-word.
    • Enter on the bar's buttons stepped instead of pressing them.
    • Counts changed with mouse hover.
    • Long chats lost frames while streaming with a one-letter query.
  • Round 3 (mostly side effects of round-2 fixes):
    • Highlights in a streaming paragraph blinked.
    • Expanding a tool output while the bar was open dropped its matches.
    • Moving to a match could stop the chat from following new output even though nothing scrolled.
    • An approval card that arrived while the bar was open didn't get focus after it closed.
  • PDF viewer (rounds 1–4): an open PDF anywhere in the window, including in a split, a background workspace or the floating panel, could take Cmd/Ctrl+F from a chat. The PDF now answers Cmd/Ctrl+F only when its split has focus or the key comes from inside it. That uses the same "focused split" rule the browser pane already follows. Two earlier attempts at this gate broke PDF find from its own tab and let a PDF take the key from terminals in other splits; both are fixed and tested.
  • Web client: left unchanged. Cmd/Ctrl+F there still opens the browser's own find.

Deferred (not blocking)

  • P2: a hidden chat whose find bar is still open keeps its highlight data registered. Every page change elsewhere then costs about 0.03–0.4 ms. The markdown preview behaves the same today.
  • P2: after a fix in round 2, matches that are cut off from view are re-created on every search instead of reused.
  • P2: lib/text-match-ranges.ts repeats the query-size limit in lib/find-query-bounds.ts; one should reuse the other.
  • P2: revealFindMatch has a do-nothing default that only tests use, so a future chat list could compile with find never scrolling.
  • P3:
    • While typing a query, an in-between query can scroll to a match and leave the chat scrolled up.
    • In a very narrow chat the bar covers the top line of text.
    • Some names now cover more than they say, such as isCmdSaveOwner.
  • Already on main: in the structured chat, text typed while the conversation area has focus goes nowhere. The terminal-backed chat sends it to the message box. Find doesn't change this; it's worth its own fix.
  • Already on main: with a chat covering a terminal pane, the terminal still takes select-all, clear and scroll shortcuts aimed at the hidden terminal. Only Cmd/Ctrl+F is handled here.

What was verified

  • Unit tests for every fix, including tests shown to fail without the fix. They cover Escape order (using the real message-box handler), the PDF focus rules in the real layout, focus return, paste, and the scroll behaviour.
  • Existing suites: markdown preview, PDF find, chat scroll and keybindings all pass.
  • Checks: pnpm tc:web, pnpm tc:node and orca-ci-checks pass. CI at 5273a07 passed with no failures.
  • Readiness check: no P0 or P1 findings across remote and SSH, upgrade and rollback of saved shortcuts, cross-platform keys, security, crashes and growth, performance, correctness of every caller of the moved code, and code layout.
  • Live QA at 5273a07 in an Orca dev build on macOS (hidden window, isolated profile, stand-in agent, a 64-turn chat). Passed:
    • opening from the message box;
    • matches in the chat only ("flamingo", which appears only in the sidebar, gives "No results");
    • stepping, including sideways in a code block, with no jump to the bottom;
    • Escape returning focus and keeping the draft;
    • reopening with the query kept;
    • paste into the find field;
    • light and dark themes;
    • a narrow window;
    • terminal search still working in a plain terminal.
      Screenshots are in the PR body.

Not verified

  • Windows and Linux.
  • A terminal tab shown as a chat, live.
  • An approval card arriving while find is open, live (unit tests only).
  • A real streaming reply with the bar open: blinking and frame cost were measured only in headless Chromium.
  • The floating workspace panel with a PDF, live.

@brennanb2025
brennanb2025 marked this pull request as ready for review October 8, 2026 13:28
@coderabbitai

coderabbitai Bot commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: cafa240b-eaae-48cc-8557-b4686ad3b600
📥 Commits

Reviewing files that changed from the base of the PR and between e54452c and b8a39b0.

📒 Files selected for processing (5)
  • src/renderer/src/components/native-chat/NativeChatMessageList.reader-navigation.test.tsx
  • src/renderer/src/components/native-chat/NativeChatMessageList.tsx
  • src/renderer/src/components/native-chat/NativeChatUserMessageRow.tsx
  • src/renderer/src/components/native-chat/use-native-chat-find-matches.ts
  • src/renderer/src/components/native-chat/use-native-chat-find.test.tsx

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 6 remain after this review.


📝 Walkthrough

Walkthrough

The change adds native chat transcript search with a find bar, match highlighting, result navigation, and match scrolling. It adds the chat.find keybinding and updates terminal shortcut handling, prompt-card focus behavior, and search translations. Markdown preview now uses shared DOM text-search utilities. The PDF viewer uses a dedicated hook to scope its find shortcut to the appropriate PDF and window surface.

Priority: ⬇️ Low

Merge Risk: 🔵 Low · up to b8a39

Chat find looks ready to merge. One small open question remains for PDFs: when two PDF viewers share a workspace surface, pressing Cmd/Ctrl+F may open find in both. Confirm or fix that as a follow-up.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 43.59% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 78 functions across 35 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check Passed The title clearly and concisely describes the primary change: adding Cmd/Ctrl+F search to native chat.
Description check Passed The description is complete and directly matches the implementation. It includes the user impact, detailed behavior, rationale, maintainer issue exception, visual proof, testing results, platform cons…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: fa250770-8f04-4feb-a8b9-e6932e5a1eb3
📥 Commits

Reviewing files that changed from the base of the PR and between a747c1c and 5273a07.

📒 Files selected for processing (39)
  • src/renderer/src/components/editor/EditorPanel.tsx
  • src/renderer/src/components/editor/PdfViewer.tsx
  • src/renderer/src/components/editor/editor-shortcut-owner.ts
  • src/renderer/src/components/editor/markdown-preview-search.ts
  • src/renderer/src/components/editor/use-pdf-viewer-shortcuts.test.tsx
  • src/renderer/src/components/editor/use-pdf-viewer-shortcuts.ts
  • src/renderer/src/components/native-chat/NativeChatApprovalCard.tsx
  • src/renderer/src/components/native-chat/NativeChatFindBar.tsx
  • src/renderer/src/components/native-chat/NativeChatMessageList.reader-navigation.test.tsx
  • src/renderer/src/components/native-chat/NativeChatMessageList.tsx
  • src/renderer/src/components/native-chat/NativeChatMessageRow.tsx
  • src/renderer/src/components/native-chat/NativeChatQuestionCard.tsx
  • src/renderer/src/components/native-chat/NativeChatResolvedView.reveal-latest.test.tsx
  • src/renderer/src/components/native-chat/NativeChatResolvedView.tsx
  • src/renderer/src/components/native-chat/NativeChatStructuredSession.test-harness.tsx
  • src/renderer/src/components/native-chat/NativeChatStructuredSession.tsx
  • src/renderer/src/components/native-chat/NativeChatTranscriptChrome.tsx
  • src/renderer/src/components/native-chat/native-chat-find-visibility.test.ts
  • src/renderer/src/components/native-chat/native-chat-find-visibility.ts
  • src/renderer/src/components/native-chat/native-chat-find.css
  • src/renderer/src/components/native-chat/native-chat-reader-scroll-input.ts
  • src/renderer/src/components/native-chat/use-native-chat-find-matches.ts
  • src/renderer/src/components/native-chat/use-native-chat-find.test.tsx
  • src/renderer/src/components/native-chat/use-native-chat-find.ts
  • src/renderer/src/components/native-chat/use-native-chat-prompt-card-focus.ts
  • src/renderer/src/components/native-chat/use-native-chat-reveal-latest.ts
  • src/renderer/src/components/native-chat/use-structured-native-chat-submit-reveal.test.ts
  • src/renderer/src/components/terminal-pane/terminal-keyboard-event-handlers.ts
  • src/renderer/src/components/terminal-pane/terminal-keyboard-native-chat-find.test.ts
  • src/renderer/src/i18n/locales/en.json
  • src/renderer/src/i18n/locales/es.json
  • src/renderer/src/i18n/locales/fr.json
  • src/renderer/src/i18n/locales/ja.json
  • src/renderer/src/i18n/locales/ko.json
  • src/renderer/src/i18n/locales/zh.json
  • src/renderer/src/lib/dom-text-search-highlights.ts
  • src/renderer/src/lib/text-match-ranges.ts
  • src/shared/keybindings/definitions-core-4.ts
  • src/shared/keybindings/types.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 4 remain after this review.

Comment on lines +25 to +29
return (
ownsShortcuts &&
!isEditableTarget(target instanceof Element ? target : null) &&
isEventTargetInsideFloatingWorkspacePanel(target) ===
isEventTargetInsideFloatingWorkspacePanel(root)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

🔎 Supported by static analysis

🏁 Script executed:

#!/bin/bash
# Inspect PDF viewer call sites and their surrounding panel layout.
rg -n -C 8 --glob '*.{ts,tsx}' \
  '<PdfViewer\b|EditorShortcutOwnerContext\.Provider' \
  src/renderer/src/components/editor

Repository: stablyai/orca

Length of output: 41363


🏁 Script executed:

set -eu
printf '%s\n' '--- shortcut implementation ---'
nl -ba src/renderer/src/components/editor/use-pdf-viewer-shortcuts.ts | sed -n '1,180p'
printf '%s\n' '--- production PdfViewer call sites ---'
rg -n -F --glob '*.{ts,tsx}' --glob '!*.test.*' '<PdfViewer' src/renderer/src
printf '%s\n' '--- owner context declarations/usages ---'
rg -n -C 6 -F --glob '*.{ts,tsx}' --glob '!*.test.*' 'EditorShortcutOwnerContext' src/renderer/src
printf '%s\n' '--- ImageViewer logical block ---'
nl -ba src/renderer/src/components/editor/ImageViewer.tsx | sed -n '1,270p'
printf '%s\n' '--- EditorPanel composition ---'
nl -ba src/renderer/src/components/editor/EditorPanel.tsx | sed -n '280,390p'

Repository: stablyai/orca

Length of output: 26201


🏁 Script executed:

set -eu
nl -ba src/renderer/src/components/editor/use-pdf-viewer-shortcuts.ts | sed -n '1,180p'
rg -n -F --glob '*.{ts,tsx}' --glob '!*.test.*' '<PdfViewer' src/renderer/src
rg -n -C 6 -F --glob '*.{ts,tsx}' --glob '!*.test.*' 'EditorShortcutOwnerContext' src/renderer/src
nl -ba src/renderer/src/components/editor/ImageViewer.tsx | sed -n '1,270p'
nl -ba src/renderer/src/components/editor/EditorPanel.tsx | sed -n '280,390p'

Repository: stablyai/orca

Length of output: 26021


🏁 Script executed:

set -eu
printf '%s\n' '--- ImageViewer production call sites ---'
rg -n -C 12 -F --glob '*.{ts,tsx}' --glob '!*.test.*' '<ImageViewer' src/renderer/src
printf '%s\n' '--- diff/conflict viewer references ---'
rg -n -C 8 -i --glob '*.{ts,tsx}' --glob '!*.test.*' 'diff|conflict' src/renderer/src/components/editor | rg -n 'ImageViewer|Preview|Viewer|EditorPanelShell|sideBySide|conflict' || true
printf '%s\n' '--- EditorPanelShell declaration and viewer-related blocks ---'
rg -n -F --glob '*.{ts,tsx}' 'function EditorPanelShell|const EditorPanelShell|export default function EditorPanelShell|ImageViewer|sideBySide|Diff' src/renderer/src/components/editor

Repository: stablyai/orca

Length of output: 43324


🏁 Script executed:

set -eu
rg -n -C 12 -F --glob '*.{ts,tsx}' --glob '!*.test.*' '<ImageViewer' src/renderer/src
rg -n -C 8 -i --glob '*.{ts,tsx}' --glob '!*.test.*' 'diff|conflict' src/renderer/src/components/editor | rg -n 'ImageViewer|Preview|Viewer|EditorPanelShell|sideBySide|conflict' || true
rg -n -F --glob '*.{ts,tsx}' 'function EditorPanelShell|const EditorPanelShell|export default function EditorPanelShell|ImageViewer|sideBySide|Diff' src/renderer/src/components/editor

Repository: stablyai/orca

Length of output: 42547


🏁 Script executed:

set -eu
printf '%s\n' '--- EditorDiffFileSurface ---'
nl -ba src/renderer/src/components/editor/EditorDiffFileSurface.tsx | sed -n '1,190p'
printf '%s\n' '--- EditorContent viewer branches ---'
rg -n -C 14 -F --glob '*.{ts,tsx}' --glob '!*.test.*' 'EditorDiffFileSurface|ImageDiffViewer|EditorEditFileSurface' src/renderer/src/components/editor
printf '%s\n' '--- isCmdSaveOwner definition and surrounding logic ---'
rg -n -C 12 -F --glob '*.tsx' 'isCmdSaveOwner' src/renderer/src/components/editor

Repository: stablyai/orca

Length of output: 8150


🏁 Script executed:

set -eu
nl -ba src/renderer/src/components/editor/EditorDiffFileSurface.tsx | sed -n '1,190p'
rg -n -C 14 -F --glob '*.{ts,tsx}' --glob '!*.test.*' 'EditorDiffFileSurface|ImageDiffViewer|EditorEditFileSurface' src/renderer/src/components/editor
rg -n -C 12 -F --glob '*.tsx' 'isCmdSaveOwner' src/renderer/src/components/editor

Repository: stablyai/orca

Length of output: 8082


🏁 Script executed:

printf '%s\n' '--- isCmdSaveOwner references ---'
rg -n -C 14 -F --glob '*.tsx' 'isCmdSaveOwner' src/renderer/src/components/editor || true
printf '%s\n' '--- diff surface references ---'
rg -n -C 18 -F --glob '*.{ts,tsx}' --glob '!*.test.*' 'EditorDiffFileSurface' src/renderer/src/components/editor || true
printf '%s\n' '--- candidate content files ---'
rg --files src/renderer/src/components/editor | rg 'Editor(Content|PanelShell)|editor-content|editor-panel-shell'

Repository: stablyai/orca

Length of output: 18680


🏁 Script executed:

set -eu
rg -n -C 18 -F --glob 'PdfViewer.tsx' 'rootRef' src/renderer/src/components/editor/PdfViewer.tsx
rg -n -C 18 -F --glob 'PdfViewer.tsx' 'ref={rootRef}' src/renderer/src/components/editor/PdfViewer.tsx

Repository: stablyai/orca

Length of output: 5212


🏁 Script executed:

set -eu
rg -n -C 18 -F 'rootRef' src/renderer/src/components/editor/PdfViewer.tsx
rg -n -C 18 -F 'ref={rootRef}' src/renderer/src/components/editor/PdfViewer.tsx

Repository: stablyai/orca

Length of output: 5212


Exclude targets inside another PDF root before the outside-root fallback.

A visible binary diff renders two PdfViewer instances under the same owning panel. A key event inside one viewer can therefore pass the fallback for the other viewer. Both find bars can open because each viewer has its own window listener.

Mark each PDF root and reject targets that belong to a different PDF root before applying the panel fallback.

🐛 Suggested fix
-  return (
+  const targetPdfRoot =
+    target instanceof Element ? target.closest('[data-pdf-viewer-root]') : null
+  if (targetPdfRoot && targetPdfRoot !== root) {
+    return false
+  }
+  return (
     ownsShortcuts &&
-    <div ref={rootRef} className="flex h-full min-h-0 flex-col">
+    <div
+      ref={rootRef}
+      data-pdf-viewer-root
+      className="flex h-full min-h-0 flex-col"
+    >

Resolve EditorPanel and PdfViewer: use main's EditorCommandOwnerContext for the
PDF find gate (drop our duplicate editor-shortcut-owner context), keep main's
zoom handling, and reduce use-pdf-viewer-shortcuts to use-pdf-viewer-find-shortcut.
@brennanb2025

Copy link
Copy Markdown
Contributor Author

Merged main into the branch (e54452c) to resolve conflicts in EditorPanel.tsx and PdfViewer.tsx.

Main's #26652 had added the same "focused editor pane owns app commands" context that this PR had added for PDF find, and moved PDF zoom to that owner:

  • This PR's copy of the context is removed, and PDF find now reads main's EditorCommandOwnerContext.
  • PDF zoom is main's code, unchanged.
  • The PDF part of this PR is now just the Cmd/Ctrl+F gate, in use-pdf-viewer-find-shortcut.ts. Its behavior is the same as before the merge.

Both typechecks, 291 targeted tests (including main's new PDF zoom and ownership tests) and orca-ci-checks pass. CI is green on the merge commit.

Main split the message row into user and assistant rows: re-apply the find skip
on the user meta row in NativeChatUserMessageRow. Main's streamed replies wrap
each fading word in its own span: find joins a word group's text so phrases
match while words fade in, and treats words drawn into a group as text growth
(throttled) unless a removed word held a match.
@brennanb2025
brennanb2025 merged commit ebb192e into main Oct 9, 2026
32 checks passed
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