Skip to content

Persist opt-in native window placement - #63

Merged
1bye merged 4 commits into
mainfrom
codex/window-state-14
Nov 12, 2026
Merged

1bye merged 4 commits into
mainfrom
codex/window-state-14

Conversation

@1bye

@1bye 1bye commented Nov 12, 2026 •

Copy link
Copy Markdown
Owner

Refs #14

Adds opt-in native window placement through App::window_state and a shared WindowState preferences policy. Explicit application-owned keys keep windows independent; per-window opt-out and asynchronous reset are supported. Restore logic validates versioned records, matches display UUIDs, and clamps or falls back onto visible displays using logical coordinates. Saving is coalesced for 250 ms, serialized across windows and resets, and flushed on close/quit. Web is a documented no-op.

The desktop example opts in. Public rustdoc, a placement guide, pure serialization/clamping tests, public API tests, and GPUI headless lifecycle tests are included.

Validation completed locally:

  • cargo test -p rake-app -p rake-desktop-example, including 85 doctests.
  • cargo test -p rake-app --features view-test-support --lib: 111 passed.
  • cargo clippy --workspace --all-targets -- -D warnings.
  • cargo fmt --check.
  • cargo run -p rake-app-cli -- lint: 734 files, zero diagnostics.
  • python3 scripts/check-spacing.py (also rerun by its --fix workflow).
  • Native/Wasm compilation and rustdoc with warnings denied.
  • Additional spacing scan with view-test-support: new window-state files are clean; 182 pre-existing feature-only warnings remain in unrelated tests and were left outside this change.

Native results: macOS 26.6.2 (25G83), Apple silicon, built-in 3456×2234 / logical 1728×1117 at 2x, with a second 3840×2160 / logical 1920×1080 at 2x connected. Three launches retained a 720×480 content area at (200, 150), with a stable 720×512 native frame, despite changed fallback defaults. Saved maximized/fullscreen records restored their modes and normal bounds. Injected off-screen geometry and a missing display UUID fell back onto the visible main display. The guide records the setup and reproducible smoke procedure; missing-display injection does not establish physical unplug/replug behavior.

Design notes: account for macOS content/frame height differences and protect restore bounds from intermediate zoom frames. Where the adapter does not expose unmaximized restore bounds, retain windowed bounds settled for 250 ms; an immediate resize-then-maximize can therefore use the preceding settled size. Rejected startup mode requests follow actual host state after two seconds. Opaque native workspace archives are not persisted. Wayland placement/compositor limits are documented.

Merged origin/main (083a370773d25e1811c8412d897d91b67a5daad7) as a new merge commit, 7e16e0613226a767c9ee366f6558fb0735a64718. Both menu installation and window-state installation/prepare/observe hooks are retained; the documentation index keeps both guides. All five requested local validation commands passed again after the merge. CI is being rerun on this new head before the approved PR merge.

Remaining acceptance work:

  • Verify desktop reopening on Windows; record OS version and display setup.
  • Verify desktop reopening on Linux X11; record OS version and display setup.
  • Verify desktop reopening on Linux Wayland; record OS version, compositor, and display setup.

Approved for merge. Issue #14 remains open pending the remaining native platform verification.

🤖 Generated with Claude Code

1bye and others added 3 commits November 12, 2026 13:51
Refs #14

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Account for content and frame height on macOS and retain normal bounds through zoom animations. Add native smoke evidence and transition regression coverage.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@1bye
1bye marked this pull request as ready for review November 12, 2026 16:42
Preserve native menu installation and window placement hooks; retain both documentation entries.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@1bye
1bye merged commit c18fe8d into main Nov 12, 2026
15 of 16 checks 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.

1 participant