From 257a98267828e40dce0ee7712c9c013248c2c2fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20L?= Date: Sun, 4 Oct 2026 10:42:34 +0200 Subject: [PATCH] Say when a filter hides the photos of an empty grid or filmstrip Co-Authored-By: Claude Sonnet 5.5 --- crates/ui-egui/src/panels/detail.rs | 5 +++++ crates/ui-egui/src/panels/grid.rs | 11 ++++++++--- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/crates/ui-egui/src/panels/detail.rs b/crates/ui-egui/src/panels/detail.rs index e0f00f37..df5ca4f2 100644 --- a/crates/ui-egui/src/panels/detail.rs +++ b/crates/ui-egui/src/panels/detail.rs @@ -1219,6 +1219,11 @@ pub(crate) fn filmstrip(app: &mut LightcraftApp, ui: &mut egui::Ui, r: Rect) { let active = app.session.selection.active; let cell_w = 120.0; let ppp = ui.ctx().pixels_per_point(); + if ids.is_empty() { + let why = if app.session.filter != Default::default() { "No photos match the filters (View → Clear Filters)" } else { "No photos" }; + ui.painter().text(r.center(), Align2::CENTER_CENTER, why, t.font(12.5), t.text_dim); + return; + } let mut child = ui.new_child(egui::UiBuilder::new().max_rect(r.shrink2(vec2(0.0, 4.0)))); // a vertical mouse wheel scrolls the strip sideways (horizontal trackpad scrolls still work) child.style_mut().always_scroll_the_only_direction = true; diff --git a/crates/ui-egui/src/panels/grid.rs b/crates/ui-egui/src/panels/grid.rs index c6d4f98f..060bb620 100644 --- a/crates/ui-egui/src/panels/grid.rs +++ b/crates/ui-egui/src/panels/grid.rs @@ -46,10 +46,15 @@ pub fn show(app: &mut LightcraftApp, ui: &mut egui::Ui) { } app.canvas_rect = Some(ui.max_rect()); if ids.is_empty() { - if app.session.source == lightcraft_engine::LibrarySource::Folder { + if app.session.filter != Default::default() { + super::empty_message( + ui, + ui.max_rect(), + "No matching photos", + "A filter is hiding this view's photos: change it, or clear it (View → Clear Filters)", + ); + } else if app.session.source == lightcraft_engine::LibrarySource::Folder { super::empty_message(ui, ui.max_rect(), "No photos in this folder", "Turn on Include subfolders, or pick another folder under Local"); - } else if app.session.filter != Default::default() { - super::empty_message(ui, ui.max_rect(), "No matching photos", "Change the filter, or clear it (View → Clear Filters)"); } else { super::empty_message(ui, ui.max_rect(), "No photos", "Add photos with File → Add Photos (Cmd+Shift+I), or drop them here"); }