Skip to content

Persist window size and last camera preset (#69, #70)#71

Merged
petegordon merged 2 commits into
mainfrom
claude/github-issues-69-70-jrdy9p
Jun 18, 2026
Merged

Persist window size and last camera preset (#69, #70)#71
petegordon merged 2 commits into
mainfrom
claude/github-issues-69-70-jrdy9p

Conversation

@petegordon

Copy link
Copy Markdown
Member

Fixes #69 and #70.

#69 — Save the last window size (default 720×540)

apps/overlay/electron/main.js

  • Added a small persistent store (window-state.json under Electron's userData), keyed per mode (single / multi) so the two layouts don't clobber each other.
  • The single-controller window now defaults to 720×540 (was 600×400) — a clean capture size, so you can frame it once for OBS and just hit "start recording" next time.
  • Size is restored on launch, saved on resize (debounced 400 ms) and again on close as a backstop.
  • A sanitizeSize guard rejects corrupt / out-of-range values and falls back to the mode's default.

#70 — Save the last camera position selected

apps/overlay/src/js/app.js

  • The selected preset is persisted to localStorage (overlay:cameraPreset) on every pick, validated against the known list (front/back/left/right/player/top), and restored on launch.
  • The saved view is re-applied to the 3D overlay once it finishes initializing — so if you like Top, the overlay reopens to Top instead of always resetting to Player.

Testing

  • npm test — all 85 controller-core tests pass.
  • node --check passes on both modified files.
  • Note: these are runtime-behavior changes in the Electron GUI app, which can't be launched in the headless CI environment, so they were verified by syntax check + existing unit tests rather than an end-to-end GUI run.

Scope note

#70 is scoped to the main overlay — the multi-player demo (multi-app.js) has no camera presets, so nothing changed there.

🤖 Generated with Claude Code

https://claude.ai/code/session_017NiS2a4jZ877XgftkH1Dd1


Generated by Claude Code

claude added 2 commits June 18, 2026 18:56
Issue #69 — the controller body window now reopens at the size it was
last left, with a clean 720×540 default for the single-controller mode so
the user can frame it once for OBS and just hit "start recording" next
time. Size is stored per mode (single/multi) in a small JSON file under
userData, saved on resize (debounced) and on close, and sanity-checked on
load so a corrupt or out-of-range value falls back to the default.

Issue #70 — the selected camera preset (Front/Back/Left/Right/Player/Top)
is persisted to localStorage and restored on launch, so reopening the
overlay returns to the user's preferred view (e.g. Top) instead of always
resetting to Player. The saved value is validated against the known preset
list and re-applied to the 3D view once the overlay finishes initializing.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017NiS2a4jZ877XgftkH1Dd1
…69-70-jrdy9p

# Conflicts:
#	apps/overlay/electron/main.js
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.

Window size settings

2 participants