Repository navigation
fix(app): drag the desktop window from the session header gap - #57867
Merged
Merged
Conversation
jlongster
force-pushed
the
header-gap-drag
branch
from
October 21, 2026 18:25
149d6f2 to
7198e46
Compare
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.
Issue for this PR
Closes #48422
Type of change
What does this PR do?
On macOS with vertical tabs the titlebar is hidden, so the window can only be moved from the small strip by the traffic lights, and not at all once the sidebar is collapsed (#48422). The session header sits on that titlebar row, so this lets the window be dragged from it.
app-region: dragon the sticky header bar first, but Chromium only recomputes drag regions on layout, so after the timeline scrolled the region was left over the messages (dragging text moved the window) and the header stopped dragging. An element that doesn't scroll avoids that.flex-1spacer at the end of the title slot (data-slot="session-header-gap"), rendered only while the title isn't being renamed. The active timeline hands it to the pane, and oneResizeObserver(pane, spacer, and the header row's sections) keeps the area over it at the header row's full height. Nothing runs while scrolling. The area is dropped when the gap is narrower than 24px or there is no active header. No header control sits under it, so none needs ano-dragexception.--shell-top-inset: 8px on macOS, 1px on Windows where the titlebar already sits above it) is also a drag region now, as in fix(app): restore top edge dragging with vertical tabs #48619.Known trade-offs on macOS (Electron behavior): wheel scrolling with the pointer over the gap doesn't scroll the timeline, and double-clicking the gap doesn't zoom (macOS only does that inside its own ~44px titlebar zone; the 8px strip does zoom).
Windows is untested: I only ran this on macOS. On Windows the area should drag, double-click should maximize and right-click should open the system menu, but someone needs to check.
How did you verify your code works?
Ran the dev Desktop app (Electron 44.9.1) against an isolated OpenCode Drive server with a long simulated session, with
ELECTRON_DEBUG_DRAGGABLE_REGIONS=1to see the regions, and drove it with real macOS mouse/wheel events (CGEvent), since Playwright clicks bypass the OS drag hit-testing:E2E: added a case in
session-header.spec.tsthat mounts the app with a desktop platform (the Windows-menu fixture now takes an optionalpath) and checks the area is a drag region spanning exactly from the ⋯ button to the actions and hides during rename; and a web case with no drag elements.session-header.spec.tspasses locally except "renames and closes the session tab from its context menu", which also fails on currentbeta.bun typecheckinpackages/apppasses.Screenshots / recordings
Captured from the real app with Electron's draggable-region overlay (red = drags the window): the red block covers exactly the space between the ⋯ button and the token readout, plus the strip above the pane, and stays in place while the timeline scrolls. Happy to attach them here if useful.
Checklist