From eff8b5bad5f0707117c06298c6b3dbf12c7ef5fb Mon Sep 17 00:00:00 2001 From: Jules BOURDAIS Date: Wed, 22 Oct 2025 17:36:45 +0200 Subject: [PATCH] feat(file_editor): more user feedback when saving file editor --- peacock_trame/app/fileEditor.py | 1 + peacock_trame/app/main.py | 27 +++++++++++++++++++++------ 2 files changed, 22 insertions(+), 6 deletions(-) diff --git a/peacock_trame/app/fileEditor.py b/peacock_trame/app/fileEditor.py index 861c65e..81476c2 100644 --- a/peacock_trame/app/fileEditor.py +++ b/peacock_trame/app/fileEditor.py @@ -177,6 +177,7 @@ def write_file(self): print(f"Writing to {path}...") with open(path, "w") as f: f.write(self.tree.getInputFileString()) + self._server.state.info_snackbar = True def add_to_simput_model(self, type_info): simput_type = type_info.path diff --git a/peacock_trame/app/main.py b/peacock_trame/app/main.py index 1151bb9..0edabf4 100644 --- a/peacock_trame/app/main.py +++ b/peacock_trame/app/main.py @@ -70,6 +70,16 @@ def on_tab_change(tab_idx): if tab_idx == 2: self.exodus_viewer.check_file() + vuetify.VSnackbar( + "Configuration successfully saved to {{ input_file }}", + v_model=( + "info_snackbar", + False, + ), + color="success", + left=True, + ) + with html.Div( style="position: relative; display: flex; border-bottom: 1px solid gray", ): @@ -95,12 +105,17 @@ def on_tab_change(tab_idx): v_if=("tab_idx == 0",), style="height: 100%; width: 100%; display: flex; align-items: center; justify-content: flex-end;", ): - with vuetify.VBtn( - click=self.file_editor.write_file, - icon=True, - style="z-index: 1;", - ): - vuetify.VIcon("mdi-content-save-outline") + with vuetify.VTooltip( + "Saved current configuration to file", position="left" + ), vuetify.Template(v_slot_activator=("{ on, attrs }",)): + with vuetify.VBtn( + click=self.file_editor.write_file, + icon=True, + style="z-index: 1;", + v_on="on", + v_bind="attrs", + ): + vuetify.VIcon("mdi-content-save-outline") with html.Div( style="height: 100%; width: 300px; display: flex; align-items: center; justify-content: space-between;",