mirror of
https://github.com/storytold/lightcraft.git
synced 2026-11-01 14:07:34 -06:00
Merge PR #2758: KEYC-RATING: deleting the only keyword of the filter Enable Filters put aside leaves filtering on
Conflicts in docs/parity-checklist.md: kept both sides (union).
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
//! Library-wide keyword commands: list (tree with counts), suggestions, rename, delete, merge;
|
||||
//! keyword sets (nine keywords a keystroke away: ⌥1–⌥9) and Recent Keywords.
|
||||
|
||||
use lightcraft_catalog::Filter;
|
||||
use lightcraft_catalog::keywords::{KeywordInfo, clean, closest, is_under, reparent};
|
||||
use serde_json::{Value, json};
|
||||
|
||||
@@ -33,10 +34,17 @@ fn commit_keywords(s: &mut Session, label: &str, op: lightcraft_catalog::Op, fol
|
||||
s.filter.keyword = follow(&k);
|
||||
}
|
||||
// a filter put aside by Enable Filters follows the keyword too
|
||||
let mut gone_from_put_aside = false;
|
||||
if let Some(f) = s.shelved_filter.as_mut()
|
||||
&& let Some(k) = f.keyword.clone()
|
||||
{
|
||||
f.keyword = follow(&k);
|
||||
// the keyword was deleted: if that emptied the filter, nothing is left to bring back. The rating
|
||||
// operator filters nothing without stars, so it alone does not count as something to bring back.
|
||||
gone_from_put_aside = f.keyword.is_none() && (Filter { rating_op: Default::default(), ..f.clone() }) == Filter::default();
|
||||
}
|
||||
if gone_from_put_aside {
|
||||
s.shelved_filter = None;
|
||||
}
|
||||
Ok(json!({"changed": photos, "listed": listed}))
|
||||
}
|
||||
|
||||
@@ -152,3 +152,72 @@ fn a_keyword_renamed_while_off_is_followed_by_the_filter_put_aside() {
|
||||
assert_eq!(s.filter.keyword.as_deref(), Some("dog"), "the put-aside filter follows the rename");
|
||||
assert_eq!(s.visible().len(), 1);
|
||||
}
|
||||
|
||||
/// The session's photos plus one photo that carries the keyword "cat".
|
||||
fn session_with_a_cat() -> Session {
|
||||
let mut s = session().unwrap();
|
||||
let mut photo = Photo::new(PhotoId(5), Source::File { path: "/lightcraft-enable-filters/5.jpg".into() }, "5.jpg", "JPEG", 40, 30, "2026-10-23");
|
||||
photo.meta.keywords = vec!["cat".into()];
|
||||
s.catalog.apply(Op::AddPhoto { photo: Box::new(photo) }).unwrap();
|
||||
s
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn deleting_the_only_keyword_put_aside_leaves_filtering_on() {
|
||||
let mut s = session_with_a_cat();
|
||||
s.execute("library.filter", &json!({"keyword": "cat"})).unwrap();
|
||||
assert_eq!(s.visible().len(), 1);
|
||||
s.execute("library.toggleFilters", &json!({})).unwrap();
|
||||
assert!(s.filters_off());
|
||||
s.execute("keyword.delete", &json!({"keyword": "cat"})).unwrap();
|
||||
assert!(!s.filters_off(), "an empty filter is not left put aside");
|
||||
let r = s.execute("library.toggleFilters", &json!({})).unwrap();
|
||||
assert_eq!((r["enabled"].clone(), r["count"].clone()), (json!(true), json!(5)), "nothing was put aside, so nothing is switched off");
|
||||
assert_eq!(s.filter, Filter::default());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn deleting_a_keyword_put_aside_keeps_the_rest_of_the_filter() {
|
||||
let mut s = session_with_a_cat();
|
||||
s.execute("library.filter", &json!({"keyword": "cat", "rating": 4})).unwrap();
|
||||
s.execute("library.toggleFilters", &json!({})).unwrap();
|
||||
s.execute("keyword.delete", &json!({"keyword": "cat"})).unwrap();
|
||||
assert!(s.filters_off(), "the stars are still put aside");
|
||||
s.execute("library.toggleFilters", &json!({})).unwrap();
|
||||
assert_eq!(s.filter, Filter { rating: 4, ..Default::default() });
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn a_rating_operator_without_stars_does_not_keep_an_emptied_filter_put_aside() {
|
||||
let mut s = session_with_a_cat();
|
||||
// the filter bar's operator picker can be set with no stars chosen; it filters nothing
|
||||
s.execute("library.filter", &json!({"keyword": "cat", "ratingOp": "exactly"})).unwrap();
|
||||
s.execute("library.toggleFilters", &json!({})).unwrap();
|
||||
assert!(s.filters_off());
|
||||
s.execute("keyword.delete", &json!({"keyword": "cat"})).unwrap();
|
||||
assert!(!s.filters_off(), "only an operator with no stars is left: nothing to bring back");
|
||||
let r = s.execute("library.toggleFilters", &json!({})).unwrap();
|
||||
assert_eq!(r["enabled"], json!(true));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn a_rating_operator_put_aside_survives_a_keyword_change_that_does_not_touch_it() {
|
||||
let mut s = session_with_a_cat();
|
||||
s.execute("library.filter", &json!({"ratingOp": "exactly"})).unwrap();
|
||||
s.execute("library.toggleFilters", &json!({})).unwrap();
|
||||
assert!(s.filters_off());
|
||||
s.execute("keyword.rename", &json!({"from": "cat", "to": "dog"})).unwrap();
|
||||
assert!(s.filters_off(), "the filter put aside held no keyword, so the rename leaves it alone");
|
||||
s.execute("library.toggleFilters", &json!({})).unwrap();
|
||||
assert_eq!(s.filter.rating_op, lightcraft_catalog::RatingOp::Exactly);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn a_rating_operator_with_stars_is_kept_when_the_keyword_goes() {
|
||||
let mut s = session_with_a_cat();
|
||||
s.execute("library.filter", &json!({"keyword": "cat", "rating": 4, "ratingOp": "exactly"})).unwrap();
|
||||
s.execute("library.toggleFilters", &json!({})).unwrap();
|
||||
s.execute("keyword.delete", &json!({"keyword": "cat"})).unwrap();
|
||||
s.execute("library.toggleFilters", &json!({})).unwrap();
|
||||
assert_eq!((s.filter.rating, s.filter.rating_op), (4, lightcraft_catalog::RatingOp::Exactly));
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# Lightroom parity checklist
|
||||
|
||||
> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-27 · **Change:** minor (LR-BEHAV-DRAGDROP: a drop's destination is named with its parent when another folder or album has the same name; LR-VIEW-FILMSTRIP: photos drag from the filmstrip to the same sidebar targets as from the grid; LRC-LIB-LIBFOLDERS: a deep row's count follows its name in a narrow panel; LR-FILT-FLAG / LRC-LIB-FILTERBAR: the flag toggles combine, Picked + Unflagged, #2588; LR-VIEW-PHOTOGRID, LR-VIEW-FILMSTRIP, LR-VIEW-COMPARE, LR-VIEW-SURVEY, LRC-LIB-REFVIEW, LRC-LIB-PEOPLE: the active photo's selection ring shows on light themes and in Compare, Survey and the face tiles, and needs a loaded thumbnail; LR-FILT-SEARCH-META: `>=` / `<=` in fielded search tokens; MENU-FILE-CLOSE, KEY-CLOSEWINDOW: the notes say Close Window quits the app, after the same check as Quit; MENU-EDIT-SELECTNONE, MENU-EDIT-PASTESELECTED: Edit lists Select Only Active Photo after Deselect All and Paste Settings from Previous after Paste Selected Settings…; on macOS no doubled separators are left where Settings… moved to the app menu; LR-BEHAV-TITLEBAR: a double-click follows the system setting, and a panel over the bar keeps the window still; KEYC-METADATA, LRC-LIB-KEYWORDS: ⌥0 / ⌥⇧0 go to the next / previous keyword set; LRC-DEV-HISTOGRAM-DRAG: the histogram's five tonal zones — hover for the value, drag to adjust the Basic control the press locked, double-click to reset; LR-VIEW-HISTOGRAM note updated; MENU-BAR: on macOS a menu item that yields its key to a focused text field or to shortcut recording really lets it go; LR-MERGE-HDR / LR-MERGE-PANO: Lanczos-3 warps; LR-IMP-LOCAL: browsing from the sidebar records the folder; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LR-IMP-ADD-DIALOG: hierarchical import album destination reconciled with main, #2362; KEY-SLIDER-NUDGE: vertical wheel nudges need a click or drag in the row; leaving it disarms them; LR-EDIT-OPTICS-PROFILE: Fujifilm nine-knot lens tables read at the plain radius; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LRC-LIB-LIBFOLDERS, LR-BEHAV-BG-TASKS: Synchronize Folder's scan shows its folder listing and stops it on ✕; LRC-LIB-LIBFOLDERS: Synchronize Folder says a folder is up to date; LR-LIB-STACK: filmstrip stack badge click; LRC-LIB-REFVIEW / CATALOG-SWITCH: Escape preserves edits; catalog-local pins; deleted and malformed references refused; LRC-LIB-COMPARE: the Info panel labels the active photo while culling, #2398; KEYC-RATING: `\` shows / hides the Filter Bar in the grids; LR-VIEW-PHOTOGRID: the grid reads only the photos an import batch or an edit touched, not the whole list; earlier: LRC-PRINT-PAGE: Print Page Options; LR-META-XMP: fewer false unimported-XMP warnings; KEYC-METADATA: ⌘K / Ctrl+K Add Keywords; LRC-DEV-HISTOGRAM-DRAG: the histogram's five tonal zones — hover for the value, drag to adjust the Basic control the press locked, double-click to reset; LR-VIEW-HISTOGRAM note updated; MENU-BAR: on macOS a menu item that yields its key to a focused text field or to shortcut recording really lets it go; LR-MERGE-HDR / LR-MERGE-PANO: Lanczos-3 warps; LR-IMP-LOCAL: browsing from the sidebar records the folder; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LR-IMP-ADD-DIALOG: hierarchical import album destination reconciled with main, #2362; KEY-SLIDER-NUDGE: vertical wheel nudges need a click or drag in the row; leaving it disarms them; LR-EDIT-OPTICS-PROFILE: Fujifilm nine-knot lens tables read at the plain radius; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LRC-LIB-LIBFOLDERS, LR-BEHAV-BG-TASKS: Synchronize Folder's scan shows its folder listing and stops it on ✕; LRC-LIB-LIBFOLDERS: Synchronize Folder says a folder is up to date; LR-LIB-STACK: filmstrip stack badge click; LRC-LIB-REFVIEW / CATALOG-SWITCH: Escape preserves edits; catalog-local pins; deleted and malformed references refused; LRC-LIB-COMPARE: the Info panel labels the active photo while culling, #2398; KEYC-RATING: `\` shows / hides the Filter Bar in the grids; LR-VIEW-PHOTOGRID: the grid reads only the photos an import batch or an edit touched, not the whole list; earlier: LRC-PRINT-PAGE: Print Page Options; LR-META-XMP: fewer false unimported-XMP warnings) · **Target:** Adobe Lightroom Classic 15.5 / Lightroom 9.6
|
||||
> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-27 · **Change:** minor (KEYC-RATING: deleting a keyword while Enable Filters has the filter put aside no longer leaves an empty one there; LR-BEHAV-DRAGDROP: a drop's destination is named with its parent when another folder or album has the same name; LR-VIEW-FILMSTRIP: photos drag from the filmstrip to the same sidebar targets as from the grid; LRC-LIB-LIBFOLDERS: a deep row's count follows its name in a narrow panel; LR-FILT-FLAG / LRC-LIB-FILTERBAR: the flag toggles combine, Picked + Unflagged, #2588; LR-VIEW-PHOTOGRID, LR-VIEW-FILMSTRIP, LR-VIEW-COMPARE, LR-VIEW-SURVEY, LRC-LIB-REFVIEW, LRC-LIB-PEOPLE: the active photo's selection ring shows on light themes and in Compare, Survey and the face tiles, and needs a loaded thumbnail; LR-FILT-SEARCH-META: `>=` / `<=` in fielded search tokens; MENU-FILE-CLOSE, KEY-CLOSEWINDOW: the notes say Close Window quits the app, after the same check as Quit; MENU-EDIT-SELECTNONE, MENU-EDIT-PASTESELECTED: Edit lists Select Only Active Photo after Deselect All and Paste Settings from Previous after Paste Selected Settings…; on macOS no doubled separators are left where Settings… moved to the app menu; LR-BEHAV-TITLEBAR: a double-click follows the system setting, and a panel over the bar keeps the window still; KEYC-METADATA, LRC-LIB-KEYWORDS: ⌥0 / ⌥⇧0 go to the next / previous keyword set; LRC-DEV-HISTOGRAM-DRAG: the histogram's five tonal zones — hover for the value, drag to adjust the Basic control the press locked, double-click to reset; LR-VIEW-HISTOGRAM note updated; MENU-BAR: on macOS a menu item that yields its key to a focused text field or to shortcut recording really lets it go; LR-MERGE-HDR / LR-MERGE-PANO: Lanczos-3 warps; LR-IMP-LOCAL: browsing from the sidebar records the folder; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LR-IMP-ADD-DIALOG: hierarchical import album destination reconciled with main, #2362; KEY-SLIDER-NUDGE: vertical wheel nudges need a click or drag in the row; leaving it disarms them; LR-EDIT-OPTICS-PROFILE: Fujifilm nine-knot lens tables read at the plain radius; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LRC-LIB-LIBFOLDERS, LR-BEHAV-BG-TASKS: Synchronize Folder's scan shows its folder listing and stops it on ✕; LRC-LIB-LIBFOLDERS: Synchronize Folder says a folder is up to date; LR-LIB-STACK: filmstrip stack badge click; LRC-LIB-REFVIEW / CATALOG-SWITCH: Escape preserves edits; catalog-local pins; deleted and malformed references refused; LRC-LIB-COMPARE: the Info panel labels the active photo while culling, #2398; KEYC-RATING: `\` shows / hides the Filter Bar in the grids; LR-VIEW-PHOTOGRID: the grid reads only the photos an import batch or an edit touched, not the whole list; earlier: LRC-PRINT-PAGE: Print Page Options; LR-META-XMP: fewer false unimported-XMP warnings; KEYC-METADATA: ⌘K / Ctrl+K Add Keywords; LRC-DEV-HISTOGRAM-DRAG: the histogram's five tonal zones — hover for the value, drag to adjust the Basic control the press locked, double-click to reset; LR-VIEW-HISTOGRAM note updated; MENU-BAR: on macOS a menu item that yields its key to a focused text field or to shortcut recording really lets it go; LR-MERGE-HDR / LR-MERGE-PANO: Lanczos-3 warps; LR-IMP-LOCAL: browsing from the sidebar records the folder; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LR-IMP-ADD-DIALOG: hierarchical import album destination reconciled with main, #2362; KEY-SLIDER-NUDGE: vertical wheel nudges need a click or drag in the row; leaving it disarms them; LR-EDIT-OPTICS-PROFILE: Fujifilm nine-knot lens tables read at the plain radius; LR-VIEW-ZOOM: only a full-size drag within 20 ms clears a slow-drag verdict; LRC-LIB-LIBFOLDERS, LR-BEHAV-BG-TASKS: Synchronize Folder's scan shows its folder listing and stops it on ✕; LRC-LIB-LIBFOLDERS: Synchronize Folder says a folder is up to date; LR-LIB-STACK: filmstrip stack badge click; LRC-LIB-REFVIEW / CATALOG-SWITCH: Escape preserves edits; catalog-local pins; deleted and malformed references refused; LRC-LIB-COMPARE: the Info panel labels the active photo while culling, #2398; KEYC-RATING: `\` shows / hides the Filter Bar in the grids; LR-VIEW-PHOTOGRID: the grid reads only the photos an import batch or an edit touched, not the whole list; earlier: LRC-PRINT-PAGE: Print Page Options; LR-META-XMP: fewer false unimported-XMP warnings) · **Target:** Adobe Lightroom Classic 15.5 / Lightroom 9.6
|
||||
|
||||
The measured, row-by-row checklist: one row per Lightroom feature, menu item and shortcut, what we
|
||||
have and what is missing. It answers *does the feature exist?* (feature breadth). Whether it is good
|
||||
@@ -968,3 +968,4 @@ Latin stays upright. Advanced Japanese composition remains open. Regression cove
|
||||
| 2026-10-21 | minor | LRC-LIB-LIBFOLDERS: in a narrow panel, the count (and a label's colour dot) of a deeply indented sidebar row follows its name, wholly past the panel's edge (scrolling sideways reaches it), instead of printing over the folder's icon and name; status unchanged (✅) |
|
||||
| 2026-10-23 | patch | LR-VIEW-FILMSTRIP: filmstrip cells drag photos with the grid's drag (selection, drop targets, count label; in Compare an unselected photo drags alone); a click works as before (in Compare it goes to the active side). Statuses and feature counts unchanged. |
|
||||
| 2026-10-23 | minor | LR-BEHAV-DRAGDROP: a drop's destination is named with the folder it is in when another folder or album has the same name; status unchanged (✅) |
|
||||
| 2026-10-23 | patch | KEYC-RATING: deleting a keyword while ⌘L (Ctrl+L) Enable Filters has the filter put aside, when that keyword was all the filter held, no longer leaves an empty filter put aside (the menu showed Enable Filters unchecked with nothing to bring back); status unchanged (🟡) |
|
||||
|
||||
Reference in New Issue
Block a user