fix(navigation): expose Windows titlebar height to renderer URL - #225
Open
yaojin3616 wants to merge 1 commit into
Open
fix(navigation): expose Windows titlebar height to renderer URL#225yaojin3616 wants to merge 1 commit into
yaojin3616 wants to merge 1 commit into
Conversation
Stamp the Windows renderer URL with dsh-desktop-titlebar-inset so plugins such as dsh-better-sidebar can detect the native 36px titlebar overlay and offset their right-side workspace controls accordingly. Previously only dsh-desktop-mode and dsh-desktop-platform were injected, so the WCO API being unavailable in the headless harness left the plugin without a signal to make room for the overlay - top-right buttons and the panel header rendered underneath the system minimize/maximize/close controls and were unclickable.
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.
Fixes #221.
Summary
Stamp the Windows renderer URL with
dsh-desktop-titlebar-insetsoplugins (notably
dsh-better-sidebar) can detect the native 36pxtitlebar overlay and offset their right-side workspace controls
accordingly.
Root cause
desktopHarnessUrl()insrc/main/window-navigation.tsinjected onlydsh-desktop-modeanddsh-desktop-platformonwin32. The plugin'stitlebar-compat path depends on either
navigator.windowControlsOverlayor the
dsh-desktop-titlebar-insetURL parameter; with neither presentand WCO unavailable in the headless harness, the plugin rendered its
right-edge controls (top buttons and the panel header) at y=3 / y=0,
directly under the system minimize / maximize / close buttons and the
app menu button, making them unclickable.
The fix reuses the existing
WINDOWS_TITLEBAR_HEIGHT = 36constantalready consumed by the native
titleBarOverlayso the renderer-sideinset always matches what the OS reserves at the top of the window.
Changes
src/main/window-navigation.ts: importWINDOWS_TITLEBAR_HEIGHTand set
dsh-desktop-titlebar-inset=<height>on the win32 rendererURL alongside the existing mode/platform params.
test/runtime.test.ts: extend the existing"stamps Windows renderer URLs" assertion to include
dsh-desktop-titlebar-inset=36; macOS path remains untouched.Verification
pnpm exec vitest run test/runtime.test.ts test/windows-titlebar.test.ts→ 51/51 passing.
tsc --noEmit -p tsconfig.node.json→ no source-level errors(the only diagnostics are pre-existing test-only module-resolution
issues for
*-patch.test.tsfiles that needpostinstallbrandassets, unrelated to this change).
win32;darwin/ other platforms continue to return the original URL unchanged.
Notes
source rather than the manual edit of
resources/app/out/main/index.js(which would be overwritten on thenext install). Plugin-side layout behaviour remains the plugin
project owner's responsibility.