Repository navigation
fix(terminal-dock): leave dock pastes to the dock composer - #119
Merged
Merged
Conversation
Upstream's stablyai#23784 (taken in the v1.4.224 sync) narrowed the terminal pane's paste yield from the chat root marker to the chat cover. The dock opts out through that root marker and sits beside the xterm rather than under a cover, so Cmd+V, paste events, and app-menu pastes in the dock composer went to the terminal. The listeners now yield to the cover or the dock's chat root through a one-line import-swap seam.
There was a problem hiding this comment.
Your trial has ended. Reactivate Greptile to resume code reviews.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ELI5
When you pasted into the box under a terminal (the dock), the text landed in the terminal instead of the box. Now it lands in the box again.
What Changed
Before: Cmd+V, a right-click or Edit-menu paste, or any paste event in the dock composer was taken by the terminal pane and typed into the agent's terminal.
After: pastes in the dock go to the dock composer (images attach, text inserts). Pasting while the terminal itself is focused still goes to the terminal.
Mechanism: the terminal pane listens for paste in the capture phase over its whole container and skips targets it considers "owned by a chat". Upstream's stablyai#23784, taken in the v1.4.224 sync, changed that check from the chat root marker (
data-native-chat-root) to the chat cover (.native-chat-pane-shell). The dock opts out with the root marker and sits beside the xterm rather than under a cover, so the terminal stopped skipping it. A new fork check,isTerminalPasteOwnedByChat, yields to either the cover or a chat root. The upstream listener file picks it up through a one-line import-swap seam, so none of its bodies change.Why
Adding the cover class to the dock was the other option, but upstream uses that class to decide a pane's xterm is hidden. It would mark docked terminals inert and redirect pane focus away from them. Keeping the yield in a fork module leaves upstream's cover semantics alone and keeps the seam to one declared line.
Linked Issue
N/A, fork regression from the v1.4.224 sync.
Visual Proof
N/A. The new test reproduces the bug on all three paste paths: it fails on main and passes with this change.
Testing
New
fork-terminal-dock/terminal-dock-paste-yield.test.tsfails on main for Cmd+V, paste events, and app-menu paste in the dock, and passes with the fix. A control case checks that Cmd+V on the xterm still pastes into the terminal.On the remote sandbox, the new test plus
TerminalDock.test.tsx,use-terminal-pane-global-effects-paste-events.test.ts, anduse-native-chat-paste-bridge.test.tsxpassed 41 of 41.lint-staged(oxfmt and oxlint) is clean, and the fork ownership guard passed on the change.I didn't test it by hand in the app.
I manually tested these changes locally
Automated tests added/updated, or explained why not below
AI Disclosure
Claude Code (Claude Opus 5.5) found the root cause and wrote the fix and test.
Review
Agent skill upstream boundary
Notes
Renderer-only DOM check, so behavior is the same on every platform and for SSH workspaces.
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)