Skip to content

[L-06] Add a graceful Usage Dock quit request - #621

Closed
Arrangedgodly wants to merge 1 commit into
nesszer:mainfrom
Arrangedgodly:pr/usage-dock-quit
Closed

Arrangedgodly wants to merge 1 commit into
nesszer:mainfrom
Arrangedgodly:pr/usage-dock-quit

Conversation

@Arrangedgodly

@Arrangedgodly Arrangedgodly commented Sep 27, 2026 •

Copy link
Copy Markdown

Behavior

Usage Dock recognizes the exact sole argument --quit-from-launchpad. If an instance is already open, the single-instance callback exits it. If no instance is open, the flagged invocation exits during setup before tray services start. This gives Launchpad a local graceful quit path without adding an HTTP shutdown endpoint.

Verification

  • cargo fmt --all --check — passed.
  • cargo test --manifest-path apps/desktop-tauri/src-tauri/Cargo.toml --bin codexbar-desktop-tauri launchpad_quit -- --nocapture — 2 passed.

The installed app needs a build containing this change. A Windows app session was not launched for runtime testing.

Summary by CodeRabbit

  • New Features
    • The desktop app now exits immediately when launched with the dedicated quit request as its only argument. This also applies when the request is sent to an already-running instance, allowing the app to close without following its usual launch or reopen behavior. Other argument combinations continue to use the existing behavior.

@coderabbitai

coderabbitai Bot commented Sep 27, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: 21b5b90c-006e-4562-af5e-f8c24a904338

📥 Commits

Reviewing files that changed from the base of the PR and between b585d48 and 321377e.

📒 Files selected for processing (1)
  • apps/desktop-tauri/src-tauri/src/main.rs

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.


📝 Walkthrough

Walkthrough

The desktop process now recognizes --quit-from-launchpad only when it is the sole argument. Matching initial and single-instance launches exit with status 0. Other argument forms continue through existing launch and reopen behavior.

Changes

Launchpad quit handling

Layer / File(s) Summary
Recognize and handle Launchpad quit requests
apps/desktop-tauri/src-tauri/src/main.rs
A helper matches only the exact sole quit argument. Initial launches exit before normal setup, and matching single-instance invocations exit before the primary-window reopen check. Tests cover accepted and rejected argument forms.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Feature

Suggested reviewers: finesssee

Merge Risk: ⚪ Minimal · up to 32137

The Launchpad quit flag exits an existing Usage Dock instance or prevents a new invocation from completing startup. No actionable merge risk remains; the change is ready for normal checks.

Architecture Summary

Architecture risk: 🔵 Low · up to 32137

The change affects 1 system.

Changed systems: apps/desktop-tauri

Architecture concerns
No architecture-level concerns identified.

Review details

Systems and components

  • observed — apps/desktop-tauri (service) was modified; 1 changed file maps to changed impact.

Before / after behavior

  • observed — Modified behavior in apps/desktop-tauri/src-tauri/src/main.rs: Adds is_launchpad_quit_request, which returns true only when the first argument is exactly --quit-from-launchpad and no additional arguments follow.
  • observed — Modified behavior in apps/desktop-tauri/src-tauri/src/main.rs: The initial process arguments are checked for the Launchpad quit request and the result is retained for setup.
  • observed — Modified behavior in apps/desktop-tauri/src-tauri/src/main.rs: The single-instance callback now exits with status 0 and returns immediately for an exact sole Launchpad quit argument; other invocations continue to the existing primary-window reopen check.
  • observed — Modified behavior in apps/desktop-tauri/src-tauri/src/main.rs: Setup exits with status 0 before normal setup tasks when the initial process arguments matched the Launchpad quit request.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 8 functions across 1 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: adding a graceful quit request from the Usage Dock/Launchpad.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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