diff --git a/crates/pdfs-fuse/src/control.rs b/crates/pdfs-fuse/src/control.rs index 460a188..3047c3d 100644 --- a/crates/pdfs-fuse/src/control.rs +++ b/crates/pdfs-fuse/src/control.rs @@ -396,10 +396,10 @@ fn touched_topics(request: &CtlRequest) -> &'static [Topic] { use CtlRequest as R; match request { R::Pin { .. } | R::Unpin { .. } => &[Topic::Files], + // Unlock affects private requests only. Publishing the lock notification + // here for Unlock as well could close the view that just opened. R::DriveGallery { - action: - pdfs_core::control::GalleryAction::Lock - | pdfs_core::control::GalleryAction::Unlock { .. }, + action: pdfs_core::control::GalleryAction::Lock, } => &[Topic::GalleryVisibility], R::CreateAlbum { .. } | R::RenameAlbum { .. } diff --git a/crates/pdfs-gui/resources/style.css b/crates/pdfs-gui/resources/style.css index ddbf362..8fa4610 100644 --- a/crates/pdfs-gui/resources/style.css +++ b/crates/pdfs-gui/resources/style.css @@ -118,6 +118,9 @@ scale.browser-status-meter trough { min-width: 140px; min-height: 6px; } .memory-card { padding: 0; border-radius: 12px; } .memory-cover { border-radius: 12px; background: alpha(currentColor, 0.06); } .memory-label { font-weight: 700; color: white; text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9); padding: 22px 10px 6px 10px; background: linear-gradient(to top, rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0)); } +/* The button handles hover and clicks. The FlowBox cell can be wider than it. */ +flowbox.photo-album-grid > flowboxchild:hover, +flowbox.photo-album-grid > flowboxchild:active { background: transparent; } .album-card { padding: 0; border-radius: 16px; transition: background 180ms ease; } .album-card:hover { background: alpha(currentColor, 0.07); } .album-cover { border-radius: 16px; background: alpha(currentColor, 0.06); box-shadow: 0 4px 16px rgba(0, 0, 0, 0.32); transition: box-shadow 180ms ease; } diff --git a/crates/pdfs-gui/src/app/events.rs b/crates/pdfs-gui/src/app/events.rs index 0df7f25..0fd1caa 100644 --- a/crates/pdfs-gui/src/app/events.rs +++ b/crates/pdfs-gui/src/app/events.rs @@ -138,7 +138,7 @@ fn follow_changes(ui: &Rc, state: &FeedState, topics: &[Topic]) { let page = ui.stack.visible_child_name(); if changed(Topic::GalleryVisibility) || changed(Topic::GalleryVisibilitySynced) { if let Some(browser) = ui.drive_galleries.borrow().upgrade() { - browser.refresh_visibility(); + browser.refresh_visibility(changed(Topic::GalleryVisibility)); } for window in gtk4::Window::list_toplevels() { if let Ok(window) = window.downcast::() diff --git a/crates/pdfs-gui/src/app/pages/albums.rs b/crates/pdfs-gui/src/app/pages/albums.rs index 29cf9e0..c75edc2 100644 --- a/crates/pdfs-gui/src/app/pages/albums.rs +++ b/crates/pdfs-gui/src/app/pages/albums.rs @@ -180,7 +180,10 @@ pub(crate) fn collection_card( card.append(&name); card.append(&count); - let button = gtk4::Button::builder().child(&card).build(); + let button = gtk4::Button::builder() + .child(&card) + .halign(gtk4::Align::Start) + .build(); button.add_css_class("flat"); button.add_css_class("album-card"); button.set_tooltip_text(Some(title)); diff --git a/crates/pdfs-gui/src/app/pages/drive_galleries.rs b/crates/pdfs-gui/src/app/pages/drive_galleries.rs index 97a20a6..8edf00e 100644 --- a/crates/pdfs-gui/src/app/pages/drive_galleries.rs +++ b/crates/pdfs-gui/src/app/pages/drive_galleries.rs @@ -113,7 +113,7 @@ impl Browser { sync_header(&self.ui); } - pub(crate) fn refresh_visibility(self: &Rc) { + pub(crate) fn refresh_visibility(self: &Rc, locked: bool) { self.thumbnails.borrow_mut().clear(); self.root.remove_all(); self.load_root(); @@ -124,7 +124,17 @@ impl Browser { preview.force_close(); } if self.unlocked.get() { - self.close(); + if locked { + self.close(); + } else { + // The first private listing can also discover a newer visibility + // snapshot. Rebuild from the private root so a folder that is no + // longer hidden cannot leave its title or contents on screen. + self.trail.borrow_mut().clear(); + self.cover.borrow_mut().take(); + self.thumb_pending.borrow_mut().clear(); + self.load(0, 0.0); + } } else { self.load(0, self.scroll.vadjustment().value()); } @@ -214,7 +224,6 @@ impl Browser { }, (width, width.min(200)), ); - button.set_halign(gtk4::Align::Start); wire_thumbnail(self, &picture, album.cover.as_deref(), private, None); button } diff --git a/crates/pdfs-gui/src/app/pages/photos.rs b/crates/pdfs-gui/src/app/pages/photos.rs index d6a534e..fd0770b 100644 --- a/crates/pdfs-gui/src/app/pages/photos.rs +++ b/crates/pdfs-gui/src/app/pages/photos.rs @@ -845,6 +845,7 @@ pub(crate) fn build_gallery_page() -> (gtk4::Widget, GalleryWidgets) { .max_children_per_line(8) .valign(gtk4::Align::Start) .build(); + albums.add_css_class("photo-album-grid"); let albums_status = adw::StatusPage::builder() .icon_name("pdfs-album-symbolic") .vexpand(true) @@ -874,6 +875,7 @@ pub(crate) fn build_gallery_page() -> (gtk4::Widget, GalleryWidgets) { .max_children_per_line(8) .valign(gtk4::Align::Start) .build(); + drive_galleries.add_css_class("photo-album-grid"); let drive_status = gtk4::Label::builder().xalign(0.0).wrap(true).build(); drive_status.add_css_class("dim-label"); let add_gallery = gtk4::Button::with_label(&gettext("Add gallery")); diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index cfb1803..2fd2f73 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -31,6 +31,11 @@ Schema: **46**. Photos adds a local database migration for incremental metadata - Photo grids defer work for off-screen tiles and keep the viewed photo anchored during zoom. +### Fixed + +- Unlocking Hidden albums keeps the private view open while its albums load. +- Hovering over an album highlights its card without shading the surrounding grid cell. + ## [3.8.1] — 2026-11-19 Schema: **45**. No database migration in this release.