Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
5f59651
feat(linux-sidebar): add a bottom bar with an Add menu
sedax90 Nov 8, 2026
5aae8d8
docs(linux-sidebar): name the changelog entry for its PR
sedax90 Nov 8, 2026
985b30f
feat(linux-sidebar): choose which schemas the sidebar lists
sedax90 Nov 8, 2026
bb49b7c
chore(linux): changelog and translation sources for the schema filter
sedax90 Nov 8, 2026
c23a769
feat(linux-sidebar): drag the sidebar's edge to set its width
sedax90 Nov 9, 2026
c4c0ff8
chore(linux): changelog for the sidebar width
sedax90 Nov 9, 2026
810a042
Merge remote-tracking branch 'origin/main' into feat/linux-sidebar-fo…
datlechin Nov 9, 2026
db6a574
refactor(linux-sidebar): build the Add menu from the session's afford…
datlechin Nov 9, 2026
3638efa
Merge branch 'feat/linux-sidebar-footer' into feat/linux-sidebar-sche…
datlechin Nov 9, 2026
752a82a
refactor(linux-sidebar): keep the sidebar's schema filter per connect…
datlechin Nov 9, 2026
5be78a8
Merge branch 'feat/linux-sidebar-schema-filter' into feat/linux-sideb…
datlechin Nov 9, 2026
489b5bd
refactor(linux-sidebar): cap the sidebar at the width the user set an…
datlechin Nov 9, 2026
830c7c0
refactor(linux-sidebar): keep the schema chooser's calls inside the w…
datlechin Nov 9, 2026
f4ae9c2
Merge branch 'feat/linux-sidebar-schema-filter' into feat/linux-sideb…
datlechin Nov 9, 2026
02500ed
Merge remote-tracking branch 'origin/main' into feat/linux-sidebar-fo…
datlechin Nov 10, 2026
f016cc1
fix(linux-sidebar): bring MenuModelExt into scope for the Add menu
datlechin Nov 10, 2026
a713a0b
Merge branch 'feat/linux-sidebar-footer' into feat/linux-sidebar-sche…
datlechin Nov 10, 2026
e9dc84e
Merge branch 'feat/linux-sidebar-schema-filter' into feat/linux-sideb…
datlechin Nov 10, 2026
6726fd4
ci(linux-sidebar): run CI again, GitHub made no run for the last push
datlechin Nov 10, 2026
b5366ca
Merge remote-tracking branch 'origin/main' into feat/linux-sidebar-fo…
datlechin Nov 10, 2026
b8daab3
Merge commit 'b5366cab44522197a1b4f04706894a79908b6be6' into feat/lin…
datlechin Nov 10, 2026
e1fbb9a
Merge commit 'b8daab30aba3b5fa3dd285dc2329da160a630858' into feat/lin…
datlechin Nov 10, 2026
bb14cfa
refactor(linux-sidebar): split the window's input handler and the she…
datlechin Nov 10, 2026
2f37db9
Merge branch 'feat/linux-sidebar-footer' into feat/linux-sidebar-sche…
datlechin Nov 10, 2026
4c87cc7
refactor(linux-sidebar): hold the schema filter's state in one place …
datlechin Nov 10, 2026
0f447a1
Merge branch 'feat/linux-sidebar-schema-filter' into feat/linux-sideb…
datlechin Nov 10, 2026
99167fd
Merge remote-tracking branch 'origin/main' into feat/linux-sidebar-fo…
datlechin Nov 10, 2026
605f168
test(linux-sidebar): check a read-only session built an empty Add menu
datlechin Nov 10, 2026
9436fee
Merge commit '605f16888a4686ce51e777f3c04c7645f13af994' into feat/lin…
datlechin Nov 10, 2026
51fd97d
fix(linux-sidebar): update the schema checks in place so a toggle kee…
datlechin Nov 10, 2026
bc19cc2
Merge commit '51fd97db8' into feat/linux-sidebar-width
datlechin Nov 10, 2026
51691b9
fix(linux-sidebar): follow a touch drag on the width handle and keep …
datlechin Nov 10, 2026
adcd6b4
fix(linux-sidebar): name the schema filter button in its template
datlechin Nov 10, 2026
d37db76
Merge commit 'adcd6b48b' into feat/linux-sidebar-width
datlechin Nov 10, 2026
6fc2d81
Merge remote-tracking branch 'origin/main' into feat/linux-sidebar-fo…
datlechin Nov 10, 2026
4f661ac
Merge commit '6fc2d8145' into feat/linux-sidebar-schema-filter
datlechin Nov 10, 2026
80fbf1e
Merge commit '4f661ac33' into feat/linux-sidebar-width
datlechin Nov 10, 2026
ad44265
Merge remote-tracking branch 'origin/main' into feat/linux-sidebar-sc…
datlechin Nov 11, 2026
3ce048d
Merge commit 'ad4426599' into feat/linux-sidebar-width
datlechin Nov 11, 2026
20768af
Merge remote-tracking branch 'origin/main' into feat/linux-sidebar-sc…
datlechin Nov 11, 2026
2780774
Merge commit '20768afe1' into feat/linux-sidebar-width
datlechin Nov 11, 2026
7d9a827
fix(linux-sidebar): check the saved filter settings in the sidebar sc…
datlechin Nov 11, 2026
397536a
Merge commit '7d9a82794' into feat/linux-sidebar-width
datlechin Nov 11, 2026
ee8ca79
Merge remote-tracking branch 'origin/main' into feat/linux-sidebar-width
datlechin Nov 11, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion linux/ARCHITECTURE.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ Each window is a `SessionWindow` (`crates/app/src/ui/session_window/`) for its c
- When a run, a save or an export ends in a tab the user is not looking at, the window's `WorkNotifier` sends a desktop notification through `GApplication`: one per tab, with no time threshold, as GNOME Console does. A tab counts as looked at while the window is active and the tab is in front. The notification names the tab and the connection only, since it can show on the lock screen, so an editor tab goes by its number rather than its script. Clicking it runs `app.focus-tab`, which brings the tab forward in its window. It is withdrawn once the tab is in front of an active window, when the tab closes, and when the session goes. A save that settles while a close prompt covering its tab decides is not notified: the prompt waited for it in front of the user, and then closes the tab or asks about it again.
- The window's content is the page itself, never a wrapper, and is at least 360 by 294 pixels. Each page has its own header bars and its own `AdwToastOverlay`, and the window's toasts go to the page on screen. The menus come from `data/resources/gtk/menus.ui`, which `GtkApplication` loads at startup. Main Menu above the sidebar holds app and connection-library commands. Session Menu in the content header holds commands for the session in front, including Safe Mode.

The `WorkspaceShell` (`crates/app/src/ui/workspace/workspace_shell.rs`) is what a window has once: the connection tree in the sidebar, the one tab view every session's tabs share, the header bars, the assistant's column and the toasts. Its `front` property is the session of the tab in front, or with no tab the newest session or the one last shown, and the session in front speaks for the window: the header bars, the window title, its banners, its assistant pane and the window's actions read it through bindings. The `Workspace` (`crates/app/src/ui/workspace/`) is one session: its sidebar model, which the tree shows as one list per schema and a search as one flat list of what it found, its tabs, its banners and its assistant pane, and the `title`, `subtitle`, `window-title` and `icon-name` properties the shell binds. The shell's template puts the `AdwTabOverview` at the root, as libadwaita expects, around an `AdwBreakpointBin` with an `AdwOverlaySplitView`: the sidebar and the tabs each have their own header bar. Below 600sp the sidebar collapses into an overlay, and below 450sp an `AdwTabButton` takes the tab bar's place. The `show-sidebar` window action and F9 show and hide the sidebar. Below the tree, a bar holds the Add menu the session in front builds from what its engine makes and whether it may write; the Favorites scope hides it. The shell adds the window's workspace actions once, each sent to the session in front, and removes them when it shuts down. A workspace follows its session's health and object list through `WatchForwarder`s and tells the window what it holds through its `dirty-changed`, `saves-in-flight-changed`, `work-completed` and `tabs-changed` signals. Its `WorkspaceHandle` runs the saves and tells the close prompts what closing any part of it would lose. Its `ExportLedger` writes exports off the GTK thread: the rows are encoded on the runtime and GIO writes them. An export takes the rows a grid holds, or every row of a table or an editor statement, streamed through `Connection::stream_read` on a read-only connection of its own with no deadline. `ReplaceFileWriter` removes a file the export made when it stops or fails. An existing regular file gets a temporary file beside it, renamed over it at the end, so a stopped export leaves it as it was. GLib truncates a symbolic link's target, a hard-linked file or a file in a folder that refuses the temporary file when the export opens it, and a stopped export then says that file is incomplete. [Workspace tab system](#workspace-tab-system) covers its tabs, and `../core/ARCHITECTURE.md`, Sessions and health, the `Session` itself.
The `WorkspaceShell` (`crates/app/src/ui/workspace/workspace_shell.rs`) is what a window has once: the connection tree in the sidebar, the one tab view every session's tabs share, the header bars, the assistant's column and the toasts. Its `front` property is the session of the tab in front, or with no tab the newest session or the one last shown, and the session in front speaks for the window: the header bars, the window title, its banners, its assistant pane and the window's actions read it through bindings. The `Workspace` (`crates/app/src/ui/workspace/`) is one session: its sidebar model, which the tree shows as one list per schema and a search as one flat list of what it found, its tabs, its banners and its assistant pane, and the `title`, `subtitle`, `window-title` and `icon-name` properties the shell binds. The shell's template puts the `AdwTabOverview` at the root, as libadwaita expects, around an `AdwBreakpointBin` with an `AdwOverlaySplitView`: the sidebar and the tabs each have their own header bar. Below 600sp the sidebar collapses into an overlay, and below 450sp an `AdwTabButton` takes the tab bar's place. The `show-sidebar` window action and F9 show and hide the sidebar. Below the tree, a bar holds the Add menu the session in front builds from what its engine makes and whether it may write; the Favorites scope hides it. A handle on the sidebar's edge sets the most it takes ([toolkit-workarounds.md](docs/toolkit-workarounds.md#a-sidebar-the-user-can-widen)). The shell adds the window's workspace actions once, each sent to the session in front, and removes them when it shuts down. A workspace follows its session's health and object list through `WatchForwarder`s and tells the window what it holds through its `dirty-changed`, `saves-in-flight-changed`, `work-completed` and `tabs-changed` signals. Its `WorkspaceHandle` runs the saves and tells the close prompts what closing any part of it would lose. Its `ExportLedger` writes exports off the GTK thread: the rows are encoded on the runtime and GIO writes them. An export takes the rows a grid holds, or every row of a table or an editor statement, streamed through `Connection::stream_read` on a read-only connection of its own with no deadline. `ReplaceFileWriter` removes a file the export made when it stops or fails. An existing regular file gets a temporary file beside it, renamed over it at the end, so a stopped export leaves it as it was. GLib truncates a symbolic link's target, a hard-linked file or a file in a folder that refuses the temporary file when the export opens it, and a stopped export then says that file is incomplete. [Workspace tab system](#workspace-tab-system) covers its tabs, and `../core/ARCHITECTURE.md`, Sessions and health, the `Session` itself.

## UI architecture

Expand Down
1 change: 1 addition & 0 deletions linux/changelog.d/4155.added.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
The sidebar can be widened by dragging its edge or with the arrow keys, and every window keeps that width.
1 change: 1 addition & 0 deletions linux/crates/app/src/ui/workspace/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ mod schema_chooser;
mod schema_filter;
mod session_watches;
mod sidebar;
mod sidebar_width;
mod status_pages;
mod structure;
mod structure_target;
Expand Down
124 changes: 124 additions & 0 deletions linux/crates/app/src/ui/workspace/sidebar_width.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
use gtk4 as gtk;
use gtk4::prelude::*;
use gtk4::{gdk, gio, glib, graphene};
use libadwaita as adw;
use tablepro_linux_platform::settings::keys::SIDEBAR_WIDTH;

// The schema's range, which refuses a write outside it.
const NARROWEST: f64 = 220.0;
const WIDEST: f64 = 1200.0;
const STEP: f64 = 16.0;

// The setting is the most the sidebar takes, which the split view's fraction
// lowers in a narrow window, so every window reads it and a drag writes it
// once it ends.
pub(super) fn follow(split: &adw::OverlaySplitView, handle: &gtk::Box, settings: &gio::Settings) {
settings.bind(SIDEBAR_WIDTH, split, "max-sidebar-width").get().build();
// Collapsed, the sidebar lies over the content at its widest.
handle.set_visible(!split.is_collapsed());
split.connect_collapsed_notify(glib::clone!(
#[weak]
handle,
move |split| handle.set_visible(!split.is_collapsed())
));

let drag = gtk::GestureDrag::new();
drag.connect_drag_update(glib::clone!(
#[weak]
split,
#[weak]
handle,
move |drag, _, _| {
if let Some(width) = pointer_width(&split, &handle, drag) {
split.set_max_sidebar_width(width.clamp(NARROWEST, WIDEST));
}
}
));
drag.connect_drag_end(glib::clone!(
#[weak]
split,
#[strong]
settings,
move |_, _, _| keep(&settings, split.max_sidebar_width())
));
handle.add_controller(drag);

let keys = gtk::EventControllerKey::new();
keys.connect_key_pressed(glib::clone!(
#[weak]
split,
#[strong]
settings,
#[upgrade_or]
glib::Propagation::Proceed,
move |_, key, _, _| match step(key, split.direction() == gtk::TextDirection::Rtl) {
Some(step) => {
keep(&settings, stepped(shown_width(&split), split.max_sidebar_width(), step));
glib::Propagation::Stop
}
None => glib::Propagation::Proceed,
}
));
handle.add_controller(keys);
}

// Towards the content widens the sidebar, whichever side it is on.
fn step(key: gdk::Key, rtl: bool) -> Option<f64> {
match (key, rtl) {
(gdk::Key::Right, false) | (gdk::Key::Left, true) => Some(STEP),
(gdk::Key::Left, false) | (gdk::Key::Right, true) => Some(-STEP),
_ => None,
}
}

// A window under twice the width kept shows the sidebar at half its width, which
// a wider window still gives it, so widening there keeps that width.
fn stepped(shown: f64, kept: f64, step: f64) -> f64 {
let width = shown + step;
if step > 0.0 { width.max(kept) } else { width }
}

fn keep(settings: &gio::Settings, width: f64) {
if let Err(error) = settings.set_double(SIDEBAR_WIDTH, width.round().clamp(NARROWEST, WIDEST)) {
tracing::warn!(%error, "the sidebar's width was not kept");
}
}

fn shown_width(split: &adw::OverlaySplitView) -> f64 {
let pixels = split.sidebar().map_or(0, |sidebar| sidebar.width());
split
.sidebar_width_unit()
.from_px(f64::from(pixels), Some(&split.settings()))
}

// Measured in the split view, which stays put while the handle moves with the edge.
fn pointer_width(split: &adw::OverlaySplitView, handle: &gtk::Box, drag: &gtk::GestureDrag) -> Option<f64> {
// A touch has its own sequence; only a pointer's is none.
let (x, y) = drag.point(drag.current_sequence().as_ref())?;
let point = handle.compute_point(split, &graphene::Point::new(x as f32, y as f32))?;
let pixels = match split.direction() {
gtk::TextDirection::Rtl => f64::from(split.width()) - f64::from(point.x()),
_ => f64::from(point.x()),
};
Some(split.sidebar_width_unit().from_px(pixels, Some(&split.settings())))
}

#[cfg(test)]
mod tests {
use super::*;

#[test]
fn the_arrow_towards_the_content_widens_the_sidebar() {
assert_eq!(step(gdk::Key::Right, false), Some(STEP));
assert_eq!(step(gdk::Key::Left, false), Some(-STEP));
assert_eq!(step(gdk::Key::Left, true), Some(STEP), "the sidebar is on the right");
assert_eq!(step(gdk::Key::Up, false), None);
}

#[test]
fn widening_a_sidebar_the_window_holds_at_half_keeps_the_width_kept() {
assert_eq!(stepped(280.0, 280.0, STEP), 296.0);
assert_eq!(stepped(500.0, 600.0, STEP), 600.0, "the window is 1000 wide");
assert_eq!(stepped(500.0, 600.0, -STEP), 484.0);
}
}
23 changes: 23 additions & 0 deletions linux/crates/app/src/ui/workspace/tests/shell.rs
Original file line number Diff line number Diff line change
Expand Up @@ -946,3 +946,26 @@ fn the_schemas_button_chooses_what_the_sidebar_lists_and_keeps_it() {
wait_until(WAIT, || !banner.is_revealed()).expect("Show All");
assert!(filters.sidebar_schemas(id, &database).is_empty());
}

#[gtk4::test]
fn the_sidebar_takes_the_width_kept_in_settings_and_has_a_handle_to_set_it() {
use tablepro_linux_platform::settings::keys::SIDEBAR_WIDTH;

let test = TestWindow::connected("SidebarWidth");
let shell = shell_of(&test.workspace());
let (split, handle) = (shell.imp().split_view.get(), shell.imp().sidebar_handle.get());
let settings = test.services.settings.gio().clone();
assert_eq!(split.max_sidebar_width(), 280.0, "the schema's default");

settings.set_double(SIDEBAR_WIDTH, 440.0).expect("a width in range");
wait_until(WAIT, || split.max_sidebar_width() == 440.0).expect("the window follows the setting");
assert!(settings.set_double(SIDEBAR_WIDTH, 100.0).is_err(), "under the floor");

assert!(handle.is_visible() && handle.is_focusable());
assert_eq!(handle.accessible_role(), gtk::AccessibleRole::Separator);
crate::test_support::assert_labelled(&handle).expect("the handle is named");
split.set_collapsed(true);
assert!(!handle.is_visible(), "a collapsed sidebar lies over the content");
split.set_collapsed(false);
assert!(handle.is_visible());
}
1 change: 1 addition & 0 deletions linux/crates/app/src/ui/workspace/workspace_shell.rs
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@ impl WorkspaceShell {
&imp.split_view.get(),
"show-sidebar",
));
super::sidebar_width::follow(&imp.split_view, &imp.sidebar_handle, services.settings.gio());
window.add_action(&assistant_action(&shell));
imp.walk_hooks.replace(Some(shell.hook_recent_walk(window)));

Expand Down
2 changes: 2 additions & 0 deletions linux/crates/app/src/ui/workspace/workspace_shell_imp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ pub struct WorkspaceShell {
#[template_child]
pub schema_filter_button: TemplateChild<gtk::MenuButton>,
#[template_child]
pub sidebar_handle: TemplateChild<gtk::Box>,
#[template_child]
pub sidebar_slot: TemplateChild<adw::Bin>,
#[template_child]
pub scope_toggle: TemplateChild<adw::ToggleGroup>,
Expand Down
1 change: 1 addition & 0 deletions linux/crates/platform/src/settings/keys.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
pub const SIDEBAR_WIDTH: &str = "sidebar-width";
pub const DEFAULT_PAGE_SIZE: &str = "default-page-size";
pub const CONFIRM_BULK_DELETE: &str = "confirm-bulk-delete";
pub const SHOW_ALTERNATE_ROWS: &str = "show-alternate-rows";
Expand Down
15 changes: 15 additions & 0 deletions linux/crates/platform/tests/settings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,21 @@ async fn defaults_match_schema() -> TestResult {
Ok(())
}

#[glib::async_test]
async fn the_sidebar_width_stays_between_its_floor_and_its_cap() -> TestResult {
use gio::prelude::SettingsExt;

let fixture = Fixture::new()?;
let settings = fixture.settings.gio();

assert!((settings.double(keys::SIDEBAR_WIDTH) - 280.0).abs() < f64::EPSILON);
assert!(settings.set_double(keys::SIDEBAR_WIDTH, 219.0).is_err());
assert!(settings.set_double(keys::SIDEBAR_WIDTH, 1201.0).is_err());
settings.set_double(keys::SIDEBAR_WIDTH, 440.0)?;
assert!((settings.double(keys::SIDEBAR_WIDTH) - 440.0).abs() < f64::EPSILON);
Ok(())
}

#[glib::async_test]
async fn usage_data_turns_off_and_on_again() -> TestResult {
let fixture = Fixture::new()?;
Expand Down
7 changes: 7 additions & 0 deletions linux/data/app.tablepro.TablePro.gschema.xml.in
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,13 @@
<description>Whether the main window was maximized when it last closed.</description>
</key>

<key name="sidebar-width" type="d">
<default>280.0</default>
<range min="220.0" max="1200.0"/>
<summary>Sidebar width</summary>
<description>The most the sidebar takes, in scale-independent pixels; the content always keeps half the window.</description>
</key>

<key name="default-page-size" type="u">
<default>1000</default>
<range min="100" max="100000"/>
Expand Down
Loading
Loading