* claim: #7188 * macOS menu: disable design commands behind an open Report a bug draft (#7188) The native menu bar kept running its actions while a Report a bug draft was open, although the app's own toolbar and shortcuts wait behind it: Edit > Undo or Cmd+Z removed the last feature, so the report described a design that no longer existed. FileAction::enabled now refuses every action but Quit while a draft is open. Settings, Keyboard Shortcuts and Agent Chat are refused too: their windows open over the report but take no input until it closes. The menu's Undo and Redo still go to a focused report field (FileAction::menu_enabled), which no longer leans on Settings being enabled. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Menus: Quit and Help's windows wait behind an open Report a bug draft Quit switched to the first design with unsaved changes under the draft and asked about it in a prompt that can't be answered while the report blocks the app; with nothing unsaved it quit and lost the typed report. Like any modal window, the draft now turns Quit off. Help's items that open a window (About, Keyboard Shortcuts, Messages, Crash Reports, Connect AI assistants) wait too, in the native menu and in the app's Help menu; Documentation and Report an Issue… stay. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -146,8 +146,7 @@ impl NativeMenu {
|
||||
}
|
||||
|
||||
fn action_enabled(action: &FileAction, app: &SolveApp, ctx: &egui::Context) -> bool {
|
||||
action.enabled(app)
|
||||
|| (matches!(action, FileAction::Undo | FileAction::Redo) && ctx.egui_wants_keyboard_input() && FileAction::Settings.enabled(app))
|
||||
action.menu_enabled(app, ctx.egui_wants_keyboard_input())
|
||||
}
|
||||
|
||||
pub fn tick(&mut self, app: &mut SolveApp, ctx: &egui::Context) {
|
||||
@@ -157,6 +156,12 @@ impl NativeMenu {
|
||||
item.set_enabled(enabled);
|
||||
}
|
||||
}
|
||||
for (item, action) in &self.help_actions {
|
||||
let enabled = solidcraft_ui_egui::help::available(app, action);
|
||||
if item.is_enabled() != enabled {
|
||||
item.set_enabled(enabled);
|
||||
}
|
||||
}
|
||||
if !self.recent_paths.iter().eq(app.home.recent.iter().take(32))
|
||||
&& let Err(error) = self.update_recent(app)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user