From 1f634a286acad9caaa6381ee2e9df936de31dc21 Mon Sep 17 00:00:00 2001 From: zitann2020 Date: Sat, 31 Oct 2026 03:35:14 +0900 Subject: [PATCH] chore: CodeRabbit asks for the screen behind a Japanese rewrite Co-Authored-By: DeepSeek V4.1 Flash --- crates/ui-egui/src/header.rs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/crates/ui-egui/src/header.rs b/crates/ui-egui/src/header.rs index c559ff40a..74aa46223 100644 --- a/crates/ui-egui/src/header.rs +++ b/crates/ui-egui/src/header.rs @@ -830,9 +830,12 @@ fn ws_menu(app: &mut EffectcraftApp, ui: &mut egui::Ui, target: &str) { ("window.saveWorkspaceAs", "Save as New Workspace..."), ] { if ui.button(crate::i18n::command_label(id, source)).clicked() { - // The menu belongs to the tab it was opened on: saving or resetting from a right click - // acts on that workspace, not on whichever one happens to be showing. - if app.ui.workspace != target { + // The menu belongs to the tab it was opened on, so resetting or saving from a right + // click acts on that workspace. Save As and Edit keep working on the workspace that is + // showing: Save As would otherwise switch the layout before the user has named the + // copy, and cancelling the dialog would leave the switch behind. + let acts_on_its_tab = matches!(id, "window.resetWorkspace" | "window.saveWorkspace"); + if acts_on_its_tab && app.ui.workspace != target { app.set_workspace(target); } run_workspace_command(app, ui, id);