Desktop v0.1.5: fix blank second launch when authed#324
Merged
Conversation
The v0.1.4 onboarding wizard saves `auto_start: true` on finish, which matched the "silent tray-only launch" condition in main.rs (`auto_start && !worker_secret.is_empty()`) and suppressed `window.show()` on every subsequent launch. Returning users got a dead-looking app with no obvious way back in, especially because the tray icon is easy to miss in the macOS menu bar and the red-X close button wasn't hiding the window either. Decouple the two concerns: - `auto_start` still starts the worker daemon automatically on launch - The dashboard window is now always shown on startup - `WindowEvent::CloseRequested` hides the window instead of destroying it, so Dock-click / tray reopen lands on the same session - `RunEvent::Reopen` (macOS Dock click / relaunch while running) now re-shows and focuses the main window — previously this event went unhandled, so clicking the Dock did nothing visible Quit remains reachable via the tray menu and Cmd+Q. Also: - Bump desktop crate + tauri.conf.json to 0.1.5 - Refresh Cargo.lock and CHANGELOG.md Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
ericflo
added a commit
that referenced
this pull request
Apr 20, 2026
Take RunEvent by reference in handle_run_event and convert the app.run closure to pass &event. Fixes the macos-latest clippy job introduced in #324: error: this argument is passed by value, but not consumed in the function body On Linux/Windows the non-macos variant uses _event which silenced the lint there; macOS used the owned form and tripped -D warnings. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2 tasks
ericflo
added a commit
that referenced
this pull request
Apr 20, 2026
#325) Take RunEvent by reference in handle_run_event and convert the app.run closure to pass &event. Fixes the macos-latest clippy job introduced in #324: error: this argument is passed by value, but not consumed in the function body On Linux/Windows the non-macos variant uses _event which silenced the lint there; macOS used the owned form and tripped -D warnings. Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
After signing in with v0.1.4, closing and re-opening the app left users with no visible window and a tray that felt dead. "It's like it's busted if you're authed or something."
Root cause
The onboarding wizard saves
auto_start: trueon finish (ui/index.html:940). Combined with a savedworker_secret, this matched the intentional "silent tray-only launch" branch inmain.rs:So every wizard-completed user became a silent-tray user on the next launch. Compounding it:
WindowEvent::CloseRequestedwas unhandled, so the red-X on macOS could destroy the window (not just hide it)RunEvent::Reopenwas unhandled, so clicking the Dock icon on an already-running instance did nothing visible — the canonical macOS way to come back to a hidden-window appFix
Decouple worker auto-start from window visibility:
auto_startstill starts the worker daemon automatically, but doesn't hide the UIWindowEvent::CloseRequested→ hide-to-tray. The window is hidden and the close is prevented, so Dock/tray reopen lands on the same sessionRunEvent::Reopenhandler (macOS only) re-shows + focuses the main window when the user clicks the Dock icon or re-launches the app while a copy is runningRunEvent::ExitRequested)Bumps desktop crate +
tauri.conf.jsonto0.1.5. RefreshedCargo.lockandCHANGELOG.md.Test plan
Release
Once merged, push
desktop-v0.1.5tag to trigger the signed macOS / Windows / Linux release build.🤖 Generated with Claude Code