Skip to content

fix(navigation): expose Windows titlebar height to renderer URL - #225

Open
yaojin3616 wants to merge 1 commit into
mainfrom
fix/desktop-titlebar-inset-issue-221
Open

fix(navigation): expose Windows titlebar height to renderer URL#225
yaojin3616 wants to merge 1 commit into
mainfrom
fix/desktop-titlebar-inset-issue-221

Conversation

@yaojin3616

Copy link
Copy Markdown
Contributor

Fixes #221.

Summary

Stamp the Windows renderer URL with dsh-desktop-titlebar-inset so
plugins (notably dsh-better-sidebar) can detect the native 36px
titlebar overlay and offset their right-side workspace controls
accordingly.

Root cause

desktopHarnessUrl() in src/main/window-navigation.ts injected only
dsh-desktop-mode and dsh-desktop-platform on win32. The plugin's
titlebar-compat path depends on either navigator.windowControlsOverlay
or the dsh-desktop-titlebar-inset URL parameter; with neither present
and 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 = 36 constant
already consumed by the native titleBarOverlay so the renderer-side
inset always matches what the OS reserves at the top of the window.

Changes

  • src/main/window-navigation.ts: import WINDOWS_TITLEBAR_HEIGHT
    and set dsh-desktop-titlebar-inset=<height> on the win32 renderer
    URL 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.ts files that need postinstall brand
    assets, unrelated to this change).
  • Manual sanity: the URL fragment is added only on win32; darwin
    / other platforms continue to return the original URL unchanged.

Notes

  • This is the host-side fix the maintainer asked us to land in
    source rather than the manual edit of
    resources/app/out/main/index.js (which would be overwritten on the
    next install). Plugin-side layout behaviour remains the plugin
    project owner's responsibility.
  • No DB / migration / infra changes.

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

插件按钮遮挡和内容遮挡

1 participant