Skip to content

Add editable live width×height fields to settings (#69 follow-up)#73

Merged
petegordon merged 1 commit into
mainfrom
claude/issue-69-size-fields
Jun 18, 2026
Merged

Add editable live width×height fields to settings (#69 follow-up)#73
petegordon merged 1 commit into
mainfrom
claude/issue-69-size-fields

Conversation

@petegordon

Copy link
Copy Markdown
Member

Follow-up to #69 / PR #71.

The overlay window size was already saved and restored, but @petegordon pointed out there was no width × height readout in the settings — and no way to see it change as the window resizes, or to type an exact size. This adds that.

What's new

A Window Size row in the settings panel with two numeric inputs (width × height) that:

  • show the current overlay window size when settings open,
  • update live as you drag-resize the window, and
  • resize the window to an exact size when you edit a value (committed on blur / Enter).

How it works

  • main.js — new get-window-size / set-window-size IPC. The set path is clamped to 200–8000 px so a stray keystroke can't shrink the window to nothing or throw it off-screen. The existing resize handler now also broadcasts window-size-changed so the fields track live drags.
  • preload.js — exposes getWindowSize(), setWindowSize(w, h), onWindowSizeChanged(cb).
  • index.html — the new row + styling for the numeric fields (matches the existing settings look).
  • app.js — wires the fields; guards against stomping a field you're mid-edit in, and no-ops + hides the row when electronAPI is absent (web build has no window to resize).

Testing

  • node --check passes on all four changed files.
  • npm test — all 85 controller-core tests pass.
  • Note: this is Electron GUI behavior that can't be exercised headless in CI — verified by syntax + unit tests. Live check to do: open settings → see current size, drag-resize → fields follow, type a size + Enter → window resizes, relaunch → size persists (unchanged from Window size settings #69).

🤖 Generated with Claude Code

https://claude.ai/code/session_017NiS2a4jZ877XgftkH1Dd1


Generated by Claude Code

The window size was already saved/restored, but there was no way to see or
set the exact dimensions. Add a "Window Size" row to the settings panel with
two numeric inputs that:

- show the current overlay window size on open,
- update live as the user drag-resizes the window
  (main broadcasts 'window-size-changed' on every resize), and
- resize the window to an exact size when edited (committed on blur/Enter).

Main process exposes get-window-size / set-window-size over IPC, with the
set path clamped to 200–8000 px so a stray value can't break the window.
The renderer block no-ops (and hides the row) when electronAPI is absent,
so the web build is unaffected.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017NiS2a4jZ877XgftkH1Dd1
@petegordon petegordon merged commit ea259db into main Jun 18, 2026
1 check passed
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.

2 participants