From f8304a0e86843f337ddbb1c4816b5ac725135be8 Mon Sep 17 00:00:00 2001 From: Nils Pukropp Date: Mon, 28 Sep 2026 23:52:24 +0200 Subject: [PATCH] fix(gui): keep Albums and Places selected when returning to Photos Every visit to the Photos page loaded the timeline, and a finished timeline load always shows the timeline. Leaving Albums or Places and coming back therefore showed the timeline under the Albums or Places toggle. A visit now reloads the view the toggle selects. An open album or place still loads its photos as before. --- crates/pdfs-gui/src/app/main.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/crates/pdfs-gui/src/app/main.rs b/crates/pdfs-gui/src/app/main.rs index 9e334bb..6b1636f 100644 --- a/crates/pdfs-gui/src/app/main.rs +++ b/crates/pdfs-gui/src/app/main.rs @@ -668,6 +668,15 @@ fn build_window(app: &adw::Application) { sync_sidebar(&ui_nav); match st.visible_child_name().as_deref() { Some("browser") => load_browser(&ui_nav), + // The Albums and Places listings are re-read in place. Loading the + // timeline instead would swap it in under the Albums or Places toggle. + Some("gallery") if !ui_nav.gallery.in_collection() => { + match ui_nav.gallery.view_switch.active() { + VIEW_ALBUMS => load_albums(&ui_nav), + VIEW_PLACES => load_places(&ui_nav), + _ => load_gallery(&ui_nav, false), + } + } Some("gallery") => load_gallery(&ui_nav, false), // Every visit reads the page again. The rows already on screen stay // up while it does, so arriving costs no "Loading…" flash.