fix(desktop): keep the window controls and the context popover usable beside the work panel - #221
Merged
Merged
Conversation
|
@molicherry is attempting to deploy a commit to the vastsa's projects Team on Vercel. A member of the Team first needs to authorize it. |
Windows/Linux draw minimize/maximize/close in a 120px band fixed to the window's top-right corner. With the work panel open that band sits over the panel header, which is a `-webkit-app-region: drag` region. The header only padded its content clear of the band, and a native drag rectangle is the element's border box, so the rectangle still spanned the band. Electron consumes mouse input over a drag rectangle, so the controls received neither hover nor click: they read as greyed out and did nothing. End the header's box before the band instead (margin-right rather than padding-right). The base 46px right padding keeps the content inset identical, so the panel layout is unchanged and the band's opaque surface covers the strip the header no longer paints. Tests now require the box-terminating reservation and reject the padding-only form. The design system, the component spec, and the Windows/Linux chrome E2E scenario state the geometric termination rule, and that scenario now asserts the window controls themselves take hover and click while the panel is open. zh-CN mirrors are synced.
The composer's context-usage popover is portaled to `document.body`, positioned in viewport coordinates, and clamped horizontally against the viewport (`window.innerWidth`). With the work panel open the trigger sits at the conversation pane's right edge, so that clamp pushed the popover onto the panel's column — where the panel's native browser and plugin views, which composite above every renderer layer, covered it. No z-index in the ladder can lift a renderer layer over a native surface, so the summary read as clipped mid-glyph. Clamp against the conversation pane instead: its right edge is exactly where the panel begins. `placeContextInspector` takes the trigger, popover, pane, and viewport rects and returns the placement plus the widest box the pane can still afford, so a pane narrower than the popover narrows the popover rather than letting it cross the edge. The vertical above/below fallback is unchanged. The design system, the component spec, and the composer-inspector E2E scenario record the pane clamp and why a viewport clamp cannot work against native surfaces; zh-CN mirrors are synced.
molicherry
force-pushed
the
fix/workpanel-controls-drag
branch
from
September 11, 2026 05:52
a864fbc to
f10c370
Compare
Owner
|
Reviewed and verified. The principle is sound: the pre-PR code left the work-panel header's native drag rectangle across the fixed Windows/Linux control band, and the body-portaled context inspector could be clamped into the native work-panel surface. The PR fixes both within the existing shell architecture and adds focused regression coverage plus synchronized specs/E2E documentation. Validation against the fork head:
The PR was merged intact into |
Closed
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.
Problem
Two surfaces break when the work panel is open on Windows/Linux.
Window controls. minimize/maximize/close are renderer-drawn in a 120px band
fixed to the window's top-right. With the panel open that band sits over the
panel header, which is a
-webkit-app-region: dragregion and only padded itscontent clear of the band. A native drag rectangle is the element's border box,
so the rectangle still spanned the band, and Electron consumed the controls'
hover and click: they looked greyed out and did nothing.
Context popover. The composer's context-usage popover is portaled to
document.bodyand clamped horizontally against the viewport. With the panelopen the trigger sits at the conversation pane's right edge, so the clamp
pushed the popover onto the panel's column — where the panel's native browser
and plugin views, which composite above every renderer layer, covered it. No
z-index can lift a renderer layer over a native surface, so the summary read
as clipped mid-glyph.
Change
work-panel.css: the win32/linux header reservation ends the header's boxbefore the band (
margin-right) instead of padding its content. The base 46pxright padding keeps the content inset identical, so the panel layout is
unchanged and the band's opaque surface covers the strip the header no longer
paints. This restores the rule the stylesheet already applies to every other
drag rectangle ("End every native drag rectangle before the window-control hit
targets").
lib/context-inspector-position.ts(new) +ContextUsageInspector.tsx: thepopover clamps to the conversation pane, whose right edge is exactly where the
panel begins, and narrows with a narrow pane instead of crossing that edge.
Tests
context-inspector-position.test.mjs(new, 8 cases) — the first is theregression: with the trigger at the pane's right edge the popover must end
inside the pane.
window-menu/work-panel/sidebar-navigationrequire the box-terminatingreservation and reject the padding-only form.
take hover and click while the panel is open; the composer-inspector scenario
gains a work-panel-open step.
Docs
Design system (geometric termination, and the native-surface rule for portaled
popovers), component spec, and both E2E scenarios updated; zh-CN mirrors synced.
Verification
pnpm --filter @pi-desktop/desktop typecheck— clean.node --test test/*.test.mjsinapps/desktop— 1362 tests, 1340 pass, 20environment-only failures (macOS release scripts need bash/WSL and a POSIX exec
bit; the fs-scope suite needs symlink privileges on Windows).
node scripts/check-style-tokens.mjs— OK.