mirror of
https://github.com/storytold/lightcraft.git
synced 2026-10-26 02:59:17 -06:00
RuleSet::problems only checked that a field and operator exist (and, lately, yes/no values). Any other value was accepted and silently matched nothing or everything: "Rating ≥ abc", a date of "banana" or "2026-13", "Color Label isn't pink" (everything), "Title contains ''" (everything), "in the last 0 days", an album that is gone. RuleSet::check(&Catalog) -> Vec<Problem> replaces it. Each Problem has the rule's position (path [1, 0]; shown as "rule 2.1: …"), so the editor can point at the row. It checks: - numbers (rating 0–5), shutter speeds (1/250, 2) - dates: 2026, 2026-08, 2026-08-14 or a full time; real dates only - between: two bounds; dates in order (2026-08-14 … 2026-08 is fine) - in the last: N > 0 and a known unit - choices: the ids, the flag's picked / rejected, a colour label's custom name (from the catalog), copyright-status spellings - text and keyword / people rules: something to look for, or "is empty" - album: exists and is a plain album - no empty groups (an empty rule list at the top stays "all photos") album.createSmart, album.setRules and library.filter report every problem. The editor's date defaults move from "" (which, as "between", matched every dated photo) to the current year, and its test now requires every default to be valid, except text and album rules, which wait for input. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>