Skip to content

fix: dynamic window sizing, Dock auto-hide margin, binary path detection#50

Open
okletstryitnow wants to merge 3 commits intolcoutodemos:mainfrom
okletstryitnow:fix/dock-display-binary
Open

fix: dynamic window sizing, Dock auto-hide margin, binary path detection#50
okletstryitnow wants to merge 3 commits intolcoutodemos:mainfrom
okletstryitnow:fix/dock-display-binary

Conversation

@okletstryitnow
Copy link
Copy Markdown

Summary

Replaces fixed window dimensions with display-adaptive sizing, adds intelligent Dock margin handling, and fixes Claude binary detection. Eliminates all content clipping issues permanently.

What changed

Dynamic Window Sizing:

  • Window now fills the entire display workArea (transparent — no visual difference)
  • Replaces hardcoded BAR_WIDTH=1040 / PILL_HEIGHT=720 with display.workAreaSize
  • MIN_WIDTH=1040 / MIN_HEIGHT=720 as fallbacks for very small displays
  • On display-metrics-changed: window resizes to fit new display (monitor plug/unplug, resolution change)
  • Critical fix: Moved reposition handler OUTSIDE SPACES_DEBUG block — was silently no-op in production

Dock Auto-Hide Margin:

  • New getBottomMargin(display) reads macOS Dock preferences via defaults read com.apple.dock
  • Checks autohide, orientation, and tilesize to calculate correct bottom clearance
  • Uses tilesize (not largesize) because cursor is on the pill, not the Dock — magnification is not active
  • syncDockMargin() injects --clui-dock-margin CSS variable into the renderer
  • Updates on every display-metrics-changed event
  • Only applies margin when Dock is bottom + auto-hide (left/right Dock = base margin only)

Binary Path Detection:

  • Added ~/.local/bin/claude to binary search candidates in run-manager.ts
  • Covers the native installer symlink location

Other:

  • .gitignore: development artifacts (.planning/, artifacts/)

Why

The fixed 720px window height caused content to clip above the window boundary whenever the UI grew taller (Marketplace + expanded chat, panels at high scales). Similarly, the fixed 1040px width caused circle buttons to clip at the left edge at 150% scale. Making the window display-sized eliminates this entire category of bugs — the window boundary is now the screen boundary.

The Dock margin fix ensures the pill floats above the macOS Dock when auto-hide is enabled, without hardcoding assumptions about Dock size or position.

Technical Notes

  • getBottomMargin() uses execFileSync (synchronous) for defaults read — each call is ~5ms. Called once at startup and on display changes (not in hot paths)
  • syncDockMargin() uses executeJavaScript to inject CSS variable — includes typeof number + isFinite guard to prevent template injection
  • The display-metrics-changed handler includes !mainWindow.isDestroyed() check

Test Plan

  • App fills display workArea (verify with DevTools: window.innerWidth ≈ screen width)
  • No content clipping at any pill scale (75%-150%)
  • Marketplace panel fully visible with expanded chat (header not clipped)
  • Circle buttons fully accessible at 150% scale (Skills button clickable)
  • Pill floats above auto-hide Dock (not touching screen bottom)
  • Dock on left/right: minimal bottom margin (24px)
  • Unplug external monitor → window adapts to MacBook screen
  • ~/.local/bin/claude detected as Claude binary

🤖 Generated with Claude Code

okletstryitnow and others added 3 commits March 26, 2026 14:07
- Widen BAR_WIDTH from 1040 to 1400 for ultrawide/scaled displays
- Add dynamic getBottomMargin() that reads macOS Dock preferences
  (autohide, orientation, tilesize) to calculate correct bottom margin
- Use tilesize (not largesize) since cursor is on the pill, not Dock
- Reposition window on display-metrics-changed (workArea) events
- Add ~/.local/bin/claude to binary search candidates
- Gitignore development artifacts (.planning/, artifacts/)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Replace fixed BAR_WIDTH (1400) / PILL_HEIGHT (720) with display's
workArea dimensions. Window fills entire available screen space
(transparent, no visual difference) eliminating all content clipping.

- Window sized to display.workAreaSize on creation
- MIN_WIDTH=1040, MIN_HEIGHT=720 as fallbacks for small displays
- syncDockMargin() injects --clui-dock-margin CSS variable for
  auto-hide bottom Dock clearance
- display-metrics-changed resizes window + updates dock margin
- resetWindowPosition uses workArea origin

This permanently fixes:
- Marketplace header clipping when chat is expanded
- Circle button clipping at high pill scales (150%)
- Any future panel overflow issues

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The display-metrics-changed handler with window repositioning was
accidentally nested inside if(SPACES_DEBUG), making it no-op in
production. Monitor disconnect/reconnect and Dock changes now
properly trigger window repositioning.

Also adds type guard on syncDockMargin executeJavaScript template.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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