Skip to content

Show window after first paint; remember window geometry across launches - #51

Merged
setzor merged 1 commit into
mainfrom
vibe/no-white-flash-window-state-3d935b
Oct 27, 2026
Merged

setzor merged 1 commit into
mainfrom
vibe/no-white-flash-window-state-3d935b

Conversation

@setzor

@setzor setzor commented Oct 27, 2026

Copy link
Copy Markdown
Owner

Summary

  • Startup white flash: show the window only after the WebView has painted the initial UI #29 (startup white flash): the window is now created with visible: false and a backgroundColor fallback matching the Kraft paper color (#f6f1e7), so nothing paints before the WebView applies the theme. main.ts reveals and focuses the window after boot() completes plus one requestAnimationFrame, ensuring the initial UI is themed and laid out before the window appears. The revealWindow() call is failure-tolerant (dev/browser fallback) and added core:window:allow-show to capabilities.
  • Remember window size and position across launches (tauri-plugin-window-state) #30 (remember window size/position): registered tauri-plugin-window-state (Builder::default().build()), which persists and restores window size, position, and maximized state across launches. Because the window now shows only after boot, restored geometry applies before reveal — no flicker from resize-after-show. minWidth/minHeight (640x420) still apply; the plugin clamps restores to visible monitors.

Verification

  • pnpm test (20 files / 93 tests), pnpm typecheck, pnpm build — all pass.
  • cargo metadata resolves; tauri-plugin-window-state 2.5.0 added to Cargo.lock. Full cargo check cannot run in this sandbox (missing system GTK/webkit dev libraries, no root), so the Rust build should be confirmed in CI.

Closes #29
Closes #30

- tauri.conf.json: visible:false + backgroundColor fallback (#f6f1e7,
  Kraft paper) so the window never paints white before the theme
  applies; main.ts reveals + focuses the window after boot and one
  animation frame (#29).
- Register tauri-plugin-window-state so size/position/maximized state
  persist across launches; add core:window:allow-show capability (#30).

Co-authored-by: setzor <setzor@users.noreply.github.com>
@setzor
setzor marked this pull request as ready for review October 27, 2026 12:55
@setzor
setzor merged commit b2d55ff into main Oct 27, 2026
2 checks passed
@setzor
setzor deleted the vibe/no-white-flash-window-state-3d935b branch October 27, 2026 12:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants