-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Closes main window when settings open #1412
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
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.
WalkthroughThe 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
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
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes
Possibly related PRs
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this 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 opensThe 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::Camerashould 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
📒 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)
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
✏️ Tip: You can customize this high-level summary in your review settings.