Skip to content

fix(tab-split): drop editor tabs onto browser-tab panes - #1006

Closed
brennanb2025 wants to merge 4 commits into
mainfrom
brennanb2025/tab-split-on-browser-fix
Closed

brennanb2025 wants to merge 4 commits into
mainfrom
brennanb2025/tab-split-on-browser-fix

Conversation

@brennanb2025

@brennanb2025 brennanb2025 commented Apr 23, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Fix silent failure when dragging an editor/terminal tab onto a split over a browser tab. Electron <webview> guests run in a separate Chromium process and capture pointerup off the host renderer's event loop, so dnd-kit's onDragEnd never fired even though the blue drop overlay appeared.
  • New webview-drag-passthrough.ts owns a registry of live webview elements and toggles pointer-events: none on them for the duration of an active dnd-kit tab drag. useTabDragSplit flips the toggle via a useEffect keyed on activeDrag, and cleanup restores input even if the hook unmounts mid-drag. HTML5-drag listeners in BrowserPane are untouched — they still handle drag-out of images/text.
  • Make the passthrough registry survive Vite HMR by stashing the Set on window (webviews are registered once on creation, not on every mount, so a fresh module instance would otherwise lose them). Mirrors the existing DRAG_LISTENER_KEY pattern in BrowserPane.tsx.

Test plan

  • Drag an editor tab over a browser-tab pane; the blue split overlay appears and dropping actually splits the pane.
  • Drag a terminal tab over a browser-tab pane; same behavior.
  • Dragging images/text out of a browser webview still works (HTML5 drag path unaffected).
  • Edit webview-drag-passthrough.ts with the dev server running; after HMR, tab-drag passthrough still works without a full reload.
  • Cancel a drag mid-flight (Esc or drop outside); webview regains pointer input.

Risk: medium
Historic risk metadata backfill based on the existing risk:medium label.

Root cause: Electron `<webview>` guests run in a separate Chromium process
and capture pointerup off the host renderer's event loop. During a dnd-kit
tab drag, the drag-over overlay appeared (blue rectangle), but pointerup
landed in the guest instead of document, so onDragEnd never fired and the
drop silently did nothing.

Flip `pointer-events: none` on every registered webview for the duration
of an active tab drag so the host's PointerSensor sees the release.
HTML5-drag listeners in BrowserPane keep their original purpose (drag-out
of images/text); dnd-kit pointer drags now toggle the same passthrough
via a useEffect keyed on activeDrag, and cleanup restores input even if
the hook unmounts mid-drag.

- New `webview-drag-passthrough.ts` owns the webview set + toggle helper
  so useTabDragSplit can call it without importing BrowserPane.
- BrowserPane registers each created webview and unregisters on destroy.
Vite HMR reloads `webview-drag-passthrough.ts` in isolation, replacing the
module-level `registry` Set with a fresh empty one. But the live `<webview>`
elements are registered once from BrowserPane's "create new webview" branch
(not on every mount), so after HMR the reloaded module has no record of
them and tab-drag pointer passthrough silently stops working until a full
reload.

Stash the Set on `window` under a well-known key so the reloaded module
instance re-adopts existing registrations. Mirrors the DRAG_LISTENER_KEY
pattern already used in BrowserPane.tsx. Falls back to a module-local Set
in non-DOM contexts (tests).
The prior pointer-passthrough fix made drops onto a browser pane *work*
(pointerup reached the host and onDragEnd fired), but the blue
`.tab-drop-overlay` hitbox was still invisible during the drag. Electron
`<webview>` guests paint in their own GPU compositor layer above normal
DOM regardless of CSS z-index, so the overlay element (z-index 9999)
rendered at the correct coords but was occluded by the webview's
composite.

Flip `visibility: hidden` alongside `pointer-events: none` while a tab
drag is active, restored on drag end. Using `visibility` (not `display:
none`) preserves layout so the overlay's computed rect still matches
the pane body.

Verified in a running dev build: pre-fix the overlay DOM appeared at the
expected rect but no blue rendered; post-fix the hitbox is visible and
the drop still completes correctly.
@nwparker nwparker added the size/s Small PR (≤150 added lines, ≤10 files) label Apr 26, 2026
@nwparker nwparker added the risk:medium Medium risk change label May 30, 2026
AmethystLiang added a commit that referenced this pull request Nov 21, 2026
…journal/ (#46397)

* feat(bots): journal each closed item and its PRs in the bot's memory/journal/

When a bot's item closes, Orca appends one line per linked PR to
memory/journal/YYYY-MM.md in the bot's home, from Items and the desktop's
PR cache: '- 2026-11-21 | item #1006 | PR #4417 merged | <title>'. No model
and no bot writes it, so finished work stays findable with grep after
status leaves MEMORY.md. Only items from chats acting for the owner are
journaled; each line is written once, on the bot's memory queue.

* fix(bots): journal each close once by item and PR, and retry lines a busy file kept out

A close is one line by its date, item and PR, so a PR state the cache
learns later never writes it twice. A month file that keeps changing under
a write throws, so the pass keeps its mark and writes those lines next
time. A pass reads up to 100 closed items.

* fix(bots): journal each close once, by its item, and judge the owner by the conversation root

A close is written once, all its lines in one append, so a later pass that
sees the same close with newer PR state or links adds nothing. An unread
PR is named by its number. The owner check looks up the conversation's
/clear root, as other acts-for checks do.

* test(bots): pin which chats' closes the journal takes, by root and with old event runs

* fix(bots): journal every close in the window, catch up after a restart, keep repos apart

A pass reads closed items page by page until the window is covered, so a
burst of closes is never cut at the first page. On start, one pass catches
up on closes made while Orca was off. PRs are told apart by their full
reference, so two repos' #7 are two lines, named with their repo.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk:medium Medium risk change size/s Small PR (≤150 added lines, ≤10 files)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants