From 0b1f0b4c262ff31469b7114b9f00bf0a7b85e8f2 Mon Sep 17 00:00:00 2001 From: wyzula-jan Date: Fri, 1 May 2026 17:05:05 +0200 Subject: [PATCH] fix(dock_area): change to show_dialo=False for CLI profile baseline restore --- bec_widgets/cli/client.py | 4 ++-- bec_widgets/widgets/containers/dock_area/dock_area.py | 2 +- .../dock_area/toolbar_components/workspace_actions.py | 2 +- tests/unit_tests/test_dock_area.py | 6 +++--- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/bec_widgets/cli/client.py b/bec_widgets/cli/client.py index 7ba3248b..f8228669 100644 --- a/bec_widgets/cli/client.py +++ b/bec_widgets/cli/client.py @@ -375,7 +375,7 @@ class BECDockArea(RPCBase): @rpc_timeout(None) @rpc_call - def restore_baseline_profile(self, name: "str | None" = None, show_dialog: "bool" = True): + def restore_baseline_profile(self, name: "str | None" = None, show_dialog: "bool" = False): """ Overwrite the runtime copy of *name* with the baseline. If *name* is None, target the currently active profile. @@ -1399,7 +1399,7 @@ class DockAreaView(RPCBase): @rpc_timeout(None) @rpc_call - def restore_baseline_profile(self, name: "str | None" = None, show_dialog: "bool" = True): + def restore_baseline_profile(self, name: "str | None" = None, show_dialog: "bool" = False): """ Overwrite the runtime copy of *name* with the baseline. If *name* is None, target the currently active profile. diff --git a/bec_widgets/widgets/containers/dock_area/dock_area.py b/bec_widgets/widgets/containers/dock_area/dock_area.py index 36474438..f3629979 100644 --- a/bec_widgets/widgets/containers/dock_area/dock_area.py +++ b/bec_widgets/widgets/containers/dock_area/dock_area.py @@ -907,7 +907,7 @@ class BECDockArea(DockAreaWidget): @SafeSlot(str) @SafeSlot(str, bool) @rpc_timeout(None) - def restore_baseline_profile(self, name: str | None = None, show_dialog: bool = True): + def restore_baseline_profile(self, name: str | None = None, show_dialog: bool = False): """ Overwrite the runtime copy of *name* with the baseline. If *name* is None, target the currently active profile. diff --git a/bec_widgets/widgets/containers/dock_area/toolbar_components/workspace_actions.py b/bec_widgets/widgets/containers/dock_area/toolbar_components/workspace_actions.py index dde034a3..b3d46df9 100644 --- a/bec_widgets/widgets/containers/dock_area/toolbar_components/workspace_actions.py +++ b/bec_widgets/widgets/containers/dock_area/toolbar_components/workspace_actions.py @@ -235,4 +235,4 @@ class WorkspaceConnection(BundleConnection): """ Refreshes the current workspace. """ - self.target_widget.restore_baseline_profile() + self.target_widget.restore_baseline_profile(show_dialog=True) diff --git a/tests/unit_tests/test_dock_area.py b/tests/unit_tests/test_dock_area.py index f0ecd7de..d1cc4c25 100644 --- a/tests/unit_tests/test_dock_area.py +++ b/tests/unit_tests/test_dock_area.py @@ -1421,7 +1421,7 @@ class TestAdvancedDockAreaRestoreAndDialogs: patch.object(advanced_dock_area, "delete_all") as mock_delete_all, patch.object(advanced_dock_area, "load_profile") as mock_load_profile, ): - advanced_dock_area.restore_baseline_profile() + advanced_dock_area.restore_baseline_profile(show_dialog=True) assert mock_restore.call_count == 1 args, kwargs = mock_restore.call_args @@ -1455,7 +1455,7 @@ class TestAdvancedDockAreaRestoreAndDialogs: with patch( "bec_widgets.widgets.containers.dock_area.dock_area.restore_runtime_from_baseline" ) as mock_restore: - advanced_dock_area.restore_baseline_profile() + advanced_dock_area.restore_baseline_profile(show_dialog=True) mock_restore.assert_not_called() @@ -1489,7 +1489,7 @@ class TestAdvancedDockAreaRestoreAndDialogs: with patch( "bec_widgets.widgets.containers.dock_area.dock_area.RestoreProfileDialog.confirm" ) as mock_confirm: - advanced_dock_area.restore_baseline_profile() + advanced_dock_area.restore_baseline_profile(show_dialog=True) mock_confirm.assert_not_called() def test_refresh_workspace_list_with_refresh_profiles(self, advanced_dock_area):