Skip to content

fix(terminal-dock): leave dock pastes to the dock composer - #119

Merged
zpyoung merged 1 commit into
mainfrom
zpyoung/terminal-dock-paste-yield
Oct 15, 2026
Merged

zpyoung merged 1 commit into
mainfrom
zpyoung/terminal-dock-paste-yield

Conversation

@zpyoung

@zpyoung zpyoung commented Oct 15, 2026 •

Copy link
Copy Markdown
Owner
Files Added Deleted Net
Test 1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​109 0 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​109
Prod 3 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​26 $\color{#cf222e}{\Huge{\mathbf{−}}}$​1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​25

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.ts fails 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, and use-native-chat-paste-bridge.test.tsx passed 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

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

Notes

Renderer-only DOM check, so behavior is the same on every platform and for SSH workspaces.

Checklist

  • This PR is small and focused
  • I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
  • Before/after screenshots or videos attached for UI changes, or N/A with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
  • pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred)

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.
Copilot AI balanced review requested due to automatic review settings October 15, 2026 18:57

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Your trial has ended. Reactivate Greptile to resume code reviews.

@zpyoung
zpyoung merged commit c923f8e into main Oct 15, 2026
49 of 51 checks passed
@zpyoung
zpyoung deleted the zpyoung/terminal-dock-paste-yield branch October 15, 2026 19:25
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.

2 participants