mirror of
https://github.com/storytold/lightcraft.git
synced 2026-11-28 09:19:25 +01:00
LR-BEHAV-SIDEBAR-SECTIONS: Option-click on a triangle opens or folds the whole branch
Opening or folding a branch of the left sidebar's trees took one click per row. A click on a row's triangle with Option (Alt) held now opens or folds the row and all the rows inside it, however many: a folder of albums with the folders in it, a folder of the library down to its last folder, a keyword with the keywords inside it, a year with its months. A plain click still opens or folds the one row. It is kept for the session as two things said, not one per row: of the row, and of all the rows inside it, each with a counter that orders them. A row is as the last thing said of it, or of a row above it, has it; what is said above is carried down each tree as it is drawn. So the click costs the same on ten rows or fifty thousand, reaches rows that are not drawn yet, and a folder that appears inside the branch later follows the rest. What is opened or folded inside it afterwards holds for that row. In Local the click folds everything inside a folder and opens the one folder (opening them all would read every folder inside from the disk). Nothing is kept across restarts, as for every sidebar tree on main.
This commit is contained in:
12 files changed
+315
-44
No files matched your search
@@ -165,12 +165,12 @@ pub fn show(app: &mut LightcraftApp, ui: &mut egui::Ui) {
|
||||
let tree = app.caches.folder_tree(&app.session.catalog);
|
||||
section(app, ui, s, tree.len(), |app, ui| {
|
||||
reveal_chosen(app, ui, &tree);
|
||||
folder_rows(app, ui, &tree, 0.0);
|
||||
folder_rows(app, ui, &tree, 0.0, None);
|
||||
})
|
||||
}
|
||||
SidebarSection::Keywords => {
|
||||
let tree = app.caches.keyword_tree(&app.session.catalog);
|
||||
section(app, ui, s, tree.len(), |app, ui| keyword_rows(app, ui, &tree, 0.0))
|
||||
section(app, ui, s, tree.len(), |app, ui| keyword_rows(app, ui, &tree, 0.0, None))
|
||||
}
|
||||
};
|
||||
placed.push(at);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
use super::folders::{folder_menu, is_within};
|
||||
use super::rows::{INDENT_STEP, Row, indent_x, set_tree_open, tree_open, tree_toggle};
|
||||
use super::rows::{INDENT_STEP, Inside, Row, Said, indent_x, set_tree_open, tree_inside, tree_open, tree_toggle};
|
||||
use super::{Album, AlbumId, Align2, Icon, LibrarySource, LightcraftApp, Rect, Sense, Tokens, json, pos2, register, vec2};
|
||||
|
||||
/// Albums: the tree of albums and the folders they are sorted into. `reveal`: an album just made,
|
||||
@@ -13,14 +13,23 @@ pub(super) fn albums_rows(app: &mut LightcraftApp, ui: &mut egui::Ui, reveal: Op
|
||||
open_to.push(p);
|
||||
cur = cat.album(p).and_then(|a| a.parent);
|
||||
}
|
||||
albums_tree(app, ui, &kids, None, 0.0, &open_to);
|
||||
albums_tree(app, ui, &kids, None, 0.0, &open_to, None);
|
||||
}
|
||||
|
||||
/// The albums inside each folder (`None`: the top level), in the order they are listed.
|
||||
type AlbumKids = std::collections::HashMap<Option<AlbumId>, Vec<Album>>;
|
||||
|
||||
/// `open_to`: folders forced open this frame (the way down to an album that was just made).
|
||||
fn albums_tree(app: &mut LightcraftApp, ui: &mut egui::Ui, all: &AlbumKids, parent: Option<AlbumId>, indent: f32, open_to: &[AlbumId]) {
|
||||
/// `above`: what holds for these rows from the folders above them ([`tree_inside`]).
|
||||
fn albums_tree(
|
||||
app: &mut LightcraftApp,
|
||||
ui: &mut egui::Ui,
|
||||
all: &AlbumKids,
|
||||
parent: Option<AlbumId>,
|
||||
indent: f32,
|
||||
open_to: &[AlbumId],
|
||||
above: Option<Said>,
|
||||
) {
|
||||
// 64 folders deep at most (16 points a level): a catalog that loops must not overflow the stack
|
||||
if indent > 64.0 * INDENT_STEP {
|
||||
return;
|
||||
@@ -29,7 +38,7 @@ fn albums_tree(app: &mut LightcraftApp, ui: &mut egui::Ui, all: &AlbumKids, pare
|
||||
for a in kids {
|
||||
if a.folder {
|
||||
let open_id = egui::Id::unique(("folder-open", a.id.0));
|
||||
let mut open = tree_open(ui, open_id, true);
|
||||
let mut open = tree_open(ui, open_id, true, above);
|
||||
if open_to.contains(&a.id) && !open {
|
||||
open = true;
|
||||
set_tree_open(ui, open_id, true);
|
||||
@@ -47,7 +56,7 @@ fn albums_tree(app: &mut LightcraftApp, ui: &mut egui::Ui, all: &AlbumKids, pare
|
||||
let draw_open = open;
|
||||
let mut toggled = false;
|
||||
if has_children {
|
||||
let tri = tree_toggle(ui, &resp, indent, open_id, &mut open, format!("albumToggle:{}", a.id.0), &a.name);
|
||||
let tri = tree_toggle(ui, &resp, indent, open_id, &mut open, format!("albumToggle:{}", a.id.0), &a.name, Inside::OpensAndFolds);
|
||||
toggled = tri.clicked();
|
||||
// the triangle sits on the row and takes its clicks: the menu opens from it too
|
||||
folder_menu(app, &tri, a);
|
||||
@@ -58,7 +67,7 @@ fn albums_tree(app: &mut LightcraftApp, ui: &mut egui::Ui, all: &AlbumKids, pare
|
||||
}
|
||||
folder_menu(app, &resp, a);
|
||||
if draw_open {
|
||||
albums_tree(app, ui, all, Some(a.id), indent + INDENT_STEP, open_to);
|
||||
albums_tree(app, ui, all, Some(a.id), indent + INDENT_STEP, open_to, tree_inside(ui, open_id, above));
|
||||
}
|
||||
} else {
|
||||
let sel = app.session.source == LibrarySource::Album(a.id);
|
||||
|
||||
@@ -1,17 +1,18 @@
|
||||
use super::rows::{INDENT_STEP, Row, tree_open, tree_toggle};
|
||||
use super::rows::{INDENT_STEP, Inside, Row, Said, tree_inside, tree_open, tree_toggle};
|
||||
use super::{Icon, LibrarySource, LightcraftApp, json};
|
||||
|
||||
/// By Date: year → month → day; a click filters by that prefix, the triangle opens a level.
|
||||
pub(super) fn date_rows(app: &mut LightcraftApp, ui: &mut egui::Ui) {
|
||||
let groups = app.caches.date_groups(&app.session.catalog);
|
||||
for g in groups.iter() {
|
||||
if date_row(app, ui, &g.year, &crate::i18n::date_group_label(&g.year, true), g.count, 0.0) {
|
||||
if date_row(app, ui, &g.year, &crate::i18n::date_group_label(&g.year, true), g.count, 0.0, None) {
|
||||
let in_the_year = tree_inside(ui, date_open_id(&g.year), None);
|
||||
for (m, n) in &g.months {
|
||||
let label = crate::i18n::date_group_label(m, true);
|
||||
if date_row(app, ui, m, &label, *n, INDENT_STEP) {
|
||||
if date_row(app, ui, m, &label, *n, INDENT_STEP, in_the_year) {
|
||||
for (d, n) in g.days.iter().filter(|(d, _)| d.starts_with(m.as_str())) {
|
||||
let label = crate::i18n::date_group_label(d, true);
|
||||
date_row(app, ui, d, &label, *n, 2.0 * INDENT_STEP);
|
||||
date_row(app, ui, d, &label, *n, 2.0 * INDENT_STEP, None);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -19,15 +20,23 @@ pub(super) fn date_rows(app: &mut LightcraftApp, ui: &mut egui::Ui) {
|
||||
}
|
||||
}
|
||||
|
||||
/// The id of the open state of the By Date row `key`.
|
||||
fn date_open_id(key: &str) -> egui::Id {
|
||||
egui::Id::unique(("date-open", key.to_string()))
|
||||
}
|
||||
|
||||
/// One By Date row (`key`: `YYYY`, `YYYY-MM` or `YYYY-MM-DD`); returns whether it is open.
|
||||
fn date_row(app: &mut LightcraftApp, ui: &mut egui::Ui, key: &str, label: &str, count: usize, indent: f32) -> bool {
|
||||
let open_id = egui::Id::unique(("date-open", key.to_string()));
|
||||
let mut open = tree_open(ui, open_id, false);
|
||||
/// `above`: what holds for it from the rows above it ([`tree_inside`]).
|
||||
fn date_row(app: &mut LightcraftApp, ui: &mut egui::Ui, key: &str, label: &str, count: usize, indent: f32, above: Option<Said>) -> bool {
|
||||
let open_id = date_open_id(key);
|
||||
let mut open = tree_open(ui, open_id, false, above);
|
||||
let sel = app.session.filter.date.as_deref() == Some(key);
|
||||
let resp = Row::new(&format!("date:{key}"), Icon::Clock, label).count(Some(count)).selected(sel).indent(indent).show(app, ui);
|
||||
if key.len() < 10 {
|
||||
// (the name carries the year, so two Marches in different years differ in a screen reader's list of triangles)
|
||||
tree_toggle(ui, &resp, indent, open_id, &mut open, format!("dateToggle:{key}"), &crate::i18n::date_group_label(key, false));
|
||||
// (the name carries the year, so two Marches in different years differ in a screen reader's list of triangles;
|
||||
// a year's months open and fold with it, a month's days have nothing to open)
|
||||
let inside = if key.len() < 7 { Inside::OpensAndFolds } else { Inside::Alone };
|
||||
tree_toggle(ui, &resp, indent, open_id, &mut open, format!("dateToggle:{key}"), &crate::i18n::date_group_label(key, false), inside);
|
||||
}
|
||||
if resp.clicked() {
|
||||
let v = if sel { serde_json::Value::Null } else { json!(key) };
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
use super::albums::pointer_over_row;
|
||||
use super::local::{is_builtin_place, same_folder, subfolders};
|
||||
use super::rows::{INDENT_STEP, LIBFOLDER_REVEALED, Row, out_of_sight, set_tree_open, tree_open, tree_toggle};
|
||||
use super::rows::{INDENT_STEP, Inside, LIBFOLDER_REVEALED, Row, Said, out_of_sight, set_tree_open, tree_inside, tree_open, tree_toggle};
|
||||
use super::{Album, FolderNode, Icon, LibrarySource, LightcraftApp, Tokens, json, register, vec2};
|
||||
|
||||
/// A folder on disk with a disclosure triangle: click browses it, the triangle lists its
|
||||
@@ -21,11 +21,12 @@ pub(super) fn folder_tree(
|
||||
current: Option<&str>,
|
||||
reveal: bool,
|
||||
transient: bool,
|
||||
above: Option<Said>,
|
||||
) {
|
||||
let open_id = egui::Id::unique(("folder-open", place.to_string(), path.to_string()));
|
||||
let sel = current.is_some_and(|c| same_folder(c, path));
|
||||
let on_the_way = !sel && current.is_some_and(|c| lightcraft_catalog::query::folder_within(c, path));
|
||||
let mut open = tree_open(ui, open_id, false);
|
||||
let mut open = tree_open(ui, open_id, false, above);
|
||||
if reveal && on_the_way {
|
||||
// opened once per browsed folder: collapsing it again afterwards sticks
|
||||
let revealed_id = egui::Id::unique(("folder-revealed", place.to_string(), path.to_string()));
|
||||
@@ -40,7 +41,7 @@ pub(super) fn folder_tree(
|
||||
// at the tree's own indent, as in Albums and Folders: the triangle sits in the gutter and the
|
||||
// icon lines up with the rows above
|
||||
let resp = Row::new(&format!("local:{path}"), Icon::Folder, name).selected(sel).indent(indent).show(app, ui).on_hover_text(path);
|
||||
let tr = tree_toggle(ui, &resp, indent, open_id, &mut open, format!("folderToggle:{path}"), name);
|
||||
let tr = tree_toggle(ui, &resp, indent, open_id, &mut open, format!("folderToggle:{path}"), name, Inside::Folds);
|
||||
if !tr.clicked()
|
||||
&& resp.clicked()
|
||||
&& let Err(e) = app.run("library.browse", json!({"path": path}))
|
||||
@@ -96,8 +97,9 @@ pub(super) fn folder_tree(
|
||||
});
|
||||
}
|
||||
if open && indent < INDENT_STEP * 8.0 {
|
||||
let inside = tree_inside(ui, open_id, above);
|
||||
for (n, p) in subfolders(ui, path).iter() {
|
||||
folder_tree(app, ui, place, n, p, indent + INDENT_STEP, current, reveal, false);
|
||||
folder_tree(app, ui, place, n, p, indent + INDENT_STEP, current, reveal, false, inside);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -287,7 +289,7 @@ pub(super) fn reveal_chosen(app: &LightcraftApp, ui: &egui::Ui, tree: &[FolderNo
|
||||
for n in nodes {
|
||||
if lightcraft_catalog::query::folder_within(chosen, &n.path) && !same_folder(chosen, &n.path) {
|
||||
let key = lightcraft_catalog::query::folder_key(&n.path);
|
||||
ui.data_mut(|d| d.insert_temp(egui::Id::unique(("libfolder-open", key)), true));
|
||||
set_tree_open(ui, egui::Id::unique(("libfolder-open", key)), true);
|
||||
open_above(ui, &n.children, chosen);
|
||||
}
|
||||
}
|
||||
@@ -305,14 +307,16 @@ pub(crate) fn folder_row_of<'a>(tree: &'a [FolderNode], dir: &str) -> Option<&'a
|
||||
.find_map(|n| if same_folder(&n.path, dir) { Some(n) } else { folder_row_of(&n.children, dir) })
|
||||
}
|
||||
|
||||
pub(super) fn folder_rows(app: &mut LightcraftApp, ui: &mut egui::Ui, nodes: &[FolderNode], indent: f32) {
|
||||
/// The rows of the Folders tree. `above`: what holds for these rows from the rows above them
|
||||
/// ([`tree_inside`]).
|
||||
pub(super) fn folder_rows(app: &mut LightcraftApp, ui: &mut egui::Ui, nodes: &[FolderNode], indent: f32, above: Option<Said>) {
|
||||
for n in nodes {
|
||||
let key = lightcraft_catalog::query::folder_key(&n.path);
|
||||
let open_id = egui::Id::unique(("libfolder-open", key.clone()));
|
||||
// a disk starts open, and so does a folder that holds nothing itself and leads to one
|
||||
// folder (`Users` → `me`): the first row where the library branches is what you look for
|
||||
let leads_on = n.own == 0 && n.children.len() == 1;
|
||||
let mut open = tree_open(ui, open_id, n.volume || leads_on);
|
||||
let mut open = tree_open(ui, open_id, n.volume || leads_on, above);
|
||||
// a row whose path would cover other disks' photos too only opens and closes
|
||||
let name = if n.selectable { n.name.clone() } else { crate::i18n::tr("This Computer").to_string() };
|
||||
let id = format!("libfolder:{}", n.path);
|
||||
@@ -320,7 +324,7 @@ pub(super) fn folder_rows(app: &mut LightcraftApp, ui: &mut egui::Ui, nodes: &[F
|
||||
folder_row(app, ui, n, &id, &name, indent, open_id, &mut open);
|
||||
}
|
||||
if open && !n.children.is_empty() {
|
||||
folder_rows(app, ui, &n.children, indent + INDENT_STEP);
|
||||
folder_rows(app, ui, &n.children, indent + INDENT_STEP, tree_inside(ui, open_id, above));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -341,7 +345,7 @@ fn folder_row(app: &mut LightcraftApp, ui: &mut egui::Ui, n: &FolderNode, id: &s
|
||||
folder_drop_target(app, ui, &resp, n, open_id, open);
|
||||
let mut toggled = false;
|
||||
if !n.children.is_empty() {
|
||||
let tr = tree_toggle(ui, &resp, indent, open_id, open, format!("libraryFolderToggle:{}", n.path), name);
|
||||
let tr = tree_toggle(ui, &resp, indent, open_id, open, format!("libraryFolderToggle:{}", n.path), name, Inside::OpensAndFolds);
|
||||
toggled = tr.clicked();
|
||||
// the triangle sits on the row and takes its clicks: the menu opens from it too
|
||||
row_menu(app, &tr, n);
|
||||
|
||||
@@ -1,21 +1,21 @@
|
||||
use super::dates::browse_all_photos;
|
||||
use super::rows::{INDENT_STEP, Row, out_of_sight, tree_open, tree_toggle};
|
||||
use super::rows::{INDENT_STEP, Inside, Row, Said, out_of_sight, tree_inside, tree_open, tree_toggle};
|
||||
use super::{Icon, KeywordNode, LightcraftApp, json};
|
||||
|
||||
/// "Keywords": the library's keyword tree with photo counts (`a|b|c` keywords nest). A click
|
||||
/// filters the grid by the keyword (children included), the triangle opens a level, and the
|
||||
/// context menu renames, merges or deletes the keyword across the library.
|
||||
pub(super) fn keyword_rows(app: &mut LightcraftApp, ui: &mut egui::Ui, nodes: &[KeywordNode], indent: f32) {
|
||||
pub(super) fn keyword_rows(app: &mut LightcraftApp, ui: &mut egui::Ui, nodes: &[KeywordNode], indent: f32, above: Option<Said>) {
|
||||
for n in nodes {
|
||||
// leaves (most keywords) have no open state to look up
|
||||
let open_id = (!n.children.is_empty()).then(|| egui::Id::unique(("kw-open", n.path.to_lowercase())));
|
||||
let mut open = open_id.is_some_and(|k| tree_open(ui, k, false));
|
||||
let mut open = open_id.is_some_and(|k| tree_open(ui, k, false, above));
|
||||
let id = format!("keyword:{}", n.path);
|
||||
if !out_of_sight(app, ui, &id, &n.name, Some(n.count), indent, false) {
|
||||
keyword_row(app, ui, n, &id, indent, open_id, &mut open);
|
||||
}
|
||||
if open {
|
||||
keyword_rows(app, ui, &n.children, indent + INDENT_STEP);
|
||||
if let Some(k) = open_id.filter(|_| open) {
|
||||
keyword_rows(app, ui, &n.children, indent + INDENT_STEP, tree_inside(ui, k, above));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -25,7 +25,9 @@ fn keyword_row(app: &mut LightcraftApp, ui: &mut egui::Ui, n: &KeywordNode, id:
|
||||
let sel = app.session.filter.keyword.as_deref().is_some_and(|k| k.eq_ignore_ascii_case(&n.path));
|
||||
let resp = Row::new(id, Icon::Tag, &n.name).count(Some(n.count)).selected(sel).indent(indent).show(app, ui);
|
||||
if let Some(k) = open_id {
|
||||
tree_toggle(ui, &resp, indent, k, open, format!("keywordToggle:{}", n.path), &n.name);
|
||||
// (no keyword inside it has keywords of its own: there is nothing inside it to say of)
|
||||
let inside = if n.children.iter().any(|c| !c.children.is_empty()) { Inside::OpensAndFolds } else { Inside::Alone };
|
||||
tree_toggle(ui, &resp, indent, k, open, format!("keywordToggle:{}", n.path), &n.name, inside);
|
||||
}
|
||||
let resp = resp.on_hover_text(if n.children.is_empty() { n.path.clone() } else { format!("{} (includes the keywords below it)", n.path) });
|
||||
if resp.clicked() {
|
||||
|
||||
@@ -92,7 +92,7 @@ pub(super) fn local_rows(app: &mut LightcraftApp, ui: &mut egui::Ui, now: &Local
|
||||
for (i, (name, path)) in local.places.iter().enumerate() {
|
||||
let transient = local.browse_root.as_deref() == Some(path.as_str());
|
||||
let reveal = local.owner == Some(i);
|
||||
folder_tree(app, ui, path, name, path, 0.0, current, reveal, transient);
|
||||
folder_tree(app, ui, path, name, path, 0.0, current, reveal, transient, None);
|
||||
}
|
||||
if app.services.pick_folder.is_some() && Row::new("local:browse", Icon::Plus, crate::i18n::tr("Browse Folder…")).show(app, ui).clicked() {
|
||||
let picked = app.services.pick_folder.as_mut().and_then(|f| f());
|
||||
@@ -372,7 +372,7 @@ mod tests {
|
||||
egui::ScrollArea::vertical().show(ui, |ui| {
|
||||
for index in 0..500 {
|
||||
let path = format!("/lightcraft-test/folder-{index:04}");
|
||||
super::folder_tree(&mut app, ui, &path, &format!("Folder {index}"), &path, 0.0, None, false, false);
|
||||
super::folder_tree(&mut app, ui, &path, &format!("Folder {index}"), &path, 0.0, None, false, false, None);
|
||||
}
|
||||
});
|
||||
});
|
||||
@@ -560,7 +560,7 @@ mod tests {
|
||||
let raw = HeadlessView::raw_input(egui::vec2(300.0, 200.0), 1.0, frame as f64 / 60.0, vec![]);
|
||||
view.run(raw, |ui| {
|
||||
super::Row::new("all", super::Icon::Photos, "All Photos").show(&mut app, ui);
|
||||
super::folder_tree(&mut app, ui, path, "Pictures", path, 0.0, None, false, false);
|
||||
super::folder_tree(&mut app, ui, path, "Pictures", path, 0.0, None, false, false, None);
|
||||
});
|
||||
widgets = crate::widgets::take_registry(&view.ctx);
|
||||
}
|
||||
|
||||
@@ -288,19 +288,77 @@ pub(crate) fn disclosure_name(open: bool, name: &str) -> String {
|
||||
if open { crate::i18n::tr_format!("Collapse {name}", name = name) } else { crate::i18n::tr_format!("Expand {name}", name = name) }
|
||||
}
|
||||
|
||||
/// Whether the tree row `key` is open: what the user last chose this session, else `default`.
|
||||
pub(super) fn tree_open(ui: &egui::Ui, key: egui::Id, default: bool) -> bool {
|
||||
ui.data(|d| d.get_temp(key)).unwrap_or(default)
|
||||
/// What was last said of a tree row (or of all the rows inside one), and when: `at` counts what
|
||||
/// the user said this session, so what was said last holds.
|
||||
#[derive(Clone, Copy, PartialEq)]
|
||||
pub(crate) struct Said {
|
||||
open: bool,
|
||||
at: u64,
|
||||
}
|
||||
|
||||
/// The later of two sayings.
|
||||
fn newest(a: Option<Said>, b: Option<Said>) -> Option<Said> {
|
||||
match (a, b) {
|
||||
(Some(a), Some(b)) => Some(if b.at > a.at { b } else { a }),
|
||||
(a, b) => a.or(b),
|
||||
}
|
||||
}
|
||||
|
||||
/// Where what is said of the rows inside the tree row `key` is kept.
|
||||
fn inside_key(key: egui::Id) -> egui::Id {
|
||||
key.with("inside")
|
||||
}
|
||||
|
||||
/// Say `open` of the tree row `key` (and of the rows inside it, when `with_inside`) from now on.
|
||||
fn say(ui: &egui::Ui, key: egui::Id, open: bool, with_inside: bool) {
|
||||
ui.data_mut(|d| {
|
||||
let now = d.get_temp_mut_or_default::<u64>(egui::Id::unique("tree-said"));
|
||||
*now += 1;
|
||||
let said = Said { open, at: *now };
|
||||
d.insert_temp(key, said);
|
||||
if with_inside {
|
||||
d.insert_temp(inside_key(key), said);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/// Whether the tree row `key` is open: the last thing said of it this session, or of a row above
|
||||
/// it (`above`, see [`tree_inside`]), whichever is later, else `default`. A row that is not drawn
|
||||
/// yet is as it is said when it is.
|
||||
pub(super) fn tree_open(ui: &egui::Ui, key: egui::Id, default: bool, above: Option<Said>) -> bool {
|
||||
newest(ui.data(|d| d.get_temp(key)), above).map_or(default, |s| s.open)
|
||||
}
|
||||
|
||||
/// What holds for the rows inside the tree row `key`: what was last said of all of them, or of
|
||||
/// all the rows above `key` (`above`), whichever is later.
|
||||
pub(super) fn tree_inside(ui: &egui::Ui, key: egui::Id, above: Option<Said>) -> Option<Said> {
|
||||
newest(ui.data(|d| d.get_temp(inside_key(key))), above)
|
||||
}
|
||||
|
||||
/// Open or close the tree row `key` from now on.
|
||||
pub(super) fn set_tree_open(ui: &egui::Ui, key: egui::Id, open: bool) {
|
||||
ui.data_mut(|d| d.insert_temp(key, open));
|
||||
say(ui, key, open, false);
|
||||
}
|
||||
|
||||
/// What a click on a triangle with Option (Alt) held does to the rows inside its row.
|
||||
#[derive(Clone, Copy, PartialEq)]
|
||||
pub(super) enum Inside {
|
||||
/// Nothing: they have no rows inside them, so there is nothing to say of them (a month's
|
||||
/// days, keywords that hold none).
|
||||
Alone,
|
||||
/// They open and fold with it.
|
||||
OpensAndFolds,
|
||||
/// They fold with it; opened, it opens alone (Local: opening every folder inside would read
|
||||
/// them all from the disk, down to the last).
|
||||
Folds,
|
||||
}
|
||||
|
||||
/// The chevron of a tree row that has rows inside it (Albums' folders, Local, By Date, Folders,
|
||||
/// Keywords): a click flips `open` and remembers it under `key`. Returns the chevron's response
|
||||
/// (it sits on the row and takes its clicks, so a row's context menu is attached to it too).
|
||||
/// Keywords): a click flips `open` and remembers it under `key`. With Option (Alt) held, it opens
|
||||
/// or folds all the rows inside the row too, however many (`inside`): that is said once, of all
|
||||
/// of them, and each row checks it when it is drawn. Returns the chevron's response (it sits on
|
||||
/// the row and takes its clicks, so a row's context menu is attached to it too).
|
||||
#[allow(clippy::too_many_arguments)]
|
||||
pub(super) fn tree_toggle(
|
||||
ui: &mut egui::Ui,
|
||||
row: &egui::Response,
|
||||
@@ -309,11 +367,18 @@ pub(super) fn tree_toggle(
|
||||
open: &mut bool,
|
||||
widget: String,
|
||||
name: &str,
|
||||
inside: Inside,
|
||||
) -> egui::Response {
|
||||
let tri = disclosure_chevron(ui, row, indent, *open, key.with("triangle"), widget);
|
||||
if tri.clicked() {
|
||||
*open = !*open;
|
||||
set_tree_open(ui, key, *open);
|
||||
let option = ui.input(|i| i.modifiers.alt);
|
||||
let all = option && (inside == Inside::OpensAndFolds || (inside == Inside::Folds && !*open));
|
||||
say(ui, key, *open, all);
|
||||
if option && inside == Inside::Alone {
|
||||
// (what was said of the rows inside it when it had some with rows of their own)
|
||||
ui.data_mut(|d| d.remove::<Said>(inside_key(key)));
|
||||
}
|
||||
}
|
||||
// (the name of the row it opens: a screen reader lists the triangles one after another)
|
||||
let label = disclosure_name(*open, name);
|
||||
|
||||
@@ -8,5 +8,6 @@ mod grid_names;
|
||||
mod landmarks;
|
||||
mod local_places;
|
||||
mod photo_name;
|
||||
mod sidebar_branch;
|
||||
mod sidebar_names;
|
||||
mod thumb_size_slider;
|
||||
@@ -0,0 +1,167 @@
|
||||
//! Option-click (Alt-click) on a sidebar tree row's triangle opens or folds the row and every row
|
||||
//! inside it, also the rows that are not drawn yet because a row above them is folded.
|
||||
use std::time::Duration;
|
||||
|
||||
use lightcraft_catalog::{Op, Photo, PhotoId, Source};
|
||||
use lightcraft_engine::Session;
|
||||
use lightcraft_ui_egui::headless::Headless;
|
||||
use lightcraft_ui_egui::{LightcraftApp, Services};
|
||||
use serde_json::{Value, json};
|
||||
|
||||
const T: Duration = Duration::from_secs(30);
|
||||
|
||||
fn start(session: Session) -> Headless {
|
||||
let mut h = Headless::new(LightcraftApp::new(session, Services { png: None, ..Default::default() }), [1400.0, 1400.0], 1.0);
|
||||
let r = h.request("ui.set", json!({"view": "photoGrid", "leftPanel": true}), T);
|
||||
assert_eq!(r["ok"], true, "{r}");
|
||||
h.settle(Duration::from_secs(120));
|
||||
h
|
||||
}
|
||||
|
||||
fn frames(h: &mut Headless) {
|
||||
for _ in 0..3 {
|
||||
h.step();
|
||||
}
|
||||
}
|
||||
|
||||
fn has(h: &Headless, id: &str) -> bool {
|
||||
h.app.widgets.iter().any(|(w, _)| w == id)
|
||||
}
|
||||
|
||||
/// A click on the widget `id`, with Option (Alt) held or not.
|
||||
fn click(h: &mut Headless, id: &str, alt: bool) {
|
||||
let r = h.request("ui.clickWidget", json!({"id": id, "alt": alt}), T);
|
||||
assert_eq!(r["ok"], true, "{id}: {r}");
|
||||
frames(h);
|
||||
}
|
||||
|
||||
fn make(h: &mut Headless, params: Value) -> u64 {
|
||||
let id = h.app.session.execute("album.create", ¶ms).unwrap()["id"].as_u64().unwrap();
|
||||
frames(h);
|
||||
id
|
||||
}
|
||||
|
||||
/// Photos at `paths`, each with its keywords and capture time.
|
||||
fn library(photos: &[(&str, &[&str], &str)]) -> Session {
|
||||
let mut s = Session::new();
|
||||
for (i, (path, keywords, taken)) in photos.iter().enumerate() {
|
||||
let name = path.rsplit('/').next().unwrap();
|
||||
let mut p = Photo::new(PhotoId(i as u64 + 1), Source::File { path: (*path).into() }, name, "JPEG", 60, 40, "2026-03-01T00:00:00");
|
||||
p.captured = Some((*taken).to_string());
|
||||
p.meta.keywords = keywords.iter().map(|k| (*k).to_string()).collect();
|
||||
s.catalog.apply(Op::AddPhoto { photo: Box::new(p) }).unwrap();
|
||||
}
|
||||
s
|
||||
}
|
||||
|
||||
fn toggle(kind: &str, id: impl std::fmt::Display) -> String {
|
||||
format!("{kind}Toggle:{id}")
|
||||
}
|
||||
|
||||
/// Given folders of albums three deep, when the outer folder's triangle is clicked with Option,
|
||||
/// then it and the folders inside it fold together, and an Option-click opens them all again,
|
||||
/// though the inner folders were not drawn while the outer one was folded.
|
||||
#[test]
|
||||
fn option_click_folds_and_opens_a_branch_of_album_folders() {
|
||||
let mut h = start(Session::new());
|
||||
let trips = make(&mut h, json!({"name": "Trips", "folder": true}));
|
||||
let europe = make(&mut h, json!({"name": "Europe", "folder": true, "parent": trips}));
|
||||
let france = make(&mut h, json!({"name": "France", "folder": true, "parent": europe}));
|
||||
let best = make(&mut h, json!({"name": "Best", "parent": france}));
|
||||
let other = make(&mut h, json!({"name": "Other", "folder": true}));
|
||||
let kept = make(&mut h, json!({"name": "Kept", "parent": other}));
|
||||
let (best_row, kept_row) = (format!("source:album:{best}"), format!("source:album:{kept}"));
|
||||
assert!(has(&h, &best_row), "folders start open");
|
||||
|
||||
click(&mut h, &toggle("album", trips), true);
|
||||
assert!(!has(&h, &format!("source:folder:{europe}")) && !has(&h, &best_row), "the branch is folded");
|
||||
assert!(has(&h, &kept_row), "a folder beside it is not");
|
||||
|
||||
// a plain click opens the one row: the folders inside it stay folded
|
||||
click(&mut h, &toggle("album", trips), false);
|
||||
assert!(has(&h, &format!("source:folder:{europe}")), "Trips is open");
|
||||
assert!(!has(&h, &format!("source:folder:{france}")) && !has(&h, &best_row), "Europe stays folded");
|
||||
|
||||
// fold it by hand, and Option-click it open: the folders that were never drawn open too
|
||||
click(&mut h, &toggle("album", trips), false);
|
||||
click(&mut h, &toggle("album", trips), true);
|
||||
assert!(has(&h, &best_row), "Europe and France are open");
|
||||
|
||||
// what is said of a row afterwards holds for that row alone
|
||||
click(&mut h, &toggle("album", trips), true);
|
||||
click(&mut h, &toggle("album", trips), false);
|
||||
click(&mut h, &toggle("album", europe), false);
|
||||
assert!(has(&h, &format!("source:folder:{france}")) && !has(&h, &best_row), "Europe is open, France stays folded");
|
||||
|
||||
// a folder made inside a branch that was folded this way follows it: folded
|
||||
click(&mut h, &toggle("album", trips), true);
|
||||
click(&mut h, &toggle("album", trips), false);
|
||||
let africa = make(&mut h, json!({"name": "Africa", "folder": true, "parent": trips}));
|
||||
let kenya = make(&mut h, json!({"name": "Kenya", "parent": africa}));
|
||||
assert!(has(&h, &format!("source:folder:{africa}")) && !has(&h, &format!("source:album:{kenya}")), "Africa is folded, as the branch was left");
|
||||
}
|
||||
|
||||
/// Given the Folders and Keywords trees and By Date, when a top row's triangle is clicked with
|
||||
/// Option, then everything inside it opens, and an Option-click folds it again.
|
||||
#[test]
|
||||
fn option_click_opens_and_folds_folders_keywords_and_dates() {
|
||||
let mut h = start(library(&[
|
||||
("/lc-branch/a/b/c/one.jpg", &["Places|Europe|France"], "2026-01-05T10:00:00"),
|
||||
("/lc-branch/a/b/two.jpg", &["Places|Europe|Spain"], "2026-01-06T10:00:00"),
|
||||
("/lc-branch/a/three.jpg", &["Places|Asia"], "2026-02-07T10:00:00"),
|
||||
]));
|
||||
// Keywords
|
||||
assert!(has(&h, "source:keyword:Places") && !has(&h, "source:keyword:Places|Europe"), "keywords start folded");
|
||||
click(&mut h, &toggle("keyword", "Places"), true);
|
||||
assert!(has(&h, "source:keyword:Places|Europe|France"), "Places opens with the keywords inside it");
|
||||
click(&mut h, &toggle("keyword", "Places"), true);
|
||||
assert!(!has(&h, "source:keyword:Places|Europe"), "and folds");
|
||||
click(&mut h, &toggle("keyword", "Places"), false);
|
||||
assert!(has(&h, "source:keyword:Places|Europe") && !has(&h, "source:keyword:Places|Europe|France"), "a plain click opens one row");
|
||||
// By Date
|
||||
assert!(has(&h, "source:date:2026") && !has(&h, "source:date:2026-01"), "dates start folded");
|
||||
click(&mut h, &toggle("date", "2026"), true);
|
||||
assert!(has(&h, "source:date:2026-01") && has(&h, "source:date:2026-01-05") && has(&h, "source:date:2026-02-07"), "the months and their days");
|
||||
click(&mut h, &toggle("date", "2026"), true);
|
||||
assert!(!has(&h, "source:date:2026-01"));
|
||||
// Folders: This Computer, down to the last folder
|
||||
let top = toggle("libraryFolder", "/");
|
||||
let (below, deepest) = ("source:libfolder:/lc-branch", "source:libfolder:/lc-branch/a/b/c");
|
||||
assert!(has(&h, below) && !has(&h, deepest), "This Computer starts open, the folders in it as they begin");
|
||||
click(&mut h, &top, true);
|
||||
assert!(!has(&h, below), "folded with everything in it");
|
||||
click(&mut h, &top, true);
|
||||
assert!(has(&h, deepest), "opens down to the last folder, which was not drawn");
|
||||
}
|
||||
|
||||
/// Given a folder on disk in Local with folders inside it, when its triangle is clicked with
|
||||
/// Option, then opening opens the one folder (a disk's folders are read as they are opened), and
|
||||
/// folding folds everything inside it.
|
||||
#[test]
|
||||
fn option_click_in_local_folds_everything_and_opens_one_row() {
|
||||
let root = std::env::temp_dir().join(format!("lc-branch-local-{}", std::process::id()));
|
||||
let _ = std::fs::remove_dir_all(&root);
|
||||
std::fs::create_dir_all(root.join("a/b")).unwrap();
|
||||
let path = root.to_string_lossy().to_string();
|
||||
let mut h = start(Session::new());
|
||||
h.app.run("local.addRoot", json!({"path": path})).unwrap();
|
||||
frames(&mut h);
|
||||
let sub = |name: &str| std::path::Path::new(&path).join(name).to_string_lossy().to_string();
|
||||
let (a_path, b_path) = (sub("a"), std::path::Path::new(&sub("a")).join("b").to_string_lossy().to_string());
|
||||
let (a, b) = (format!("source:local:{a_path}"), format!("source:local:{b_path}"));
|
||||
let root_toggle = toggle("folder", &path);
|
||||
assert!(has(&h, &root_toggle), "the folder is listed in Local");
|
||||
click(&mut h, &root_toggle, true);
|
||||
assert!(h.step_until(T, |h| has(h, &a)), "Option opens the folder");
|
||||
// (the folders inside it are listed on a worker: wait for them before saying one is missing)
|
||||
h.settle(T);
|
||||
frames(&mut h);
|
||||
assert!(!has(&h, &b), "and no more than that");
|
||||
click(&mut h, &toggle("folder", &a_path), false);
|
||||
assert!(h.step_until(T, |h| has(h, &b)), "a plain click opens the one below");
|
||||
click(&mut h, &root_toggle, true);
|
||||
assert!(!has(&h, &a), "Option folds it");
|
||||
click(&mut h, &root_toggle, false);
|
||||
assert!(has(&h, &a) && !has(&h, &b), "and what was inside it is folded too");
|
||||
let _ = std::fs::remove_dir_all(&root);
|
||||
}
|
||||
@@ -91,7 +91,7 @@ filmstrip is visible.
|
||||
| `ui.menu.tree` | — | The menu bar as shown (File … Help): items `{id, params?, label, shortcut?, enabled, checked?}`, separators, submenus — the model behind the native macOS menu bar and the in-window menus |
|
||||
| `ui.inspect` | — | UI state, window, `loupe` (`source`, `pending`, `failed` = why its render failed, else `null`, and `region: {full, window, pending}` when a zoomed view also renders the window on screen at no more than 100 % — `full` is the frame it is cut from, `window` its `[x, y, w, h]` — and `regionBefore` for the Before side of a Before/After view), canvas/image rects, `scroll: {grid, filmstrip}` (scroll offsets in points, `null` until drawn), active photo, selection, perf (`frameMs` = layout, `logicMs` = per-frame logic before it, `updateMs` = both, `maxUpdateMs`, `fps`, render queue …, `gpu` = adapter in use, `gpuReason` = why renders don't use the GPU, `gpuFallback` = latest render redone on the CPU and why, `gpuWindowDevice` / `screenTextures` / `mainOnGpu` = renders run on the window's device / can be drawn from the GPU / the loupe shows one now — see `docs/gpu-pipeline.md`, `loupeSteps` = how the loupe showed each photo it was stepped to, measured on the frames it drew: `{steps: [{photo, anyMs, anySource, fullMs, fullSource, sharpMs, dwellMs}], total, current}` — ms from the step to the first frame with anything of the photo, with a full-size picture (`embedded` camera JPEG, `cached` or `render`), and with LightCraft's own render; `dwellMs` is how long it stayed, the latest 256 steps; `total` counts every step finished since launch, a cursor that keeps rising when old steps leave the list; `thumbsMade` = photos given a grid thumbnail since launch (never lowered when old thumbnails are evicted, unlike `thumbTextures`); `previewCache` = the rendered-preview cache: `memEntries` / `memBytes` in memory, the disk cache's `diskHits`, `diskMisses`, `diskWrites` and `diskBudget` (bytes; all `null` without a library on disk), and `loupeEdge` (px, the loupe's longest edge, the size standard previews are built at)), status, memory (bytes per cache, see `library.memory`; plus stage caches — `budgetBytes`, `trimmed`, `sharedSourceBytes` (the one device copy of a big original) — and textures), `export: {running: {total, done, current} \| null, last}`, `notices` (warnings waiting to be shown, e.g. a damaged settings file, or once per session the drive holding the preview cache running low; OK = `button:noticeOk`, and the low-drive notice's `button:noticeSettings` opens Settings ▸ Performance), `quitPrompt` (why quitting was stopped: tasks that would be cut short are running — `button:quitAnyway` cancels them and quits, `button:quitCancel` keeps working — or unsaved changes: `button:quitRetry` / `button:quitAnyway` / `button:quitCancel`), `import: {done, total, imported, cancelled} \| null` (an import runs on a worker thread), `tasks` (other background work: `Find Missing Photos`, `Auto Import`), `activity` (every long-running task in flight as the activity stack in the top-left corner shows it, same shape as `activity.list`; a row appears once its task is 0.5 s old, ids `activity:row:<id>`, ✕ = `activity:cancel:<id>`, `activity:more` expands past 3 rows), `fileDialogs` (commands waiting on a native file dialog, which runs off the UI thread; they run again with the answer when it closes), `copied` (the text the UI last put on the clipboard, `null` until something is copied) |
|
||||
| `ui.widgets` | `{filter?}` | On-screen widgets `{id, rect: [x, y, w, h]}` (screen points) |
|
||||
| `ui.clickWidget` / `ui.dragWidget` / `ui.hoverWidget` | `{id, count?, button?, fx?, fy?}` (`button: "right"` right-clicks; `count` is capped at 16) / `{id, toX?, toY?, dx?, dy?, steps?}` (steps are capped at 1000) / `{id, fx?, fy?}` | Real egui input on a widget (hover: the pointer rests on it, e.g. for preset/profile previews). `fx`/`fy` are fractions of the registered rect and may lie outside `[0,1]`; the resulting point must still be inside egui's clipped interaction rect, and a non-finite fraction or resolved point is rejected before any input is queued. Geometry comes from the latest completed layout; if the widget moves before the first event or before a press, or its latest clipped rect no longer contains the point, the request fails with an error instead of clicking another widget or retargeting. A target below an ordinary modal dialog may succeed as a no-op or a backdrop click, because egui routes that input to the dialog; a target covered by a non-modal overlay fails. The blocking library-problem/launch-list window is explicit: its dim takes the modal layer, but a background target fails instead of reporting a no-op success, and only that window's own controls (`button:library…`) pass. Its creation frame is shielded and redrawn with empty input like a prompt's, so background text/pointer input cannot act while the new modal areas settle. A quit prompt or settings notice is a real egui modal scope with a foreground backdrop. Only its own buttons (`button:quit…`, `button:noticeOk`) accept a `ui.clickWidget`; background targets fail, and background keystrokes, text/clipboard input, wheel/zoom input and AccessKit actions are dropped before panels see them. The prompt itself takes Tab/Shift+Tab, Enter/Space on the focused button, and Escape/Enter for the safe default Cancel; AccessKit Focus/Click works when targeted at a prompt button. Its first creation frame (including a Tasks→Unsaved or notice→next-notice transition) is shielded and redrawn with empty input, so a press/release in that frame, or a held press from before it, cannot act underneath it; a synthetic drag already in progress is canceled. Once settled, raw `ui.click`/`ui.drag`/`ui.pointer` and backdrop clicks are still delivered to the prompt backdrop as no-ops, and the prompt's own button clicks work normally. The area/layer check cannot see a different widget covering the point in the same layer. A `ui.clickWidget` whose widget disappears before its release also fails, after canceling the pointer press without a click or drag (the same rules apply when a click spans several host frames) |
|
||||
| `ui.clickWidget` / `ui.dragWidget` / `ui.hoverWidget` | `{id, count?, button?, fx?, fy?, alt?, shift?, cmd?, ctrl?}` (`button: "right"` right-clicks; `count` is capped at 16; the modifiers are held for the click or drag, e.g. `alt: true` on a sidebar triangle opens or folds the row with all the rows inside it; in Local it folds them and opens the one row) / `{id, toX?, toY?, dx?, dy?, steps?}` (steps are capped at 1000) / `{id, fx?, fy?}` | Real egui input on a widget (hover: the pointer rests on it, e.g. for preset/profile previews). `fx`/`fy` are fractions of the registered rect and may lie outside `[0,1]`; the resulting point must still be inside egui's clipped interaction rect, and a non-finite fraction or resolved point is rejected before any input is queued. Geometry comes from the latest completed layout; if the widget moves before the first event or before a press, or its latest clipped rect no longer contains the point, the request fails with an error instead of clicking another widget or retargeting. A target below an ordinary modal dialog may succeed as a no-op or a backdrop click, because egui routes that input to the dialog; a target covered by a non-modal overlay fails. The blocking library-problem/launch-list window is explicit: its dim takes the modal layer, but a background target fails instead of reporting a no-op success, and only that window's own controls (`button:library…`) pass. Its creation frame is shielded and redrawn with empty input like a prompt's, so background text/pointer input cannot act while the new modal areas settle. A quit prompt or settings notice is a real egui modal scope with a foreground backdrop. Only its own buttons (`button:quit…`, `button:noticeOk`) accept a `ui.clickWidget`; background targets fail, and background keystrokes, text/clipboard input, wheel/zoom input and AccessKit actions are dropped before panels see them. The prompt itself takes Tab/Shift+Tab, Enter/Space on the focused button, and Escape/Enter for the safe default Cancel; AccessKit Focus/Click works when targeted at a prompt button. Its first creation frame (including a Tasks→Unsaved or notice→next-notice transition) is shielded and redrawn with empty input, so a press/release in that frame, or a held press from before it, cannot act underneath it; a synthetic drag already in progress is canceled. Once settled, raw `ui.click`/`ui.drag`/`ui.pointer` and backdrop clicks are still delivered to the prompt backdrop as no-ops, and the prompt's own button clicks work normally. The area/layer check cannot see a different widget covering the point in the same layer. A `ui.clickWidget` whose widget disappears before its release also fails, after canceling the pointer press without a click or drag (the same rules apply when a click spans several host frames) |
|
||||
| `ui.move` / `ui.click` / `ui.drag` | `{x, y, count?, button?}` / `{x, y, toX, toY, steps?}` | Raw pointer input, screen points (the same click and step caps apply). In every pointer and scroll gesture a number other than `count` and `steps` must lie between −1,000,000 and 1,000,000, or the request is refused and queues nothing |
|
||||
| `ui.pointer` | `{events: [{kind: down\|drag\|up, x, y}], alt?, shift?, cmd?}` | Gesture in normalized image coordinates (Detail view) |
|
||||
| `ui.key` | `{key, action?: press\|down\|up, cmd?, shift?, alt?, ctrl?}` | Key press (default), or the key going `down` and staying held until an `up` (Space held over a `ui.pointer` drag); while a prompt is up only its Tab/Shift+Tab, Enter, Space and Escape are delivered, every other key is dropped |
|
||||
|
||||
@@ -472,7 +472,7 @@ differences and missing bindings are in [ui-parity.md](ui-parity.md#shortcuts).
|
||||
| LR-BEHAV-TOAST | Toast notifications | P1 | ✅ | `crates/ui-egui/src/panels.rs` | |
|
||||
| LR-BEHAV-DIALOGS | Dialogs fit the window | P1 | ✅ | `crates/ui-egui/src/dialogs.rs` (`dialog_body`, `list_height`), `crates/ui-egui/src/tests/dialog_fit.rs`, `crates/ui-egui/src/tests/dialog_copy.rs`, `crates/ui-egui/src/tests/dialogs.rs` (`a_click_outside_closes_the_dialog_when_settings_allow_it`) | a dialog taller than the window (Export on a 1366×768 screen, issue #781) never runs off it: its options scroll while the title bar and the Cancel / confirm row stay on screen (the confirm button names its action: Create, Rename, Create Stacks, Export 3 Photos…, with "OK" kept only for a one-field prompt opened with a command that has no verb, `crates/ui-egui/src/tests/dialog_copy.rs`); lists that scroll on their own (What's New, All Metadata, shortcuts, smart-album rules, credits) get shorter first; dialogs that fit look as before; Import keeps its own resizable, scrolling window; Settings → Dialogs → Close a dialog by clicking outside it (off by default, so a stray click never throws away a dialog's choices): a click pressed and released on the dimmed backdrop closes the dialog like Esc and doesn't reach the panels below, while a drag that ends outside (a slider pulled past the edge) or a click that closes a dropdown keeps it; the import review never closes this way (`clicked_backdrop`); a one-line prompt (Rename Folder, New Folder on Disk, the preset and version names, New Library when its name can't be used, Auto-Tag from Tracklog) the engine refuses stays open with its text and shows the reason in a toast, so the name can be corrected, where it used to close without a word; a New Folder on Disk that works says so (“Created folder “Selects” in “2026/Shoot””, naming the parent by its last two folders as dialogs do) |
|
||||
| LR-BEHAV-SIDEBAR-COLLAPSE | Collapsible left-sidebar sections | P2 | ✅ | `crates/ui-egui/src/panels/left.rs` (`section`, `section_header`), `crates/ui-egui/src/sidebar.rs` (`SidebarLayout`), `crates/ui-egui/src/tests/panels.rs` | click the Albums, Local, By Date, Folders or Keywords header (or drive `ui.clickWidget` `sidebarSection:<albums\|local\|byDate\|folders\|keywords>`) to fold or unfold the section; a chevron before the title shows the state; the choice is kept across restarts (`sidebar` in the UI state; the `collapsedSidebar` list of older settings files is still read). the click itself is UI-only, like the By Date / Keywords disclosure triangles, and `cmd:view.sidebarSection` `{section, collapsed}` folds and unfolds for agents; photos dropped on a folded Albums section have no target |
|
||||
| LR-BEHAV-SIDEBAR-SECTIONS | Left-sidebar sections share one frame and one arrangement | P2 | ✅ | `crates/ui-egui/src/sidebar.rs` (`SidebarSection`, `SidebarLayout`), `crates/ui-egui/src/panels/left.rs` (`section`, `section_header`, `tree_toggle`), `crates/ui-egui/src/tests/panels.rs` | Albums, Local, By Date, Folders and Keywords are drawn by one `section` frame (the same gap above, header, fold and accessibility name) from one arrangement, `sidebar` in the UI state: a list of `{id, hidden, collapsed}` top to bottom, also settable with `ui.set`. Whatever is read, every section is in it exactly once (unknown and repeated entries are dropped, the rest follow in the usual order), so a damaged or newer settings file never loses the other settings. Rows that open (album folders, Local folders, dates, library folders, keywords) share `tree_toggle`: the same triangle, the same remembered open state, announced as Expand / Collapse. A section with nothing to list (Folders before anything is imported, Keywords before any is added) stays, open, with a one-line note in place of rows (`sidebarEmpty:<id>`) instead of disappearing. `ui.set` reads `sidebar` strictly (`SidebarLayout::parse`): an unknown or repeated section, or a flag that is not true / false, is refused and changes nothing; sections left out follow in the usual order, shown and open; the older `collapsedSidebar` list still folds and unfolds. A section may have one button at the end of its header, declared in one place (`header_button`: an icon, a tooltip, and either an action or a menu): the frame draws it at the visible edge in the header and its pinned copy, keeps its click from folding the section and leaves it room beside a folded section's count. Albums has + (`icon:albumNew`: Create Album / Smart Album / Folder…), Keywords has + (`icon:keywordNew`: Create Keyword Tag, for a keyword inside the default parent, not inside what the Keyword List has picked; once made, Keywords is shown and opened down to it). My Photos (All Photos, Recently Added, Picks, Missing Photos, Recently Deleted) is not a section: it stays on top |
|
||||
| LR-BEHAV-SIDEBAR-SECTIONS | Left-sidebar sections share one frame and one arrangement | P2 | ✅ | `crates/ui-egui/src/sidebar.rs` (`SidebarSection`, `SidebarLayout`), `crates/ui-egui/src/panels/left.rs` (`section`, `section_header`, `tree_toggle`), `crates/ui-egui/src/tests/panels.rs`, `crates/ui-egui/tests/it/sidebar_branch.rs` | Albums, Local, By Date, Folders and Keywords are drawn by one `section` frame (the same gap above, header, fold and accessibility name) from one arrangement, `sidebar` in the UI state: a list of `{id, hidden, collapsed}` top to bottom, also settable with `ui.set`. Whatever is read, every section is in it exactly once (unknown and repeated entries are dropped, the rest follow in the usual order), so a damaged or newer settings file never loses the other settings. Rows that open (album folders, Local folders, dates, library folders, keywords) share `tree_toggle`: the same triangle, the same remembered open state, announced as Expand / Collapse. A click on the triangle with Option (Alt on Windows and Linux) held opens or folds the row and all the rows inside it, however many and also those not drawn yet: it is kept for the session as one thing said of all the rows inside the row (a row is as the last thing said of it, or of a row above it, has it), so a folder made inside the branch later follows it; in Local it folds everything inside a folder and opens the one folder (opening them all would read every folder from the disk); `ui.clickWidget` takes `alt: true` for it. A section with nothing to list (Folders before anything is imported, Keywords before any is added) stays, open, with a one-line note in place of rows (`sidebarEmpty:<id>`) instead of disappearing. `ui.set` reads `sidebar` strictly (`SidebarLayout::parse`): an unknown or repeated section, or a flag that is not true / false, is refused and changes nothing; sections left out follow in the usual order, shown and open; the older `collapsedSidebar` list still folds and unfolds. A section may have one button at the end of its header, declared in one place (`header_button`: an icon, a tooltip, and either an action or a menu): the frame draws it at the visible edge in the header and its pinned copy, keeps its click from folding the section and leaves it room beside a folded section's count. Albums has + (`icon:albumNew`: Create Album / Smart Album / Folder…), Keywords has + (`icon:keywordNew`: Create Keyword Tag, for a keyword inside the default parent, not inside what the Keyword List has picked; once made, Keywords is shown and opened down to it). My Photos (All Photos, Recently Added, Picks, Missing Photos, Recently Deleted) is not a section: it stays on top |
|
||||
| LR-BEHAV-SIDEBAR-HIDE | Show and hide left-sidebar sections | P2 | ✅ | `cmd:view.sidebarSection`, `cmd:view.sidebarReset`, `crates/ui-egui/src/sidebar.rs`, `crates/ui-egui/src/panels/left.rs` (`sections_menu`), `crates/ui-egui/src/menus/menubar.rs`, `crates/ui-egui/src/tests/panels.rs` | View ▸ Sidebar Sections lists Albums, Local, By Date, Folders and Keywords in the sidebar's order, each checked while shown; unchecking one takes its header and rows off the sidebar, checking it puts it back where and how it was (still folded if it was). The same list opens with a right-click on any section header (with Hide This Section first; widgets `sidebarMenu:hide`, `sidebarMenu:section:<id>`, `sidebarMenu:reset`) and on the My Photos title (`sidebarTitle`), which is always there, so hidden sections can always come back. Reset Sidebar Sections (enabled once something changed) shows and opens every section in the usual order. `view.sidebarSection` `{section, show?, collapsed?}` flips shown / hidden when neither flag is given and refuses an unknown section or a flag that is not true / false. Hiding the section of what the grid shows (an album, a keyword filter) leaves the grid as it is; an album made while Albums is hidden or folded brings Albums back, open. Kept with the UI state (`sidebar`). My Photos itself can't be hidden |
|
||||
| LR-BEHAV-SIDEBAR-REORDER | Reorder left-sidebar sections | P2 | ✅ | `cmd:view.sidebarMoveSection`, `crates/ui-egui/src/sidebar.rs` (`move_before`, `move_by`), `crates/ui-egui/src/panels/left.rs` (`section_drag`, `section_drop_before`, `section_drag_feedback`), `crates/ui-egui/src/tests/panels.rs` | drag a section by its header: its name follows the pointer, a line (`sidebarSectionDrop`) shows the gap it would go to (above the section whose upper half the pointer is over, or below the last), releasing over the sidebar moves it there, Esc or releasing elsewhere leaves it; the sidebar scrolls when the drag nears its top or bottom edge, also over a pinned header (a section picked up by the pinned header scrolls once the pointer has left it). A press on a header's button is never a section drag. A click on the header still folds the section, and an album dragged onto the Albums header is still an album drag. The header's menu has Move Up / Move Down (`sidebarMenu:moveUp` / `moveDown`), one shown section at a time, stepping over hidden ones, disabled at the ends. `view.sidebarMoveSection` `{section, direction: up\|down}` or `{section, before: <section>\|null}` (null: last) answers `{moved, order}`. The order is kept with the UI state (`sidebar`). Recently Deleted is listed with My Photos (below Picks / Missing Photos), not after the sections. Not here: dragging My Photos, or rows from one section into another |
|
||||
| LR-BEHAV-SIDEBAR-STICKY | Pinned section header and section look | P2 | ✅ | `crates/ui-egui/src/panels/left.rs` (`pinned_header`, `section_header`, `empty_hint`), `crates/ui-egui/src/tests/panels.rs` | while the rows of an open section are in view but its header has scrolled away, a copy of the header (`sidebarSectionPinned:<id>`, with the section's buttons and menu) stays at the top of the sidebar; the next section's header pushes it out; folding from it brings the section's own header into view. Rows scrolled beneath the pinned header are covered by it: an album or photos dropped on the pinned Albums header go to the top level / nowhere, never to the row under it; folding from it keeps the sideways scroll. Sections are told apart by a hairline in the gap above each; the fold chevron sits in the gutter, in the column of the rows' triangles (`sidebarSectionChevron:<id>`); a header highlights under the pointer; a folded section shows how many top-level rows it holds (`sidebarSectionCount:<id>`, with View ▸ Photo Counts); a count of 0 is fainter. Not here: a height of its own per section (one scroll area serves the whole sidebar), a count for Recently Added, Local's Browse Folder… as a header button |
|
||||
@@ -1046,6 +1046,7 @@ Latin stays upright. Advanced Japanese composition remains open. Regression cove
|
||||
| 2026-10-29 | patch | LR-BEHAV-TITLEBAR: a dialog's backdrop leaves the integrated title bar undimmed, as a macOS sheet does (the bar's controls stay inactive, a click on it is not a click outside the dialog, dragging its empty space still moves the window); status unchanged (🟡) |
|
||||
| 2026-10-29 | minor | LR-MASK-OBJECTS: an Object / Describe selection's stored grid is enlarged along the photo's edges (fast guided filter of its logits by log luminance, a 1.5-cell window), so a raised Exposure no longer draws an outline around the subject (#3272); existing AI masks are 1–2 px tighter at edges; status unchanged (🟡) |
|
||||
| 2026-10-30 | patch | LR-MASK-COLORRANGE: a colour-range mask keeps its first 64 samples however it is loaded (sidecar `lc:settings`, presets, `develop.merge`, `render --settings`, catalog and history), not only through `mask.add` / `mask.update`, so a document with thousands can't stall a render or lose the GPU device (issue #2556); status unchanged (✅) |
|
||||
| 2026-10-23 | minor | LR-BEHAV-SIDEBAR-SECTIONS: a click on a tree row's triangle with Option (Alt) held opens or folds the row and all the rows inside it, for the session; status unchanged (✅) |
|
||||
| 2026-10-20 | patch | LR-PRE-PANEL, LR-PRE-AMOUNT: a preset changes only the settings it names; each is measured from the photo's import look when one is recorded, otherwise from its current value (issue #2159). Statuses and feature counts unchanged. |
|
||||
| 2026-10-17 | minor | LR-EXP-DIALOG: built-in export presets for the issue #2104 delivery targets — Instagram Feed (1080 px, screen sharpening), Instagram Story / Reel (1920 px), Web / Portfolio (2048 px, copyright-only metadata), Full Resolution Master (full size, Display P3, quality 95); LR-EXP-PREVIOUS drops its stale "no named export presets yet" note; status unchanged (✅) |
|
||||
| 2026-10-17 | minor | LR-EXP-DIALOG: built-in export presets for the issue #2104 delivery targets — Instagram Feed (1080 px, screen sharpening), Instagram Story / Reel (1920 px), Web / Portfolio (2048 px, copyright and creator metadata), Full Resolution Master (full size, Display P3, quality 95); LR-EXP-PREVIOUS drops its stale "no named export presets yet" note; status unchanged (✅) |
|
||||
|
||||
@@ -468,6 +468,19 @@
|
||||
server's files written there; it is now refused. Each file is saved complete or not at all, and replaces whatever
|
||||
is in its place instead of writing through a link to somewhere else.
|
||||
|
||||
### Open or fold a whole branch of the sidebar
|
||||
- Hold Option (Alt on Windows and Linux) and click a row's triangle in the left sidebar to open or fold that row
|
||||
and all the rows inside it, however many: a folder of albums with the folders in it, a folder of the library
|
||||
down to its last folder, a keyword with the keywords inside it, a year with its months. A plain click still
|
||||
opens or folds the one row.
|
||||
- What you open or fold inside it afterwards holds for that row. A folder that appears inside it later is as
|
||||
the last Option-click on a row above it left the rest.
|
||||
- In Local, Option-click folds everything inside the folder; opening opens the one folder (opening them all
|
||||
would read every folder inside from the disk).
|
||||
- The sidebar's rows are not remembered between sessions, so a branch opened or folded this way starts again as
|
||||
the sidebar starts.
|
||||
- For scripts: `ui.clickWidget` takes `alt: true` for this click.
|
||||
|
||||
### Videos in the grid are no longer sent to the image decoders
|
||||
- A video in the library (an MP4 or MOV brought in from a Lightroom catalog) no longer asks the image decoders for a
|
||||
grid thumbnail (issue #2682). They can't read one, so each video failed with "unrecognised image format", showed a
|
||||
|
||||
Reference in new issue
Block a user