fix(desktop): keep the framed titlebar identity clear of native caption controls - #678
Open
wuzao368 wants to merge 1 commit into
Open
fix(desktop): keep the framed titlebar identity clear of native caption controls#678wuzao368 wants to merge 1 commit into
wuzao368 wants to merge 1 commit into
Conversation
…on controls On narrow windows the viewport-centered identity row (product name, version pill, presentation-mode pill) overflows into the rightmost native caption-controls strip reserved by titleBarOverlay, so the pills visually collide with the minimize/restore/close glyphs. Cap the identity to the visible title-bar band (2 * (caption width + padding) on both sides of the viewport center), allow its children to shrink with ellipsis, and hide the decorative product label below 480px. The identity can no longer reach the native controls at any width; supported window widths (>= 640px) are unaffected.
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
On Windows (compatibility / extended modes), when the main window is narrow, the centered title-bar identity row — product name, version pill, and presentation-mode pill — overflows into the rightmost native caption-controls strip reserved for the
titleBarOverlaybuttons. Because the overlay background is fully transparent (#00000000), the version/mode pills remain visible underneath the native minimize / restore / close glyphs, which renders as colliding or overlapping buttons.The overlap happens whenever the identity's natural width (≈210–270px) exceeds
windowWidth − 292px(below roughly 370–430px window widths). Restored narrow bounds from older builds (persistedmain-window-state.json) or high-DPI configurations make this easy to hit.Root cause
src/client/extended-styles.tspositions the identity with:The frame is viewport-centered while the frame padding is asymmetric (
0 146px 0 8pxon win32), so the centered box needs a cap that reserves the full native strip on both sides:2 × (WINDOWS_CAPTION_CONTROLS_WIDTH + 8) = 292pxon win32,2 × (MACOS_TRAFFIC_LIGHT_SAFE_WIDTH + 8) = 176pxon macOS.Fix
.dshDesktopFrameIdentityto the visible title-bar band per platform (max-width: calc(100% - 292px)/calc(100% - 176px)), so it can never reach the native controls at any window width. The identity always stays within[146, W−146]on Windows — 8px clear of the overlay strip on the right, clear of the action buttons on the left.min-width: 0) and truncate with an ellipsis instead of spilling.Supported window widths (≥ 640px) are unaffected — the cap only engages below ~566px.
Verification
yarn workspace dsh-plugin-desktop typecheck— passes (all 5 tsconfigs).vitest run tests/client-environment.spec.ts— 20/20 pass, including new regression assertions for the identity cap, child shrink/ellipsis rules, and the narrow-width media query.[146, W−146]never intersects the native overlay zone[W−138, W].Notes
dshNativeFrame) is an empty drag strip and the advanced-mode caption row is empty (aria-hidden), so neither has this surface.