Repository navigation
fix(file-drop): deliver terminal files to the pane under the cursor (STA-6940 PR4/6) - #26008
Conversation
…2025/sta-6940-pr3-chat-composer-feedback
…lumbing' into brennanb2025/sta-6940-pr3-chat-composer-feedback
…-pr2-drop-plumbing
Preserve element-owned drops while integrating the upstream multi-file paperclip picker and all-or-nothing attachment limit. Resolve NativeChatComposer through its existing file-drop hook, keep the host-qualified attachment resolver with the current workspace state type, retain captured destinations and unmount checks through attachment reads and uploads, and keep attachment actions picker-only without a broadcast subscriber. Update picker fixtures and the upstream subscriber test. Validation: web and Node typechecks, full Oxlint on 39 PR3 files, and 372 tests across 45 explicitly named files pass.
…omposer-feedback' into brennanb2025/sta-6940-pr4-terminal-owners
Review summaryThis PR went through an independent code review, a fix round, a focused re-review of the fix, and a rendered check in a real Orca window. The reviewers and the rendered-check agent did not write the code. Their reports are summarized here because they were kept off GitHub while the work was in progress. During the build: a staging gap, resolved with a temporary boundaryOnce this PR removes the terminal's old drop marker, a drop on the divider between two panes has no owner. Until PR 6 removes the old routing, a drop with no marker is still sent to the editor, so the file would have opened as an editor tab (today it does nothing). A temporary boundary on the outer terminal wrapper keeps that drop on the "not allowed" path: the app releases it, no surface claims it, and the existing guard refuses it silently. It is labelled temporary and listed for removal in PR 6. First review (head
|
Resolve NativeChatComposerField imports: keep PR3's flushSync (interrupted composition settlement) and drop the old ImageOff notice import that main's notice card replaced. Adapt PR3's IME file-drop test to main's notices and @-file suggestion props.
Ready for reviewPR 3 (#25781) is now merged, so this PR no longer depends on anything open. It was brought up to date with
The review summary is in the comment above and the rendered-check screenshots are in the description. Nothing in the review or rendered check changed with this sync. |
ELI5
An operating-system file drop could reach the active terminal split instead of the split under the cursor because delivery was broadcast to the window and reconstructed from routing attributes. The first draft of this migration also silently refused every real terminal title and body drop: the pane manager returns a new public object on each read, but both acceptance and delivery compared those objects directly. The tests reused the same objects and missed that failure.
This is PR 4 of 6 for STA-6940. A file dropped on pane A's title or body now goes to A while pane B stays active. Nested chat receives its own drops; hidden terminals and gaps between panes receive nothing. Replacing a pane's container while a file is being prepared cancels that delivery, even if the pane's IDs stay the same.
Dependencies: none remain open. PR1 #25749, PR2 #25748 and PR3 #25781 are on main; PR3 merged as squash commit
2803be77f6785f6a14098c4c3187ca6cd1ff99c8. PR5 migrates the remaining explorer, sidebar, tab and editor owners; PR6 removes legacy delivery.Final main sync (2026-10-07): merge
474e6ad03ae419f5cf4ddafad5f674826d020b2fbrings in maina551aa5fe67ec4a6e3dd81fe384a146248b610b7with a normal merge, without a rebase or force-push. PR4 contained an older copy of PR3's commits, which conflicted with PR3's final reviewed state on main in two attachment implementation files and three chat drop tests. None belongs to PR4's own 22-file change, so all five were resolved to main's version.All 22 PR4-owned files are byte-identical to the previous PR4 head
2f4b3e83c8fe6173b80738a510ba6c78c2ed5d58. The final diff against the merged main snapshot contains exactly those 22 files; every chat file, including the automatic merges, matches that snapshot. The pane checks, shared title/body ordering and temporary divider boundary are unchanged, anddropScopeKeyis absent. This sync adds no user-facing behavior, notices or destinations. PR4 remains a draft and has not been marked ready or merged.What Changed
collectPublicPanesandtoPublicPanefunctions, returning new public objects on each call. Cover both split-pane titles and bodies, and old connected roots whose manager record has a replacement container before a drop or during preparation.agentconsumer, preserving readable macOS screenshot copies. Reuse local shell quoting, Windows Subsystem for Linux (WSL) mapping, SSH upload, runtime upload and host-qualified folder/worktree lookup. Floating terminals retain their local working directory even when another runtime is focused.No new notices or visual elements are added. Explorer, project sidebar, tab strip and editor delivery stay on their current paths.
Why
The browser identifies the element under the cursor, and its render closure identifies the pane. Capturing the destination before preparation prevents a replacement terminal or focused runtime from changing where a pending drop goes. Matching the pane's stable identity and container lets those checks work with the manager's existing public objects; it also distinguishes a replacement pane that reused the same IDs.
Differences from the common pattern:
PR5 migrates explorer, project sidebar, tab strips and editor groups. PR6 removes the remaining legacy delivery machinery, including this temporary boundary.
Linked Issue
STA-6940 — PR 4 of 6; this draft does not close the whole issue.
Visual Proof
A separate QA agent ran this branch (head
fd67741bc53) as a hidden Orca dev window with an isolated profile and simulated OS file drops through the Chrome DevTools Protocol. Terminal text was read from each pane's screen buffer and the active pane from app state. All 8 scenarios passed: title-bar and body drops on each of two side-by-side panes land only in that pane, a divider drop does nothing, a file name with a space is quoted, a second terminal tab receives only its own drop, the floating terminal receives drops, and a drag from Orca's file explorer still pastes.1. File dropped on the left pane's title bar while the right pane is active. The path lands in the left pane only; app state shows the right pane is still active.
2. File dropped on the divider between the panes. Nothing is pasted anywhere and no editor tab opens.
3. Drop on a second terminal tab, then back to the first. The first tab's panes gained nothing from the second tab's drop.
4. File dropped on the floating terminal. The path is pasted there; the main panes are unchanged.
5. File dragged from Orca's file explorer onto a pane (the unchanged path for drags that start inside Orca). It is still pasted.
Not covered: a chat nested inside a terminal pane in the real app (DOM tests only), real SSH, WSL and remote-runtime hosts, Linux and Windows.
Testing
Follow-up verification on macOS:
d844eb9b0befd72297efe249bed2b6e319176a38,terminal-pane-element-file-drop.test.tsxran 18 cases: 12 failed / 6 passed. Both title and body delivery cases failed because the terminal received zero writes; the preparation-replacement cases also confirmed no preparation began. There were no import or missing-API failures.The before/after reproduction used this explicitly named file in a Bash array:
Current maintenance verification (
474e6ad03ae): the original 68 explicitly named files plus PR3's chat drop suites still present on main, conflict-related chat coverage and prior maintenance checks ran together in a 76-file Bash array: 76 passed (76); 677 passed (677). Every file was checked to exist and the array was checked to be non-empty before running Vitest. No test timeouts changed.Current-head CI: All 37 checks on this head finished: 19 passed / 18 skipped by workflow path rules, with no failures and no reruns. PR Checks run 37703637854 passed on its first attempt, including static analysis/typechecking, all ten unit-test shards, relay integration, macOS and Windows packaging, final verification and the unit-selection report. Mobile verification and the line-count check also passed in their separate workflows.
The exact combined regression command was:
76-file regression command (Bash; includes the original 68 files)
Fresh local checks passed:
pnpm install --frozen-lockfile; deletedconfig/tsconfig.*.tsbuildinfobefore checks.orca-ci-checks, including lint, code-quality audits, localization and typechecking; checks for changed code and React components reran successfully after committing the merge.dropScopeKeyoccurrences or unresolved conflict markers.Restored pnpm's incidental
@pnpm/exeaddition, leaving no lockfile change. No fixes for unrelated main code, documentation files, user-visible strings or app launches were added. The Visual Proof above remains historical evidence fromfd67741bc53; no new Electron, live SSH, WSL or remote-runtime checks were performed locally during this sync.Review
Reviewed all PR4 production changes for comparisons against public pane objects; the two repaired checks were the only wrapper-identity comparisons. Self-reviewed capture, nested arbitration, sibling ordering, transport replacement, hidden owners, gap refusal, unchanged internal drags and the existing upload/path-mapping boundaries. The title overlay and global-effects files remain smaller and within their line limits.
The 22 files PR4 itself changes
src/preload/preload-runtime-support.tssrc/renderer/src/components/terminal-pane/TerminalPaneFileDropOwner.tsxsrc/renderer/src/components/terminal-pane/TerminalPaneHeaderDropSurface.tsxsrc/renderer/src/components/terminal-pane/TerminalPaneHeaderOverlay.test.tsxsrc/renderer/src/components/terminal-pane/TerminalPaneHeaderOverlay.tsxsrc/renderer/src/components/terminal-pane/TerminalPaneSurface.tsxsrc/renderer/src/components/terminal-pane/terminal-drop-handler.test.tssrc/renderer/src/components/terminal-pane/terminal-drop-handler.tssrc/renderer/src/components/terminal-pane/terminal-drop-local-workspace.test.tssrc/renderer/src/components/terminal-pane/terminal-drop-local-wsl.tssrc/renderer/src/components/terminal-pane/terminal-drop-pane-resolution.test.tssrc/renderer/src/components/terminal-pane/terminal-drop-pane-resolution.tssrc/renderer/src/components/terminal-pane/terminal-drop-runtime-catalog-owner.test.tssrc/renderer/src/components/terminal-pane/terminal-drop-target.tssrc/renderer/src/components/terminal-pane/terminal-native-file-drop-destination.tssrc/renderer/src/components/terminal-pane/terminal-native-file-drop.tssrc/renderer/src/components/terminal-pane/terminal-pane-element-file-drop.test.tsxsrc/renderer/src/components/terminal-pane/use-terminal-pane-file-drop-owner.tssrc/renderer/src/components/terminal-pane/use-terminal-pane-global-effects-file-drop.test.tssrc/renderer/src/components/terminal-pane/use-terminal-pane-global-effects.tssrc/renderer/src/lib/pane-manager/pane-display-visibility.tssrc/shared/native-file-drop-preparation.tsAgent skill upstream boundary
Notes
PR4 adds no documentation or lockfile changes relative to main. The coordinator approved the temporary boundary so divider drops are refused correctly before the editor migration and the legacy removal. Dependency refreshes come in as normal merges, with no rebase or force-push. This remains a draft and has not been marked ready or merged.
Checklist