Skip to content

Desktop: Mac fix restart dialog#3903

Open
timon-schelling wants to merge 4 commits intomasterfrom
desktop-mac-fix-restart-dialog
Open

Desktop: Mac fix restart dialog#3903
timon-schelling wants to merge 4 commits intomasterfrom
desktop-mac-fix-restart-dialog

Conversation

@timon-schelling
Copy link
Member

No description provided.

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request enhances the user experience by making the application's restart dialog more informative. Instead of a simple confirmation, the dialog now explicitly lists which changed preferences necessitate an application restart. This change provides greater transparency to the user about the impact of their preference modifications, particularly for platform-specific settings like V-Sync on macOS.

Highlights

  • Dynamic Restart Dialog Content: The application's restart confirmation dialog now dynamically displays a list of specific preferences that require a restart, rather than a generic or hardcoded message.
  • macOS V-Sync Handling: The logic for determining preferences requiring a restart has been updated to specifically include V-Sync settings for macOS, ensuring users are informed when this preference change necessitates a restart.
  • Refactored Restart Logic: The needs_restart boolean function has been replaced with preferences_requiring_restart, which returns a Vec<String> containing the names of the affected preferences, improving clarity and flexibility.
Changelog
  • desktop/src/lib.rs
    • Changed the log level from error to info when the application restarts.
  • editor/src/messages/dialog/dialog_message.rs
    • Modified the RequestConfirmRestartDialog enum variant to accept a Vec<String> of preferences_requiring_restart.
  • editor/src/messages/dialog/dialog_message_handler.rs
    • Updated the handler to pass the preferences_requiring_restart vector to the ConfirmRestartDialog.
  • editor/src/messages/dialog/preferences_dialog/preferences_dialog_message_handler.rs
    • Adjusted the logic to call the new preferences_requiring_restart method and pass its result to the RequestConfirmRestartDialog.
  • editor/src/messages/dialog/simple_dialogs/confirm_restart_dialog.rs
    • Renamed the changed_settings field to preferences_requiring_restart and updated the dialog layout to display the new field's content.
  • editor/src/messages/preferences/preferences_message_handler.rs
    • Replaced the needs_restart function with preferences_requiring_restart, which now returns a Vec<String> listing specific preferences that require a restart, including conditional compilation for macOS V-Sync.
Activity
  • The pull request was created by timon-schelling.
  • The pull request description contains only a template, indicating no specific human-written details were provided by the author beyond the title.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request refactors the restart confirmation dialog to dynamically list which preferences require an application restart, which is a good improvement over hardcoded logic. The change from tracing::error! to tracing::info! for application restarts is also appropriate. I have one minor suggestion to make the code for collecting restart-requiring preferences slightly more direct.

Comment on lines +32 to +40
let mut requiring_restart = Vec::new();
if self.disable_ui_acceleration != other.disable_ui_acceleration {
requiring_restart.push("Disable UI Acceleration");
}
#[cfg(target_os = "macos")]
if self.vsync != other.vsync {
requiring_restart.push("Enable V-Sync");
}
requiring_restart.into_iter().map(String::from).collect()
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

This implementation can be made more direct by creating a Vec<String> from the beginning and pushing allocated strings, avoiding the final conversion step. This is slightly more efficient and arguably clearer.

Suggested change
let mut requiring_restart = Vec::new();
if self.disable_ui_acceleration != other.disable_ui_acceleration {
requiring_restart.push("Disable UI Acceleration");
}
#[cfg(target_os = "macos")]
if self.vsync != other.vsync {
requiring_restart.push("Enable V-Sync");
}
requiring_restart.into_iter().map(String::from).collect()
let mut requiring_restart = Vec::new();
if self.disable_ui_acceleration != other.disable_ui_acceleration {
requiring_restart.push("Disable UI Acceleration".to_string());
}
#[cfg(target_os = "macos")]
if self.vsync != other.vsync {
requiring_restart.push("Enable V-Sync".to_string());
}
requiring_restart

@timon-schelling timon-schelling requested a review from Keavon March 15, 2026 12:03
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

1 issue found across 6 files

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="editor/src/messages/dialog/preferences_dialog/preferences_dialog_message_handler.rs">

<violation number="1" location="editor/src/messages/dialog/preferences_dialog/preferences_dialog_message_handler.rs:31">
P2: This restart-setting list is computed from a stale baseline because `unmodified_preferences` is never reset when the Preferences dialog is reopened. After a previous visit captured a snapshot, later confirmations can show the wrong settings as requiring restart.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

PreferencesDialogMessage::Confirm => {
if let Some(unmodified_preferences) = &self.unmodified_preferences
&& unmodified_preferences.needs_restart(preferences)
&& let preferences_requiring_restart = unmodified_preferences.preferences_requiring_restart(preferences)
Copy link
Contributor

Choose a reason for hiding this comment

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

P2: This restart-setting list is computed from a stale baseline because unmodified_preferences is never reset when the Preferences dialog is reopened. After a previous visit captured a snapshot, later confirmations can show the wrong settings as requiring restart.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At editor/src/messages/dialog/preferences_dialog/preferences_dialog_message_handler.rs, line 31:

<comment>This restart-setting list is computed from a stale baseline because `unmodified_preferences` is never reset when the Preferences dialog is reopened. After a previous visit captured a snapshot, later confirmations can show the wrong settings as requiring restart.</comment>

<file context>
@@ -28,9 +28,10 @@ impl MessageHandler<PreferencesDialogMessage, PreferencesDialogMessageContext<'_
 			PreferencesDialogMessage::Confirm => {
 				if let Some(unmodified_preferences) = &self.unmodified_preferences
-					&& unmodified_preferences.needs_restart(preferences)
+					&& let preferences_requiring_restart = unmodified_preferences.preferences_requiring_restart(preferences)
+					&& !preferences_requiring_restart.is_empty()
 				{
</file context>

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