From d57c8913391694bf90d3b2ba8b96395d36bdde44 Mon Sep 17 00:00:00 2001 From: sedax90 <5001801+sedax90@users.noreply.github.com> Date: Sun, 8 Nov 2026 14:00:51 +0100 Subject: [PATCH 1/7] feat(linux-workspace): add Save Changes to the header --- .../src/ui/session_window/tests/sessions.rs | 20 ++++++++++++++ .../crates/app/src/ui/workspace/close_flow.rs | 4 +++ linux/crates/app/src/ui/workspace/mod.rs | 15 +++++++++++ .../app/src/ui/workspace/workspace_actions.rs | 12 +++++++++ .../app/src/ui/workspace/workspace_shell.rs | 27 +++++++++++++++++++ .../src/ui/workspace/workspace_shell_imp.rs | 2 ++ linux/data/resources/ui/workspace-shell.ui | 9 +++++++ 7 files changed, 89 insertions(+) diff --git a/linux/crates/app/src/ui/session_window/tests/sessions.rs b/linux/crates/app/src/ui/session_window/tests/sessions.rs index e184a61059..31107dd653 100644 --- a/linux/crates/app/src/ui/session_window/tests/sessions.rs +++ b/linux/crates/app/src/ui/session_window/tests/sessions.rs @@ -737,3 +737,23 @@ fn a_session_closing_while_its_tab_is_out_leaves_that_tab_alone() { assert!(holds_page(&drag, &page)); assert!(shell.owner_of(&page).is_none()); } + +/// The header's Save Changes is on while the tab in front has edits and +/// off when it has none, as the macOS toolbar's check is. +#[gtk4::test] +fn the_header_save_changes_follows_the_front_tabs_edits() { + let test = TestWindow::connected("HeaderSave"); + let save = test + .window + .lookup_action("save-changes") + .expect("the save-changes action"); + assert!(!save.is_enabled(), "on with nothing to save"); + + edit_a_table(&test.workspace(), "orders"); + // The tab says so when an edit lands; the test wrote to its tracker directly. + test.workspace() + .sender() + .expect("the workspace's input") + .deliver(WorkspaceInput::TabDirtyChanged); + wait_until(WAIT, || save.is_enabled()).expect("Save Changes on for the edited tab"); +} diff --git a/linux/crates/app/src/ui/workspace/close_flow.rs b/linux/crates/app/src/ui/workspace/close_flow.rs index 2257f256c2..e4eb0071c0 100644 --- a/linux/crates/app/src/ui/workspace/close_flow.rs +++ b/linux/crates/app/src/ui/workspace/close_flow.rs @@ -184,6 +184,10 @@ impl WorkspaceModel { for id in marked { self.retitle_tab(id); } + // The model is borrowed for this very update, so the shell asks it after. + if let Some(shell) = self.shell.upgrade() { + glib::idle_add_local_once(move || shell.refresh_save_changes()); + } let dirty = dirty_tabs.iter().any(|tab| tab.kind.lost_with_the_window()); if let Some(workspace) = self.this.upgrade() && workspace.imp().dirty.replace(dirty) != dirty diff --git a/linux/crates/app/src/ui/workspace/mod.rs b/linux/crates/app/src/ui/workspace/mod.rs index 6e4edd63b6..50102fd5a3 100644 --- a/linux/crates/app/src/ui/workspace/mod.rs +++ b/linux/crates/app/src/ui/workspace/mod.rs @@ -1105,6 +1105,21 @@ impl Workspace { self.with_model(|model| model.update(message)); } + /// The tab in front, when it holds edits a save would write: the one + /// the header's Save Changes saves. + pub(super) fn selected_unsaved_tab(&self) -> Option { + self.read(|model| { + let id = model.selected_workspace_tab_id()?; + model + .workspace_handle + .dirty_tabs() + .iter() + .any(|tab| tab.id == id && matches!(tab.kind, crate::workspace::DirtyKind::Unsaved)) + .then_some(id) + }) + .flatten() + } + fn with_model(&self, f: impl FnOnce(&mut WorkspaceModel) -> R) -> Option { let mut model = self.imp().model.try_borrow_mut().ok()?; model.as_mut().map(f) diff --git a/linux/crates/app/src/ui/workspace/workspace_actions.rs b/linux/crates/app/src/ui/workspace/workspace_actions.rs index 6314971252..0954b57266 100644 --- a/linux/crates/app/src/ui/workspace/workspace_actions.rs +++ b/linux/crates/app/src/ui/workspace/workspace_actions.rs @@ -47,6 +47,7 @@ const REOPEN_CLOSED_TAB: &str = "reopen-closed-tab"; const CLOSE_ALL_TABS: &str = "close-all-tabs"; const SWITCH_RECENT_TAB: &str = "switch-recent-tab"; const SHOW_TABS: &str = "show-tabs"; +const SAVE_CHANGES: &str = "save-changes"; /// Add the actions to the window's own action map, which GTK exports as /// `win`. Each sends its input to the session in front when activated; @@ -83,6 +84,17 @@ pub(super) fn install(window: &adw::ApplicationWindow, shell: &WorkspaceShell) { } }) .build()]); + let saving = shell.downgrade(); + window.add_action_entries([gio::ActionEntry::::builder(SAVE_CHANGES) + .activate(move |_, _, _| { + if let Some(shell) = saving.upgrade() { + shell.save_changes(); + } + }) + .build()]); + if let Some(action) = window.lookup_action(SAVE_CHANGES).and_downcast::() { + action.set_enabled(false); + } let switching = shell.downgrade(); window.add_action_entries([gio::ActionEntry::::builder(SWITCH_RECENT_TAB) .activate(move |_, _, _| { diff --git a/linux/crates/app/src/ui/workspace/workspace_shell.rs b/linux/crates/app/src/ui/workspace/workspace_shell.rs index 25eb2ae449..9e58cb827d 100644 --- a/linux/crates/app/src/ui/workspace/workspace_shell.rs +++ b/linux/crates/app/src/ui/workspace/workspace_shell.rs @@ -52,6 +52,7 @@ pub(super) fn describe_buttons(shell: &WorkspaceShell) { &gettext("Show Sidebar"), Some("win.show-sidebar"), ); + describe_icon_button(&imp.save_changes_button.get(), &gettext("Save Changes"), None); describe_icon_button( &imp.new_tab_button.get(), &gettext("New Query"), @@ -521,6 +522,32 @@ impl WorkspaceShell { if let Some((owner, _)) = self.owner_of(&page) { self.set_front(Some(&owner)); } + self.refresh_save_changes(); + } + + /// The header's Save Changes is on while the tab in front has edits. + pub(super) fn refresh_save_changes(&self) { + let enabled = self.front().and_then(|front| front.selected_unsaved_tab()).is_some(); + if let Some(action) = self + .imp() + .window + .upgrade() + .and_then(|window| window.lookup_action("save-changes")) + { + if let Some(action) = action.downcast_ref::() { + action.set_enabled(enabled); + } + } + } + + /// Save the edits of the tab in front, as the header's Save Changes asks. + pub(super) fn save_changes(&self) { + let Some(front) = self.front() else { + return; + }; + if let (Some(id), Some(input)) = (front.selected_unsaved_tab(), front.sender()) { + input.deliver(WorkspaceInput::SaveTab(id)); + } } fn set_front(&self, workspace: Option<&Workspace>) { diff --git a/linux/crates/app/src/ui/workspace/workspace_shell_imp.rs b/linux/crates/app/src/ui/workspace/workspace_shell_imp.rs index 0b88179f47..5ec0878b79 100644 --- a/linux/crates/app/src/ui/workspace/workspace_shell_imp.rs +++ b/linux/crates/app/src/ui/workspace/workspace_shell_imp.rs @@ -81,6 +81,8 @@ pub struct WorkspaceShell { #[template_child] pub connection_icon: TemplateChild, #[template_child] + pub save_changes_button: TemplateChild, + #[template_child] pub assistant_toggle: TemplateChild, #[template_child] pub tab_button: TemplateChild, diff --git a/linux/data/resources/ui/workspace-shell.ui b/linux/data/resources/ui/workspace-shell.ui index 040ecb5aee..4a885e9ba2 100644 --- a/linux/data/resources/ui/workspace-shell.ui +++ b/linux/data/resources/ui/workspace-shell.ui @@ -150,6 +150,15 @@ + + + + object-select-symbolic + win.save-changes + Save Changes + + assistant-symbolic From 122e8bb67229107373767d47dbe1c7d9463d700c Mon Sep 17 00:00:00 2001 From: sedax90 <5001801+sedax90@users.noreply.github.com> Date: Sun, 8 Nov 2026 14:02:06 +0100 Subject: [PATCH 2/7] docs(linux-workspace): add the changelog entry --- linux/changelog.d/4126.added.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 linux/changelog.d/4126.added.md diff --git a/linux/changelog.d/4126.added.md b/linux/changelog.d/4126.added.md new file mode 100644 index 0000000000..f0a29a3554 --- /dev/null +++ b/linux/changelog.d/4126.added.md @@ -0,0 +1 @@ +The header has a Save Changes check that writes the edits of the tab in front. From 34ebd9c5a6ed7a306e198eb3a9a936aef57702b0 Mon Sep 17 00:00:00 2001 From: Ngo Quoc Dat Date: Sun, 8 Nov 2026 23:45:41 +0700 Subject: [PATCH 3/7] fix(linux-workspace): share native tab save actions with the header --- linux/changelog.d/4126.added.md | 2 +- linux/crates/app/src/ui/browse_tab/imp.rs | 1 + linux/crates/app/src/ui/browse_tab/mod.rs | 5 + .../app/src/ui/editor/result_editing.rs | 17 ++ linux/crates/app/src/ui/editor/tests.rs | 39 +++++ .../src/ui/session_window/tests/sessions.rs | 20 --- linux/crates/app/src/ui/structure_tab/imp.rs | 3 +- .../src/ui/structure_tab/structure_actions.rs | 6 +- .../crates/app/src/ui/workspace/close_flow.rs | 4 - linux/crates/app/src/ui/workspace/mod.rs | 15 -- .../app/src/ui/workspace/tests/close_tab.rs | 147 ++++++++++++++++++ .../app/src/ui/workspace/workspace_actions.rs | 1 + .../app/src/ui/workspace/workspace_shell.rs | 57 +++++-- .../src/ui/workspace/workspace_shell_imp.rs | 1 + linux/data/resources/ui/workspace-shell.ui | 15 +- 15 files changed, 267 insertions(+), 66 deletions(-) diff --git a/linux/changelog.d/4126.added.md b/linux/changelog.d/4126.added.md index f0a29a3554..868e369c89 100644 --- a/linux/changelog.d/4126.added.md +++ b/linux/changelog.d/4126.added.md @@ -1 +1 @@ -The header has a Save Changes check that writes the edits of the tab in front. +The header has Save Changes for table edits, table structure and editable query results. diff --git a/linux/crates/app/src/ui/browse_tab/imp.rs b/linux/crates/app/src/ui/browse_tab/imp.rs index b6c8158638..bc6e960def 100644 --- a/linux/crates/app/src/ui/browse_tab/imp.rs +++ b/linux/crates/app/src/ui/browse_tab/imp.rs @@ -65,6 +65,7 @@ pub struct BrowseTab { /// The tab's one grid, reachable while an input is being handled /// and the model is borrowed. pub(super) grid: OnceCell, + pub(super) save_action: OnceCell, pub(super) model: RefCell>, pub(super) queue: RefCell>, pub(super) dispatching: Cell, diff --git a/linux/crates/app/src/ui/browse_tab/mod.rs b/linux/crates/app/src/ui/browse_tab/mod.rs index 3992ec5199..7d65de23c5 100644 --- a/linux/crates/app/src/ui/browse_tab/mod.rs +++ b/linux/crates/app/src/ui/browse_tab/mod.rs @@ -145,6 +145,7 @@ impl BrowseTab { filter_strip.set_revealed(true); } let actions = browse_actions::install_browse_actions(&tab, init.page_size); + let _ = tab.imp().save_action.set(actions.save.clone()); // A sort saved with the tab cannot reach an engine that reads // in its own order. let initial_sort = init.initial_sort.filter(|_| sorts_rows(dialect.as_deref())); @@ -209,6 +210,10 @@ impl BrowseTab { tab } + pub(crate) fn save_action(&self) -> Option { + self.imp().save_action.get().cloned() + } + /// Follow reconnects for as long as the tab is open, and read the /// table once the tab is first shown, or at once. fn start(&self, link_changes: tokio::sync::watch::Receiver, first_load: FirstLoad) { diff --git a/linux/crates/app/src/ui/editor/result_editing.rs b/linux/crates/app/src/ui/editor/result_editing.rs index 505691f281..6d0ee94db9 100644 --- a/linux/crates/app/src/ui/editor/result_editing.rs +++ b/linux/crates/app/src/ui/editor/result_editing.rs @@ -51,6 +51,7 @@ pub(super) struct EditTarget { #[derive(Debug)] struct ResultActions { save: gio::SimpleAction, + save_changes: gio::SimpleAction, undo: gio::SimpleAction, redo: gio::SimpleAction, } @@ -75,6 +76,14 @@ pub struct ResultEditing { } impl SqlEditor { + pub(crate) fn save_changes_action(&self) -> Option { + self.imp() + .editing + .actions + .get() + .map(|actions| actions.save_changes.clone()) + } + pub(crate) fn attach_row_tracker(&self, tracker: TabTrackerHandle) { if self.imp().editing.tracker.set(tracker).is_err() { return; @@ -95,6 +104,7 @@ impl SqlEditor { }; let actions = ResultActions { save: action("save", SqlEditor::save_rows), + save_changes: action("save-changes", SqlEditor::save_rows), undo: action("undo", |editor| { if let Some(grid) = editor.owner_grid() { grid.undo(); @@ -410,6 +420,13 @@ impl SqlEditor { && tracker .as_ref() .is_some_and(|tracker| tracker.pending_state() != PendingState::Saving); + actions.save_changes.set_enabled( + !self.imp().editing.saving.get() + && tracker.as_ref().is_some_and(|tracker| { + matches!(tracker.pending_state(), PendingState::Clean | PendingState::Unsaved) + && (tracker.pending_count() > 0 || grid.as_ref().is_some_and(DataGrid::is_editing)) + }), + ); actions .undo .set_enabled(idle && tracker.as_ref().is_some_and(TabTrackerHandle::can_undo)); diff --git a/linux/crates/app/src/ui/editor/tests.rs b/linux/crates/app/src/ui/editor/tests.rs index ce7c335ef7..7ac78d73f0 100644 --- a/linux/crates/app/src/ui/editor/tests.rs +++ b/linux/crates/app/src/ui/editor/tests.rs @@ -3231,6 +3231,45 @@ mod result_edits { assert_eq!(names, ["id", "a"], "the renamed column writes its own column"); } + #[gtk4::test] + fn header_save_action_commits_result_inline_edits_and_follows_save_state() { + let (harness, tracker) = editing( + rows_of(vec![traced("id", "id"), traced("x", "a")], TransactionState::Idle), + "SELECT id, a AS x FROM t", + ); + let _window = shown(&harness); + run_and_wait(&harness); + assert_eq!(settled(&harness), None); + let grid = shown_grid(&harness); + let action = harness.editor.save_changes_action().expect("the data save action"); + assert!(!action.is_enabled(), "clean rows have nothing to save"); + let mut cell = None; + wait_until(WAIT, || { + cell = grid.focus_cell(0, 1); + cell.is_some() + }) + .expect("the cell"); + let cell = cell.expect("the cell"); + assert!(grid.edit().edit_cell(&cell)); + grid.edit().open_text().expect("inline field").set_text("changed"); + assert_eq!(tracker.pending_count(), 0); + assert!(action.is_enabled(), "the first inline edit enables Save Changes"); + let saves = SignalLog::connect(&harness.editor, "save-rows", |_| ()); + + action.activate(None); + + assert_eq!(tracker.pending_count(), 1); + assert_eq!(saves.count(), 1); + assert!(!cell.is_editing()); + harness.editor.rows_save_started(); + assert!(!action.is_enabled()); + harness.editor.rows_save_failed(None); + assert!(action.is_enabled()); + let _ = tracker.discard(); + harness.editor.rows_discarded(false); + assert!(!action.is_enabled()); + } + #[gtk4::test] fn a_join_stays_read_only_and_says_why() { let (harness, _) = editing( diff --git a/linux/crates/app/src/ui/session_window/tests/sessions.rs b/linux/crates/app/src/ui/session_window/tests/sessions.rs index 31107dd653..e184a61059 100644 --- a/linux/crates/app/src/ui/session_window/tests/sessions.rs +++ b/linux/crates/app/src/ui/session_window/tests/sessions.rs @@ -737,23 +737,3 @@ fn a_session_closing_while_its_tab_is_out_leaves_that_tab_alone() { assert!(holds_page(&drag, &page)); assert!(shell.owner_of(&page).is_none()); } - -/// The header's Save Changes is on while the tab in front has edits and -/// off when it has none, as the macOS toolbar's check is. -#[gtk4::test] -fn the_header_save_changes_follows_the_front_tabs_edits() { - let test = TestWindow::connected("HeaderSave"); - let save = test - .window - .lookup_action("save-changes") - .expect("the save-changes action"); - assert!(!save.is_enabled(), "on with nothing to save"); - - edit_a_table(&test.workspace(), "orders"); - // The tab says so when an edit lands; the test wrote to its tracker directly. - test.workspace() - .sender() - .expect("the workspace's input") - .deliver(WorkspaceInput::TabDirtyChanged); - wait_until(WAIT, || save.is_enabled()).expect("Save Changes on for the edited tab"); -} diff --git a/linux/crates/app/src/ui/structure_tab/imp.rs b/linux/crates/app/src/ui/structure_tab/imp.rs index 6cc0dd21d9..8961911a50 100644 --- a/linux/crates/app/src/ui/structure_tab/imp.rs +++ b/linux/crates/app/src/ui/structure_tab/imp.rs @@ -1,4 +1,4 @@ -use std::cell::{Cell, RefCell}; +use std::cell::{Cell, OnceCell, RefCell}; use std::collections::VecDeque; use std::sync::OnceLock; @@ -83,6 +83,7 @@ pub struct StructureTab { #[template_child] pub stop_button: TemplateChild, + pub(super) save_action: OnceCell, pub(super) model: RefCell>, pub(super) queue: RefCell>, pub(super) dispatching: Cell, diff --git a/linux/crates/app/src/ui/structure_tab/structure_actions.rs b/linux/crates/app/src/ui/structure_tab/structure_actions.rs index f0263c0a04..4ebcf288ca 100644 --- a/linux/crates/app/src/ui/structure_tab/structure_actions.rs +++ b/linux/crates/app/src/ui/structure_tab/structure_actions.rs @@ -6,7 +6,10 @@ use super::{SaveInput, StructureTab}; use crate::application::{ShortcutOwner, local_shortcut_controller}; impl StructureTab { - /// Ctrl+S saves as the Save button does, and only while it could. + pub(crate) fn save_action(&self) -> Option { + self.imp().save_action.get().cloned() + } + pub(super) fn install_actions(&self) { let imp = self.imp(); let save = gio::SimpleAction::new("save", None); @@ -18,6 +21,7 @@ impl StructureTab { .build(); let group = gio::SimpleActionGroup::new(); group.add_action(&save); + let _ = imp.save_action.set(save); self.insert_action_group("structure", Some(&group)); self.add_controller(local_shortcut_controller(ShortcutOwner::StructureTab)); crate::ui::a11y::announce_key_shortcuts(&imp.save_button.get(), "structure.save"); diff --git a/linux/crates/app/src/ui/workspace/close_flow.rs b/linux/crates/app/src/ui/workspace/close_flow.rs index e4eb0071c0..2257f256c2 100644 --- a/linux/crates/app/src/ui/workspace/close_flow.rs +++ b/linux/crates/app/src/ui/workspace/close_flow.rs @@ -184,10 +184,6 @@ impl WorkspaceModel { for id in marked { self.retitle_tab(id); } - // The model is borrowed for this very update, so the shell asks it after. - if let Some(shell) = self.shell.upgrade() { - glib::idle_add_local_once(move || shell.refresh_save_changes()); - } let dirty = dirty_tabs.iter().any(|tab| tab.kind.lost_with_the_window()); if let Some(workspace) = self.this.upgrade() && workspace.imp().dirty.replace(dirty) != dirty diff --git a/linux/crates/app/src/ui/workspace/mod.rs b/linux/crates/app/src/ui/workspace/mod.rs index 50102fd5a3..6e4edd63b6 100644 --- a/linux/crates/app/src/ui/workspace/mod.rs +++ b/linux/crates/app/src/ui/workspace/mod.rs @@ -1105,21 +1105,6 @@ impl Workspace { self.with_model(|model| model.update(message)); } - /// The tab in front, when it holds edits a save would write: the one - /// the header's Save Changes saves. - pub(super) fn selected_unsaved_tab(&self) -> Option { - self.read(|model| { - let id = model.selected_workspace_tab_id()?; - model - .workspace_handle - .dirty_tabs() - .iter() - .any(|tab| tab.id == id && matches!(tab.kind, crate::workspace::DirtyKind::Unsaved)) - .then_some(id) - }) - .flatten() - } - fn with_model(&self, f: impl FnOnce(&mut WorkspaceModel) -> R) -> Option { let mut model = self.imp().model.try_borrow_mut().ok()?; model.as_mut().map(f) diff --git a/linux/crates/app/src/ui/workspace/tests/close_tab.rs b/linux/crates/app/src/ui/workspace/tests/close_tab.rs index b98e455209..2320b70128 100644 --- a/linux/crates/app/src/ui/workspace/tests/close_tab.rs +++ b/linux/crates/app/src/ui/workspace/tests/close_tab.rs @@ -334,3 +334,150 @@ fn close_all_tabs_asks_before_closing_unsaved_work() { assert!(tab_is_open(&test, id), "the tab with unsaved changes closed"); assert_eq!(crate::test_support::read_text_file(&path), "SELECT 1;"); } + +#[gtk4::test] +fn header_save_commits_the_first_inline_edit_and_follows_the_running_save() { + use tablepro_core::WriteReport; + use tablepro_test_support::CallCounters; + use tokio_util::sync::CancellationToken; + + let release = CancellationToken::new(); + let test = TestWindow::connected_with("HeaderInlineSave", |script| { + serving_tables(script); + script.write_batch.always(FakeReply::UntilReleased { + release: release.clone(), + outcome: Ok(WriteReport::new(vec![Some(1)])), + }); + }); + let (id, tab) = open_table(&test, "users"); + let shell = shell_of(&test.workspace()); + let button = shell.imp().save_changes_button.get(); + crate::test_support::assert_labelled(&button).expect("Save Changes has a name"); + assert_eq!(button.tooltip_text().as_deref(), Some("Save Changes")); + assert!(gtk::test_accessible_has_property( + &button, + gtk::AccessibleProperty::KeyShortcuts + )); + assert!(!button.is_sensitive()); + let cell = type_a_name(&tab); + let changes = super::row_tracker(&test.workspace(), id).expect("the changes"); + assert_eq!(changes.pending_count(), 0); + wait_until(WAIT, || button.is_sensitive()).expect("Save Changes for the first inline edit"); + + button.emit_clicked(); + + let connection = test.connection(); + wait_until(WAIT, || CallCounters::get(&connection.counters().write_batch) == 1) + .expect("the header starts the write"); + assert!(!cell.is_editing()); + assert!(!button.is_sensitive(), "Save stays disabled during its write"); + assert!( + connection + .observed_sql("write_batch") + .iter() + .flatten() + .any(|sql| sql.contains("UPDATE")) + ); + release.cancel(); + wait_until(WAIT, || changes.pending_count() == 0 && !test.workspace().is_saving()).expect("the save settles"); + assert!(!button.is_sensitive(), "the saved tab has nothing to save"); +} + +#[gtk4::test] +fn header_save_follows_sidebar_selection_and_drops_the_previous_tabs_state() { + let test = TestWindow::connected_with("HeaderSidebarSave", serving_tables); + let workspace = test.workspace(); + let shell = shell_of(&workspace); + let button = shell.imp().save_changes_button.get(); + let (first, tab) = open_table(&test, "users"); + type_a_name(&tab); + tab.grid().commit_edit(); + wait_until(WAIT, || button.is_sensitive()).expect("the first tab has edits"); + let (_, other) = open_table(&test, "teams"); + assert!(!button.is_sensitive()); + + workspace.sender().expect("input").deliver(WorkspaceInput::SelectTable { + schema: None, + name: "users".to_owned(), + open_mode: OpenMode::SwitchOrAppend, + }); + wait_until(WAIT, || workspace.selected_tab() == Some(first)).expect("sidebar selects the edited tab"); + assert!( + button.is_sensitive(), + "selection under the workspace borrow lost the action state" + ); + + other.send(crate::ui::browse_tab::SaveInput::SaveStarted); + assert!( + button.is_sensitive(), + "a background tab changed the selected tab's action" + ); + tab.send(crate::ui::browse_tab::SaveInput::SaveStarted); + assert!(!button.is_sensitive()); + tab.send(crate::ui::browse_tab::SaveInput::SaveCommitted(Default::default())); + super::open_editor(&workspace); + assert!( + !button.is_sensitive(), + "a SQL editor without result edits cannot save data" + ); + shell.shutdown(); + assert!(test.window.lookup_action("save-changes").is_none()); +} + +#[gtk4::test] +fn header_save_uses_the_structure_tabs_save_action() { + use crate::ui::structure_tab::{ColumnsInput, SaveInput, StructureTab}; + + let test = TestWindow::connected("HeaderStructureSave"); + let workspace = test.workspace(); + let shell = shell_of(&workspace); + workspace + .sender() + .expect("input") + .deliver(WorkspaceInput::NewTableTab { schema: None }); + let mut tab = None; + wait_until(WAIT, || { + tab = shell + .tab_view() + .selected_page() + .and_then(|page| page.child().downcast::().ok()); + tab.is_some() + }) + .expect("a new structure tab"); + let tab = tab.expect("the structure"); + let button = shell.imp().save_changes_button.get(); + let source = tab.save_action().expect("the structure save action"); + assert_eq!(button.is_sensitive(), source.is_enabled()); + tab.send(ColumnsInput::AddColumn); + assert!(source.is_enabled()); + assert!(button.is_sensitive()); + tab.send(SaveInput::SaveStarted); + assert!(!button.is_sensitive()); + tab.send(SaveInput::SaveFailed("The connection closed.".to_owned())); + assert!(button.is_sensitive()); +} + +#[gtk4::test] +fn header_save_switches_between_sessions_and_disables_without_a_tab() { + let sessions = super::two_sessions_with("HeaderSessionSave", "Other", serving_tables); + let shell = &sessions.shell; + let button = shell.imp().save_changes_button.get(); + assert!(!button.is_sensitive()); + super::open_editor(&sessions.first); + let (_, tab) = open_table(&sessions.test, "users"); + type_a_name(&tab); + tab.grid().commit_edit(); + assert!(button.is_sensitive()); + let edited = shell.tab_view().selected_page().expect("the edited page"); + + let clean = super::open_editor(&sessions.second); + assert!(!button.is_sensitive()); + shell.tab_view().set_selected_page(&edited); + assert!(button.is_sensitive()); + shell.tab_view().set_selected_page(&clean); + tab.send(crate::ui::browse_tab::SaveInput::SaveStarted); + assert!( + !button.is_sensitive(), + "a background session cannot enable Save Changes" + ); +} diff --git a/linux/crates/app/src/ui/workspace/workspace_actions.rs b/linux/crates/app/src/ui/workspace/workspace_actions.rs index 0954b57266..1bd78adad4 100644 --- a/linux/crates/app/src/ui/workspace/workspace_actions.rs +++ b/linux/crates/app/src/ui/workspace/workspace_actions.rs @@ -138,6 +138,7 @@ pub(super) fn remove(window: &adw::ApplicationWindow) { window.remove_action(CLOSE_ALL_TABS); window.remove_action(SWITCH_RECENT_TAB); window.remove_action(SHOW_TABS); + window.remove_action(SAVE_CHANGES); } /// Offer Export Database and Import SQL File where the session in front diff --git a/linux/crates/app/src/ui/workspace/workspace_shell.rs b/linux/crates/app/src/ui/workspace/workspace_shell.rs index 9e58cb827d..a1a9b918fb 100644 --- a/linux/crates/app/src/ui/workspace/workspace_shell.rs +++ b/linux/crates/app/src/ui/workspace/workspace_shell.rs @@ -52,7 +52,11 @@ pub(super) fn describe_buttons(shell: &WorkspaceShell) { &gettext("Show Sidebar"), Some("win.show-sidebar"), ); - describe_icon_button(&imp.save_changes_button.get(), &gettext("Save Changes"), None); + describe_icon_button( + &imp.save_changes_button.get(), + &gettext("Save Changes"), + Some("browse.save"), + ); describe_icon_button( &imp.new_tab_button.get(), &gettext("New Query"), @@ -515,6 +519,7 @@ impl WorkspaceShell { /// The tab on screen changed: its session comes to the front. With /// no tab the front stays where it was. pub(super) fn follow_selected_page(&self) { + self.refresh_save_changes(); let Some(page) = self.imp().tab_view.selected_page() else { return; }; @@ -522,31 +527,50 @@ impl WorkspaceShell { if let Some((owner, _)) = self.owner_of(&page) { self.set_front(Some(&owner)); } - self.refresh_save_changes(); } - /// The header's Save Changes is on while the tab in front has edits. + fn selected_save_action(&self) -> Option { + let child = self.imp().tab_view.selected_page()?.child(); + if let Some(tab) = child.downcast_ref::() { + return tab.save_action(); + } + if let Some(tab) = child.downcast_ref::() { + return tab.save_action(); + } + child + .downcast_ref::()? + .save_changes_action() + } + pub(super) fn refresh_save_changes(&self) { - let enabled = self.front().and_then(|front| front.selected_unsaved_tab()).is_some(); - if let Some(action) = self - .imp() + let imp = self.imp(); + if let Some(binding) = imp.save_changes_binding.take() { + binding.unbind(); + } + let Some(action) = imp .window .upgrade() .and_then(|window| window.lookup_action("save-changes")) - { - if let Some(action) = action.downcast_ref::() { - action.set_enabled(enabled); + .and_downcast::() + else { + return; + }; + match self.selected_save_action() { + Some(source) => { + imp.save_changes_binding.replace(Some( + source + .bind_property("enabled", &action, "enabled") + .sync_create() + .build(), + )); } + None => action.set_enabled(false), } } - /// Save the edits of the tab in front, as the header's Save Changes asks. pub(super) fn save_changes(&self) { - let Some(front) = self.front() else { - return; - }; - if let (Some(id), Some(input)) = (front.selected_unsaved_tab(), front.sender()) { - input.deliver(WorkspaceInput::SaveTab(id)); + if let Some(action) = self.selected_save_action() { + action.activate(None); } } @@ -704,6 +728,9 @@ impl WorkspaceShell { /// names itself again from here on. pub(crate) fn shutdown(&self) { let imp = self.imp(); + if let Some(binding) = imp.save_changes_binding.take() { + binding.unbind(); + } for watch in imp.watches.take() { watch.unwatch(); } diff --git a/linux/crates/app/src/ui/workspace/workspace_shell_imp.rs b/linux/crates/app/src/ui/workspace/workspace_shell_imp.rs index 5ec0878b79..1ebd3cf3f3 100644 --- a/linux/crates/app/src/ui/workspace/workspace_shell_imp.rs +++ b/linux/crates/app/src/ui/workspace/workspace_shell_imp.rs @@ -133,6 +133,7 @@ pub struct WorkspaceShell { pub(super) history_gate: RefCell>>, /// What follows the session in front, let go of at shutdown. pub(super) watches: RefCell>, + pub(super) save_changes_binding: RefCell>, /// The overview's new tab, connected to the front's tab factory. pub(super) create_tab: RefCell>, /// The tab of this window a drag has out of the view. diff --git a/linux/data/resources/ui/workspace-shell.ui b/linux/data/resources/ui/workspace-shell.ui index 4a885e9ba2..a10843bf7d 100644 --- a/linux/data/resources/ui/workspace-shell.ui +++ b/linux/data/resources/ui/workspace-shell.ui @@ -134,6 +134,12 @@ win.new-editor-tab + + + object-select-symbolic + win.save-changes + + @@ -150,15 +156,6 @@ - - - - object-select-symbolic - win.save-changes - Save Changes - - assistant-symbolic From b414e1183bcdcbb368c566d272cb11a51f7ee4f5 Mon Sep 17 00:00:00 2001 From: Ngo Quoc Dat Date: Mon, 9 Nov 2026 01:30:19 +0700 Subject: [PATCH 4/7] test(linux-workspace): correct save fixtures and trace inline writes --- .../app/src/ui/workspace/tests/close_tab.rs | 28 ++++++++++++++++--- 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/linux/crates/app/src/ui/workspace/tests/close_tab.rs b/linux/crates/app/src/ui/workspace/tests/close_tab.rs index 2320b70128..a1ab60782a 100644 --- a/linux/crates/app/src/ui/workspace/tests/close_tab.rs +++ b/linux/crates/app/src/ui/workspace/tests/close_tab.rs @@ -364,12 +364,28 @@ fn header_save_commits_the_first_inline_edit_and_follows_the_running_save() { assert_eq!(changes.pending_count(), 0); wait_until(WAIT, || button.is_sensitive()).expect("Save Changes for the first inline edit"); + let requested = std::rc::Rc::new(std::cell::Cell::new(0)); + let requests = requested.clone(); + tab.connect_save_requested(move |_| requests.set(requests.get() + 1)); button.emit_clicked(); + assert_eq!(requested.get(), 1, "the header activates the tab's save action"); + assert!(!cell.is_editing(), "the save commits the open cell"); + assert_eq!(changes.pending_count(), 1, "the typed value reaches the tracker"); + assert!(changes.preview_save().expect("the edit can be saved").is_some()); let connection = test.connection(); - wait_until(WAIT, || CallCounters::get(&connection.counters().write_batch) == 1) - .expect("the header starts the write"); - assert!(!cell.is_editing()); + wait_until(WAIT, || CallCounters::get(&connection.counters().write_batch) == 1).unwrap_or_else(|error| { + panic!( + "the header starts the write: {error:?}; state: {:?}; alert: {:?}; writes: {:?}", + changes.pending_state(), + visible_alert(&test.window).map(|alert| (alert.heading(), alert.body())), + test.connector + .connections() + .iter() + .map(|connection| CallCounters::get(&connection.counters().write_batch)) + .collect::>() + ) + }); assert!(!button.is_sensitive(), "Save stays disabled during its write"); assert!( connection @@ -428,7 +444,11 @@ fn header_save_follows_sidebar_selection_and_drops_the_previous_tabs_state() { fn header_save_uses_the_structure_tabs_save_action() { use crate::ui::structure_tab::{ColumnsInput, SaveInput, StructureTab}; - let test = TestWindow::connected("HeaderStructureSave"); + let test = TestWindow::connected_with("HeaderStructureSave", |script| { + script.dialect = std::sync::Arc::new(tablepro_driver_postgres::PgDialect::new( + &tablepro_core::ServerInfo::new("PostgreSQL", "18.0", 18, 0, 0), + )); + }); let workspace = test.workspace(); let shell = shell_of(&workspace); workspace From 5dee5d01191bb2565a2fde71828084776a4f2c74 Mon Sep 17 00:00:00 2001 From: Ngo Quoc Dat Date: Mon, 9 Nov 2026 02:32:33 +0700 Subject: [PATCH 5/7] test(linux-workspace): declare native types in save fixtures --- .../app/src/ui/workspace/tests/close_tab.rs | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/linux/crates/app/src/ui/workspace/tests/close_tab.rs b/linux/crates/app/src/ui/workspace/tests/close_tab.rs index a1ab60782a..20e773cea1 100644 --- a/linux/crates/app/src/ui/workspace/tests/close_tab.rs +++ b/linux/crates/app/src/ui/workspace/tests/close_tab.rs @@ -3,7 +3,7 @@ use gtk4::glib; use gtk4::prelude::*; use gtk4::subclass::prelude::*; use libadwaita::prelude::*; -use tablepro_core::column::{ColumnDefault, ColumnType}; +use tablepro_core::column::{ColumnDefault, ColumnType, ReadForm, classify_type_name}; use tablepro_core::meta::{RowCountEstimate, RowIdentity, TableEstimate}; use tablepro_core::{ColumnInfo, QueryResult, Value}; use tablepro_test_support::{ConnectionScript, FakeReply}; @@ -18,10 +18,16 @@ use crate::ui::data_grid::GridCell; use crate::ui::session_window::tests::{TestWindow, WAIT}; use crate::workspace::{answer, visible_alert}; -fn column(name: &str, primary_key: bool) -> ColumnInfo { +fn column(name: &str, data_type: &str, primary_key: bool) -> ColumnInfo { ColumnInfo { name: name.to_owned(), - column_type: ColumnType::untyped_text("text"), + column_type: ColumnType { + name: data_type.to_owned(), + kind: classify_type_name(data_type), + catalog: None, + dynamic_storage: false, + read_form: ReadForm::Native, + }, nullable: !primary_key, primary_key, is_auto_increment: false, @@ -32,9 +38,8 @@ fn column(name: &str, primary_key: bool) -> ColumnInfo { } } -/// Every table has the same two keyed rows. fn serving_tables(script: &mut ConnectionScript) { - let columns = [column("id", true), column("name", false)]; + let columns = [column("id", "integer", true), column("name", "text", false)]; script.fetch_columns.always(FakeReply::ok(columns.to_vec())); script.row_identity.always(FakeReply::ok(RowIdentity::UniqueKey { columns: vec!["id".to_owned()], From c9c9a29b9d3fccb790b2e9f4f2ad4bcd417cd753 Mon Sep 17 00:00:00 2001 From: Ngo Quoc Dat Date: Tue, 10 Nov 2026 03:49:36 +0700 Subject: [PATCH 6/7] fix(linux-workspace): save the view a table tab shows from the header --- linux/crates/app/src/ui/browse_tab/imp.rs | 1 + linux/crates/app/src/ui/browse_tab/mod.rs | 23 ++++-- .../app/src/ui/workspace/tests/close_tab.rs | 80 +++++++++++++++++++ .../app/src/ui/workspace/workspace_shell.rs | 31 ++++++- .../src/ui/workspace/workspace_shell_imp.rs | 2 + 5 files changed, 129 insertions(+), 8 deletions(-) diff --git a/linux/crates/app/src/ui/browse_tab/imp.rs b/linux/crates/app/src/ui/browse_tab/imp.rs index 177be1ac40..52775ceeb0 100644 --- a/linux/crates/app/src/ui/browse_tab/imp.rs +++ b/linux/crates/app/src/ui/browse_tab/imp.rs @@ -125,6 +125,7 @@ impl ObjectImpl for BrowseTab { .build(), Signal::builder("save-requested").build(), Signal::builder("structure-requested").build(), + Signal::builder("save-action-changed").build(), Signal::builder("loading-changed") .param_types([bool::static_type()]) .build(), diff --git a/linux/crates/app/src/ui/browse_tab/mod.rs b/linux/crates/app/src/ui/browse_tab/mod.rs index 9c57896966..3518ecb4b5 100644 --- a/linux/crates/app/src/ui/browse_tab/mod.rs +++ b/linux/crates/app/src/ui/browse_tab/mod.rs @@ -210,7 +210,10 @@ impl BrowseTab { tab } - pub(crate) fn save_action(&self) -> Option { + pub(crate) fn shown_save_action(&self) -> Option { + if self.shows_structure() { + return self.structure_tab()?.save_action(); + } self.imp().save_action.get().cloned() } @@ -405,6 +408,14 @@ impl BrowseTab { ) } + pub fn connect_save_action_changed(&self, f: F) -> glib::SignalHandlerId { + self.connect_closure( + "save-action-changed", + false, + glib::closure_local!(move |tab: &Self| f(tab)), + ) + } + pub fn offer_structure(&self) { let imp = self.imp(); imp.view_toggle.set_visible(true); @@ -418,6 +429,7 @@ impl BrowseTab { pub fn set_structure(&self, structure: &crate::ui::structure_tab::StructureTab) { libadwaita::prelude::BinExt::set_child(&*self.imp().structure_host, Some(structure)); + self.emit_by_name::<()>("save-action-changed", &[]); } pub fn structure_tab(&self) -> Option { @@ -447,15 +459,12 @@ impl BrowseTab { if let Some(model) = imp.model.borrow_mut().as_mut() { model.show_grid_actions(); } + self.emit_by_name::<()>("save-action-changed", &[]); } fn save_selected_view(&self) { - if self.shows_structure() { - if let Some(structure) = self.structure_tab() { - let _ = structure.activate_action("structure.save", None); - } - } else { - let _ = self.activate_action("browse.save", None); + if let Some(action) = self.shown_save_action() { + action.activate(None); } } diff --git a/linux/crates/app/src/ui/workspace/tests/close_tab.rs b/linux/crates/app/src/ui/workspace/tests/close_tab.rs index 69e635e5df..6d1aa1e38e 100644 --- a/linux/crates/app/src/ui/workspace/tests/close_tab.rs +++ b/linux/crates/app/src/ui/workspace/tests/close_tab.rs @@ -503,6 +503,86 @@ fn header_save_switches_between_sessions_and_disables_without_a_tab() { ); } +fn serving_a_structure(script: &mut ConnectionScript) { + use tablepro_core::ddl::{ColumnAttributes, ColumnDefinition, TableDefinition}; + + serving_tables(script); + script.dialect = std::sync::Arc::new(tablepro_driver_postgres::PgDialect::new( + &tablepro_core::ServerInfo::new("PostgreSQL", "18.0", 18, 0, 0), + )); + script.fetch_table_definition.always(FakeReply::ok(TableDefinition { + table: tablepro_core::meta::TableRef::unqualified("users"), + columns: vec![ColumnDefinition::new( + column("name", "TEXT", false), + ColumnAttributes::default(), + )], + primary_key: None, + indexes: Vec::new(), + foreign_keys: Vec::new(), + inbound_foreign_keys: Vec::new(), + source: None, + options: None, + })); +} + +fn show_structure(tab: &BrowseTab) -> crate::ui::structure_tab::StructureTab { + tab.imp().view_stack.set_visible_child_name("structure"); + let mut structure = None; + wait_until(WAIT, || { + structure = tab.structure_tab().filter(|structure| { + !structure.is_loading() && structure.imp().inner_stack.visible_child_name().as_deref() == Some("editor") + }); + structure.is_some() + }) + .expect("the table's structure"); + structure.expect("the structure") +} + +#[gtk4::test] +fn header_save_saves_the_structure_a_table_tab_shows() { + let test = TestWindow::connected_with("HeaderStructureViewSave", serving_a_structure); + let (id, tab) = open_table(&test, "users"); + let button = shell_of(&test.workspace()).imp().save_changes_button.get(); + type_a_name(&tab); + tab.commit_cell_edit(); + wait_until(WAIT, || button.is_sensitive()).expect("the row edit enables Save Changes"); + + let structure = show_structure(&tab); + assert!(!button.is_sensitive(), "the unchanged structure has nothing to save"); + structure.send(crate::ui::structure_tab::ColumnsInput::AddColumn); + assert!(button.is_sensitive(), "the structure's draft enables Save Changes"); + assert_eq!(button.tooltip_text().as_deref(), Some("Save Changes")); + + let schema_saves = crate::test_support::SignalLog::connect(&structure, "save-requested", |_| ()); + let row_saves = crate::test_support::SignalLog::connect(&tab, "save-requested", |_| ()); + button.emit_clicked(); + assert_eq!(schema_saves.count(), 1, "the header saves the structure on screen"); + assert_eq!(row_saves.count(), 0); + let rows = super::row_tracker(&test.workspace(), id).expect("the row changes"); + assert_eq!(rows.pending_count(), 1, "the row edit waits for the Data view"); +} + +#[gtk4::test] +fn header_save_follows_the_rows_again_once_the_table_tab_shows_its_data() { + let test = TestWindow::connected_with("HeaderDataViewSave", serving_a_structure); + let (_, tab) = open_table(&test, "users"); + let button = shell_of(&test.workspace()).imp().save_changes_button.get(); + let structure = show_structure(&tab); + structure.send(crate::ui::structure_tab::ColumnsInput::AddColumn); + assert!(button.is_sensitive()); + + tab.imp().view_stack.set_visible_child_name("data"); + assert!(!button.is_sensitive(), "the rows have nothing to save"); + type_a_name(&tab); + wait_until(WAIT, || button.is_sensitive()).expect("the row edit enables Save Changes"); + + let schema_saves = crate::test_support::SignalLog::connect(&structure, "save-requested", |_| ()); + let row_saves = crate::test_support::SignalLog::connect(&tab, "save-requested", |_| ()); + button.emit_clicked(); + assert_eq!(row_saves.count(), 1, "the header saves the rows on screen"); + assert_eq!(schema_saves.count(), 0); +} + #[gtk4::test] fn a_schema_rename_keeps_the_table_tab_and_its_pending_rows() { let test = TestWindow::connected_with("RenameCombinedTable", serving_tables); diff --git a/linux/crates/app/src/ui/workspace/workspace_shell.rs b/linux/crates/app/src/ui/workspace/workspace_shell.rs index 72aedaa89b..780556230e 100644 --- a/linux/crates/app/src/ui/workspace/workspace_shell.rs +++ b/linux/crates/app/src/ui/workspace/workspace_shell.rs @@ -589,7 +589,7 @@ impl WorkspaceShell { fn selected_save_action(&self) -> Option { let child = self.imp().tab_view.selected_page()?.child(); if let Some(tab) = child.downcast_ref::() { - return tab.save_action(); + return tab.shown_save_action(); } if let Some(tab) = child.downcast_ref::() { return tab.save_action(); @@ -600,6 +600,34 @@ impl WorkspaceShell { } pub(super) fn refresh_save_changes(&self) { + self.forget_table_view(); + let imp = self.imp(); + if let Some(tab) = imp + .tab_view + .selected_page() + .and_then(|page| page.child().downcast::().ok()) + { + // Data and Structure save different things, so a switch rebinds. + let shell = self.downgrade(); + let handler = tab.connect_save_action_changed(move |_| { + if let Some(shell) = shell.upgrade() { + shell.bind_save_changes(); + } + }); + imp.save_changes_view.replace(Some((tab.downgrade(), handler))); + } + self.bind_save_changes(); + } + + fn forget_table_view(&self) { + if let Some((tab, handler)) = self.imp().save_changes_view.take() + && let Some(tab) = tab.upgrade() + { + tab.disconnect(handler); + } + } + + fn bind_save_changes(&self) { let imp = self.imp(); if let Some(binding) = imp.save_changes_binding.take() { binding.unbind(); @@ -995,6 +1023,7 @@ impl WorkspaceShell { /// names itself again from here on. pub(crate) fn shutdown(&self) { let imp = self.imp(); + self.forget_table_view(); if let Some(binding) = imp.save_changes_binding.take() { binding.unbind(); } diff --git a/linux/crates/app/src/ui/workspace/workspace_shell_imp.rs b/linux/crates/app/src/ui/workspace/workspace_shell_imp.rs index cb4723d26e..671bc369ee 100644 --- a/linux/crates/app/src/ui/workspace/workspace_shell_imp.rs +++ b/linux/crates/app/src/ui/workspace/workspace_shell_imp.rs @@ -149,6 +149,8 @@ pub struct WorkspaceShell { /// What follows the session in front, let go of at shutdown. pub(super) watches: RefCell>, pub(super) save_changes_binding: RefCell>, + pub(super) save_changes_view: + RefCell, glib::SignalHandlerId)>>, /// The overview's new tab, connected to the front's tab factory. pub(super) create_tab: RefCell>, /// The tab of this window a drag has out of the view. From dc55a0bba9ac435f5ccf72ceade0257027b524be Mon Sep 17 00:00:00 2001 From: Ngo Quoc Dat Date: Tue, 10 Nov 2026 04:36:05 +0700 Subject: [PATCH 7/7] fix(linux-workspace): leave Save Changes out of the narrow header --- linux/crates/app/src/ui/workspace/tests/shell.rs | 16 ++++++++++++++++ linux/data/resources/ui/workspace-shell.ui | 2 ++ 2 files changed, 18 insertions(+) diff --git a/linux/crates/app/src/ui/workspace/tests/shell.rs b/linux/crates/app/src/ui/workspace/tests/shell.rs index 2b04b90626..2e1066142a 100644 --- a/linux/crates/app/src/ui/workspace/tests/shell.rs +++ b/linux/crates/app/src/ui/workspace/tests/shell.rs @@ -250,6 +250,22 @@ fn wide_window_shows_tab_bar() { assert!(!imp.split_view.is_collapsed()); } +#[gtk4::test] +fn save_changes_leaves_the_narrow_header() { + for (name, width, height, shown) in [("NarrowSave", 360, 294, false), ("WideSave", 1200, 760, true)] { + let test = sized(name, width, height); + let workspace = test.workspace(); + let shell = shell_of(&workspace); + let imp = shell.imp(); + let narrow = (!shown).then(|| imp.narrow_breakpoint.get()); + wait_until(Duration::from_secs(2), || { + imp.breakpoint_bin.width() > 0 && imp.breakpoint_bin.current_breakpoint() == narrow + }) + .expect("the breakpoint for the width"); + assert_eq!(imp.save_changes_button.is_visible(), shown, "{name}"); + } +} + fn fits_the_floor(root: >k::Widget) { let (min_width, ..) = root.measure(gtk::Orientation::Horizontal, -1); let (min_height, ..) = root.measure(gtk::Orientation::Vertical, 360); diff --git a/linux/data/resources/ui/workspace-shell.ui b/linux/data/resources/ui/workspace-shell.ui index 9b1c496b25..8f0fa90f65 100644 --- a/linux/data/resources/ui/workspace-shell.ui +++ b/linux/data/resources/ui/workspace-shell.ui @@ -42,6 +42,8 @@ true false true + + false false