fix(desktop): prevent sidebar buttons from shifting under macOS traffic lights on zoom - #45266
fix(desktop): prevent sidebar buttons from shifting under macOS traffic lights on zoom#45266liuhao1024 wants to merge 1 commit into
Conversation
…ic lights on zoom The viewportIsFullscreen() fallback returned true when the window filled the screen (innerWidth >= screen.width && innerHeight >= screen.height), but on macOS "zoom" (double-click titlebar to maximize) the traffic-light buttons are still visible at the top-left. This caused titlebarControls to pin to TITLEBAR_EDGE_INSET (14px), placing the sidebar/swap buttons directly underneath the traffic lights. Fix by checking screen.availHeight vs screen.height: true macOS fullscreen hides the menu bar (availHeight === height), while zoom keeps it visible (availHeight < height). Only treat the viewport as fullscreen when the menu bar is also hidden. Fixes NousResearch#45264
|
Thanks for tracing this to the renderer fallback. The premise is still present on current main: Problems
Suggested changes
Automated hermes-sweeper review. |
|
Thanks for the PR — your diagnosis of the However, the target file ( Since the file this PR modifies no longer exists and the underlying issue is fixed on |
What does this PR do?
Fixes the sidebar and session-swap buttons shifting underneath macOS traffic-light controls when the window is maximized via "zoom" (double-click titlebar). The viewport fullscreen fallback incorrectly treated zoom as fullscreen, pinning the titlebar controls to the left edge where they collided with the still-visible traffic lights.
Related Issue
Fixes #45264
Type of Change
Changes Made
apps/desktop/src/app/shell/app-shell.tsx: UpdatedviewportIsFullscreen()to distinguish true macOS fullscreen (menu bar hidden,screen.availHeight === screen.height) from zoom/maximize (menu bar visible,availHeight < screen.height). Exported the function for testing.apps/desktop/src/app/shell/titlebar.test.ts: Added 4 tests forviewportIsFullscreencovering windowed, true fullscreen, macOS zoom ([Bug]: Sidebar and session swap buttons move when app is full screen on macOS #45264 regression), and Windows/Linux cases.How to Test
cd apps/desktop && npx vitest run src/app/shell/titlebar.test.ts— all 8 tests passChecklist
Code
fix(scope):,feat(scope):, etc.)npx vitest run src/app/shell/titlebar.test.tsand all tests passDocumentation & Housekeeping
docs/, docstrings) — or N/Acli-config.yaml.exampleif I added/changed config keys — or N/ACONTRIBUTING.mdorAGENTS.mdif I changed architecture or workflows — or N/ACode Intelligence
apps/desktop/src/app/shell/app-shell.tsx,apps/desktop/src/app/shell/titlebar.ts,apps/desktop/src/app/shell/titlebar.test.tstitlebarControlsPosition()unchanged; only theviewportIsFullscreenfallback refined