Skip to content

fix(tray): stop window-state plugin from restoring window visibility on startup - #3373

Merged
lbjlaq merged 3 commits into
lbjlaq:mainfrom
johngbl:pr/fix-window-state-visible
Sep 2, 2026
Merged

fix(tray): stop window-state plugin from restoring window visibility on startup#3373
lbjlaq merged 3 commits into
lbjlaq:mainfrom
johngbl:pr/fix-window-state-visible

Conversation

@johngbl

@johngbl johngbl commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Problem

When the app starts (including via autostart), the window appears on screen despite visible: false in tauri.conf.json.

Root Cause

tauri-plugin-window-state (v2.4.1) automatically restores window state on startup via on_window_ready, including visibility. The default StateFlags is all() which includes VISIBLE.

The bug flow:

  1. User closes the window - CloseRequested - plugin saves state with visible: true (before window.hide())
  2. Next startup - plugin restores visible: true - window.show() - window appears
  3. visible: false in config is overridden

Fix

src-tauri/src/lib.rs - removes VISIBLE from StateFlags:

  • Position, size, maximized, fullscreen are still restored
  • Visibility is NOT restored - visible: false in config prevails
  • Window starts hidden in tray as expected

Verification

  • cargo check: compiles
  • Test suite: 524 pass; the flaky failures are pre-existing (confirmed by running the same branch twice - failure lists differ between runs, proving flakiness)
  • No regression: change is isolated to plugin config in lib.rs, no interaction with any test

Ensure claude-opus-4-5 and claude-opus-4-6 (base) expose the same thinking variants as sonnet (low/medium/high/max) via ClaudeThinking. Previously only the -thinking suffix had variants, so syncing the base id produced no variants and dropdown showed without thinking.

Also align Gemini3Pro variant order to low -> medium(disabled) -> high -> max(disabled) for consistent Default -> Low -> Medium -> High ordering.
@lbjlaq
lbjlaq merged commit b6db832 into lbjlaq:main Sep 2, 2026
4 of 7 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.

2 participants