Skip to content

Chat tabs get the terminal's right-click actions - #37442

Merged
brennanb2025 merged 4 commits into
mainfrom
brennanb2025/chat-menu-parity
Nov 2, 2026
Merged

brennanb2025 merged 4 commits into
mainfrom
brennanb2025/chat-menu-parity

Conversation

@brennanb2025

@brennanb2025 brennanb2025 commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 5 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​346 $\color{#cf222e}{\Huge{\mathbf{−}}}$​26 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​320
Prod 18 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​499 $\color{#cf222e}{\Huge{\mathbf{−}}}$​97 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​402

Problem. Right-clicking inside a chat tab offered only Find, Hand Off, Split and Copy Orca Session ID, while right-clicking a terminal running the same agent offered Quick Commands, Fork, Copy Context, a way to continue elsewhere, the agent's own session ID and Close tab. Users moving between terminals and chat tabs lost those actions in chats.

What users get. A chat tab's right-click menu now offers, in the terminal menu's order (rows hide while they can't apply):

  • Quick Commands › runs a saved shell command or agent prompt in a new tab, exactly as the tab bar's Quick Commands button does for a chat, and Add Quick Command… opens the usual editor.
  • Fork Agent Session… opens the existing fork dialog with this chat's transcript (create a new workspace with an agent draft, or copy the fork prompt).
  • Copy Context copies the same bounded transcript without the fork instructions.
  • Continue with Terminal Agent is the same action as the chat tab's tab-bar menu, sharing its pending state and tooltip.
  • Copy Session ID copies the provider's own session ID (shown once the agent reports it); Copy Orca Session ID stays as before.
  • Close tab now appears without a split, with the tab-close shortcut; pinned tabs stay protected.

Find in chat, Hand Off to Another Agent and Split Chat Right/Down are unchanged. The terminal menu and the chat-inside-a-terminal-pane menu are unchanged.

How it works. Each row reuses the existing command: the terminal's Quick Commands submenu and editor with the tab bar's new-tab runner, the terminal's fork dialog and launcher (now taking a focus callback instead of a terminal pane), the terminal's Copy Context bounding and toasts (moved into a shared helper), and the tab bar's continue-in-terminal component. A chat's transcript comes from the host's saved continuation context, falling back to the loaded messages on older hosts. Menu data (quick commands, repos, the provider session ID) is read only while the menu is open, so chats with closed menus do no extra work; a contract test checks this at 6 and 60 open chats.

Intended differences from the terminal menu. Quick Commands open a new tab and show no "Insert" hint, matching the tab bar's Quick Commands for a chat, which has no terminal to type into. A chat has no terminal, so it offers no Set Title, Copy Terminal ID, Copy Pane ID, Clear Screen or Reset Terminal rows. The two copy-ID rows distinguish the provider's session from Orca's session ID.

Existing behavior the chat rows inherit from the terminal menu (not changed here). In a folder workspace without git, Fork Agent Session… → Create fork reports that the workspace can't be forked (Copy fork context still works), as the terminal does today. When two hosts publish the same workspace, Fork can pick the other host's branch, tracked in STA-13471. A clipboard failure in Copy Context shows the raw error text, as the terminal does today.

Quick Commands and the provider Copy Session ID now read their data from
components that mount only inside the open chat menu, so closed menus in
retained chats do no work on repo, project or agent-status writes. The
add-command editor reuses the terminal's editor dialog and outlives the menu.

Chat menus also stop showing the Insert hint, since they run every quick
command in a new tab the way the tab bar's Quick Commands menu does.
@brennanb2025
brennanb2025 marked this pull request as ready for review November 2, 2026 11:19
@brennanb2025
brennanb2025 marked this pull request as draft November 2, 2026 11:26
@brennanb2025
brennanb2025 marked this pull request as ready for review November 2, 2026 11:26
@coderabbitai

coderabbitai Bot commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 93956522-319d-46f6-81a0-3a98670f3381
Commits

Reviewing files that changed from the base of the PR and between 51cb2f1 and f508fcb.

Files selected for processing: 23
  • src/renderer/src/components/native-chat/NativeChatProviderSessionIdMenuItem.tsx
  • src/renderer/src/components/native-chat/NativeChatStructuredPaneMenuItems.tsx
  • src/renderer/src/components/native-chat/NativeChatStructuredSession.tsx
  • src/renderer/src/components/native-chat/native-chat-session-context.ts
  • src/renderer/src/components/native-chat/structured-chat-menu-lifetime.test.tsx
  • src/renderer/src/components/native-chat/use-native-chat-context-menu.tsx
  • src/renderer/src/components/native-chat/use-native-chat-quick-commands-menu.tsx
  • src/renderer/src/components/native-chat/use-native-chat-session-context-actions.tsx
  • src/renderer/src/components/native-chat/use-native-chat-standalone-menu.tsx
  • src/renderer/src/components/native-chat/use-structured-native-chat-pane-commands.test.tsx
  • src/renderer/src/components/native-chat/use-structured-native-chat-pane-commands.tsx
  • src/renderer/src/components/tab-bar/NativeChatCliForkMenuItems.tsx
  • src/renderer/src/components/terminal-pane/AgentSessionContextCopyMenuItem.tsx
  • src/renderer/src/components/terminal-pane/TerminalAgentSessionForkDialog.test.tsx
  • src/renderer/src/components/terminal-pane/TerminalContextMenu.test.tsx
  • src/renderer/src/components/terminal-pane/TerminalQuickCommandsSubmenu.tsx
  • src/renderer/src/components/terminal-pane/terminal-agent-session-fork.ts
  • src/renderer/src/components/terminal-pane/use-terminal-pane-context-actions.ts
  • src/renderer/src/components/terminal-pane/use-terminal-pane-startup-actions.ts
  • src/renderer/src/hooks/use-visible-terminal-quick-command-hosts.ts
  • src/renderer/src/i18n/locales/en.json
  • src/renderer/src/lib/copy-agent-session-context.ts
  • tests/e2e/terminal-agent-fork-draft-ownership.unit.test.ts

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

Walkthrough

Native chat menus now include quick-command, session-context, and session-ID actions, with dialogs for editing commands and forking sessions. Session context can come from a runtime continuation request or from loaded messages. Shared helpers also handle context copying and quick-command host filtering in terminal code. Pane-close visibility now follows the shared close action.

Merge Risk: Minimal · up to f508f

No actionable merge-blocking issue was identified in the new chat menu actions. The change is ready to merge after normal checks.

Pre-merge checks: Passed 3 · Failed 2

Failed Failed checks: 2 warnings

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 5.56% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat… Write docstrings for the functions missing them to satisfy the coverage threshold.
Description check Warning The description covers the problem, the user-facing changes, the mechanism, and intended differences from the terminal menu. It also lists the testing performed and known inherited issues. Several tem… Add an ELI5 summary in plain language. Replace 'Fixes #' with a real linked issue number. Attach before/after screenshots or a video of the chat tab right-click menu. Select a Risk Level (Low, Medium, or High), name the riskiest part, and d…
Passed Passed checks: 3 passed
Check name Status Explanation
Title check Passed The title clearly and concisely describes the main change: adding terminal-style right-click actions to chat tabs.
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.
Full details: Docstring Coverage

Explanation

Docstring coverage is 5.56% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 18 functions across 22 files. (1 skipped: 1 unsupported.)

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

Full details: Description check

Explanation

The description covers the problem, the user-facing changes, the mechanism, and intended differences from the terminal menu. It also lists the testing performed and known inherited issues. Several template sections are missing or incomplete. The ELI5 section is absent. The Linked Issue section reads 'Fixes #' with no issue number, which the template marks as mandatory for outside contributors. The Visual Proof section has no before/after screenshots or video for a UI behavior change. The Risk section has no Level selection and no rollback guidance. The Testing checklist boxes are unticked, and the description does not state which platforms were tested. The Review and Notes sections are not addressed. The description is substantive, so it is not off-topic, but the template is largely unfilled.

Resolution

Add an ELI5 summary in plain language. Replace 'Fixes #' with a real linked issue number. Attach before/after screenshots or a video of the chat tab right-click menu. Select a Risk Level (Low, Medium, or High), name the riskiest part, and describe how to revert. State which platforms were manually tested (macOS, Linux, Windows, or SSH) and tick the testing checkboxes that apply. Complete the Checklist items, including confirming pnpm lint, typecheck, test, and build status. Fill in the AI Disclosure section if the contributor is not an internal team member. Address the Review and Agent skill upstream boundary sections.

Finishing Touches
Generate docstrings
  • Commit to this branch
  • Create a new PR
  • Autofix · 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

@brennanb2025

brennanb2025 commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor Author

Review loop status: done

Problem. A chat tab's right-click menu lacked actions the terminal's menu has (Quick Commands, Fork, Copy Context, Continue with Terminal Agent, the agent's own session ID, Close tab without a split), so users lost them when working in chat tabs.

User-facing change. Those rows now appear in a chat tab's right-click menu in the terminal's order, each running the existing command (Quick Commands open a new tab like the tab bar's button). The terminal menu is unchanged.

Fixed during review

  • The first version made every open chat subscribe to the repo list, project setup data and the agent session ID even with its menu closed (a SHA-256 hash per chat on every app state change). That data is now read only inside the open menu; a contract test asserts zero added work and renders at 6 and 60 chats with menus closed (it failed on the old head: e.g. 60 re-renders and 240 hashes per repo-list change).
  • A quick command set to "insert without Enter" showed an "Insert" hint in the chat menu but ran immediately in a new tab. The chat menu now shows no hint, matching the tab bar's Quick Commands; the terminal keeps its hint.

Verified

  • Three round-1 reviews (correctness, user-visible result, architecture), a repair check and a final-head check; a three-model design panel ruled the closed-menu fix (read menu data only while the menu is open, the common pattern).
  • Reference comparison of every row done; differences labelled intended in the PR description.
  • CI green on this head; 9 named menu/fork test files (90 tests) and the renderer typecheck pass after the main merge.
  • Screenshot run on a test copy (M4Air): chat right-click menu rows, order and separators; Quick Commands submenu with no Insert hint; Add Quick Command… editor stays open; Copy Session ID copies the provider ID (different from Orca's); Fork dialog opens; Close tab closes a single-pane chat; terminal menu unchanged and still shows Insert. Main was not compared (rows are new).

Not verified: remote/SSH chats in a running app (covered by code review and tests only).

For Brennan: existing behavior on main the chat rows now inherit (not changed here)

  • Folder workspaces: Fork Agent Session… → Create fork says the workspace can't be forked (Copy fork context works). Same in the terminal menu today; kept for parity.
  • Two hosts publishing the same workspace: Fork can pick the other host's branch. Same in the terminal; tracked in STA-13471.
  • Copy Context shows the raw clipboard error text on a clipboard failure. Same in the terminal.

For Brennan's review

Chat right-click menu:
(screenshot removed: contained real product data)

Chat Quick Commands (no Insert hint):
(screenshot removed: contained real product data)

Terminal Quick Commands (unchanged, Insert hint kept):
(screenshot removed: contained real product data)

Spots worth a look:

Head f508fcb includes a merge of main (51cb2f1) after review; CI and the screenshot run are on this head.

@brennanb2025
brennanb2025 merged commit 0747751 into main Nov 2, 2026
103 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