Skip to content

Conversation

@p-delorme
Copy link
Contributor

@p-delorme p-delorme commented Nov 27, 2025

Ensures that the main window is closed, rather than hidden, when the settings window is opened. This prevents potential issues related to device usage and improves the overall user experience.

Summary by CodeRabbit

  • Changes
    • Windows are now closed instead of hidden when opening Settings.

✏️ Tip: You can customize this high-level summary in your review settings.

Ensures that the main window is closed, rather than hidden, when the settings window is opened. This prevents potential issues related to device usage and improves the overall user experience.
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 27, 2025

Walkthrough

The Settings window behavior in the Tauri desktop application has been modified to close existing webview windows instead of hiding them when the Settings window is opened. This changes the window management strategy from temporarily concealing windows to permanently terminating them.

Changes

Cohort / File(s) Summary
Settings Window Control Flow
apps/desktop/src-tauri/src/windows.rs
Changed window closure behavior: existing webview windows (main and target overlay) are now closed instead of hidden when opening Settings window

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant SettingsLogic as Settings Window Handler
    participant MainWindow as Main Window
    participant OverlayWindow as Overlay Window
    participant SettingsWindow as Settings Window

    rect rgb(200, 220, 255)
    Note over SettingsLogic: Old Behavior: Hide
    User->>SettingsLogic: Open Settings
    SettingsLogic->>MainWindow: Hide
    SettingsLogic->>OverlayWindow: Hide
    SettingsLogic->>SettingsWindow: Create & Show
    end

    rect rgb(220, 255, 220)
    Note over SettingsLogic: New Behavior: Close
    User->>SettingsLogic: Open Settings
    SettingsLogic->>MainWindow: Close
    SettingsLogic->>OverlayWindow: Close
    SettingsLogic->>SettingsWindow: Create & Show
    end
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

  • Single file with localized change to Settings window iteration logic
  • Straightforward action replacement (hide → close) with clear intent
  • Consider verifying the implications: ensure closing windows doesn't introduce resource leaks or unexpected state issues when Settings is dismissed

Possibly related PRs

Poem

🐰 Closing windows, not just shy,
Settings now says true goodbye,
No more hiding in the dark,
Each window leaves its final mark!

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title accurately describes the main change: closing the main window when settings open, which aligns with the changeset that modifies window handling from hiding to closing.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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 and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (1)
apps/desktop/src-tauri/src/windows.rs (1)

383-395: Comment and behavior are slightly out of sync for windows closed when Settings opens

The comment on Line 383 only mentions closing the main window and target select overlays, but the match also includes CapWindowId::Camera (Line 390), so any camera window is closed as well (Line 393).

If closing the camera when Settings opens is intentional (likely, given the device-usage goal), consider updating the comment to reflect the actual behavior. If the camera should remain open, then CapWindowId::Camera should be removed from the match.

For example, to align the comment with the current behavior:

-                // Close main window and target select overlays when settings window opens
+                // Close main, camera and target select overlay windows when settings window opens
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a292974 and 545eb62.

📒 Files selected for processing (1)
  • apps/desktop/src-tauri/src/windows.rs (2 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Clippy (aarch64-apple-darwin, macos-latest)

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