fix: dynamic window sizing, Dock auto-hide margin, binary path detection#50
Open
okletstryitnow wants to merge 3 commits intolcoutodemos:mainfrom
Open
fix: dynamic window sizing, Dock auto-hide margin, binary path detection#50okletstryitnow wants to merge 3 commits intolcoutodemos:mainfrom
okletstryitnow wants to merge 3 commits intolcoutodemos:mainfrom
Conversation
- 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>
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.
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:
workArea(transparent — no visual difference)BAR_WIDTH=1040/PILL_HEIGHT=720withdisplay.workAreaSizeMIN_WIDTH=1040/MIN_HEIGHT=720as fallbacks for very small displaysdisplay-metrics-changed: window resizes to fit new display (monitor plug/unplug, resolution change)SPACES_DEBUGblock — was silently no-op in productionDock Auto-Hide Margin:
getBottomMargin(display)reads macOS Dock preferences viadefaults read com.apple.dockautohide,orientation, andtilesizeto calculate correct bottom clearancetilesize(notlargesize) because cursor is on the pill, not the Dock — magnification is not activesyncDockMargin()injects--clui-dock-marginCSS variable into the rendererdisplay-metrics-changedeventBinary Path Detection:
~/.local/bin/claudeto binary search candidates inrun-manager.tsOther:
.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()usesexecFileSync(synchronous) fordefaults read— each call is ~5ms. Called once at startup and on display changes (not in hot paths)syncDockMargin()usesexecuteJavaScriptto inject CSS variable — includestypeof number + isFiniteguard to prevent template injectiondisplay-metrics-changedhandler includes!mainWindow.isDestroyed()checkTest Plan
window.innerWidth≈ screen width)~/.local/bin/claudedetected as Claude binary🤖 Generated with Claude Code