Repository navigation
#1708: filter the Metadata Date column by year, month and day - #1767
Closed
1234destiny1234 wants to merge 1 commit into
Closed
1234destiny1234 wants to merge 1 commit into
1234destiny1234 wants to merge 1 commit into
Conversation
The Date Metadata column listed capture years only, so a multi-day shoot could not be narrowed to a day. It is now one tree: a year opens to its months, a month to its days, and a click on any of them filters to that period. Library side - `lcc_catalog::facets`: `month` and `day` join `year` as the Date column's three depths (`2026`, `2026-05`, `2026-05-14`), all built from `dates::capture_start`, so a time recorded only to the year or month counts as the first day of its period. `facets::date_key` checks a value per depth (real month and day, no `0000`), and a value the library could not have stored lists nothing rather than something a click would reject. `sort_key` orders the three depths by date. Engine side - `library.facets` takes `month` and `day` beside `year`, counted like any other field; `year` stays the field the Date column asks for. - `library.facetPick` accepts a pick at any of the three depths, replaces `Filter::date` and clears `dateFrom`/`dateTo`; the no-value row and the date are the same column constraint, so a period pick clears it and picking it clears the period. `chosen` reports the picked depth only, so clicking the year or month above a picked day widens the filter instead of clearing it, and `without` leaves the column's own constraint out so the tree always offers what can be narrowed to. UI side - The Date column draws the tree (issue emmertex#1708): triangles open a year or a month, the picked row is marked at its depth, and the tree opens to the picked date and to what the search box finds. Rows answer to `filterDateRow:{column}:{date}`, triangles to `filterValueToggle:{column}:{date}`, in-row position still to `filterValue:{column}:{index}`, so the ids don't move when the search changes what is shown. Tests - `lcc-catalog`: the three depths, partial captures, unreadable capture times, `date_key` accepted/rejected shapes, date sort keys. - `lcc-engine`: hostile values at every depth, year → month → day → widen → clear, range replacement, the Unknown row. - `lcc-ui-egui`: open the year, a month and a day, filter the grid by the day, widen to its month and year, clear with All, and the search box opening the tree to a day. Manual: docs/manual-site/src/content/docs/library/filters.mdx Not compiled here: this checkout has no Rust toolchain and no crate mirror, so the change is checked by reading, `git diff --check` and a tree-sitter parse of every touched file. `cargo xtask ci` is the first compile. Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1708
Problem
The filter bar's Date Metadata column filtered by capture year only: its field listed
2019,2020,2024… andlibrary.facetPickaccepted four digits and nothing else. A shoot whose photos span three days could not be narrowed to one of them, and the day/month were not reachable from any column.Change
One tree, one constraint:
year,monthanddayare the same capture time at three depths (2026,2026-05,2026-05-14), built fromdates::capture_start, so a time recorded only to the year or month counts as the first day of its period.crates/catalog/src/facets.rs):monthanddayjoinFIELDS(28,lcc_catalog::facets);date_key(field, value)checks a value per depth (real month and day, no0000);sort_keyorders the depths by date; a capture time the library could not have stored lists no value, so a column never offers a value a click would reject.crates/engine/src/cmd/facets.rs):library.facetscountsmonth/daylike any other field (yearis still the field the Date column asks for);library.facetPicktakes a pick at any depth, replacesFilter::dateand clearsdateFrom/dateTo. The no-value row and the date are the same column constraint (oneFilter::facetsentry underyear), so picking a period clears it and picking it clears the period.chosenreports the picked depth only — clicking the year above a picked day widens the filter instead of clearing it — andwithoutleaves the column's own constraint out, so the tree always offers what can still be narrowed to.crates/ui-egui/src/panels/filterbar.rs): the Date column draws year → month → day. Triangles open a year or a month, the picked row is marked at its depth, the tree opens to the picked date and to whatever the search box finds, and rows are announced (Expand/Collapse) for screen readers. Ids stay stable as the search changes the shown rows: rowsfilterDateRow:{column}:{date}, trianglesfilterValueToggle:{column}:{date}, in-row positionfilterValue:{column}:{index}.docs/manual-site/src/content/docs/library/filters.mdx(the Metadata columns bullet), parity rowLRC-LIB-FILTERBAR,docs/whats-new/2026-11-30-filter-by-day.md,docs/changelog/unreleased/2026-11-30-filter-by-day.md.Not in this PR: no change to the grid's date headers or the date sidebar (they already group by day), and no ⌘/⇧ multi-value picking of dates — one period at a time, which is what a capture time is. That is #1755's ground and is being kept separate.
How it was checked
cargo xtask ci --fast,cargo xtask silandcargo test -pfor the touched crates pass on this branchmain(see Merging) — needs a rebase ontob43916d2before any check can runNot compiled. This checkout has no Rust toolchain and no crate mirror (only pypi/npm/GitHub reachable), so nothing here has been built. It is checked by reading,
git diff --check, and a tree-sitter parse of every touched file (0 syntax errors). CI is the first compile, and CI will not even reach the tests until the branch is rebased (see Merging). The tests written for it:lcc-catalog—the_date_column_lists_the_year_the_month_and_the_day(three depths,1983→1983-01-01, unreadable and doctored capture times),date_keys_are_validated_per_depth.lcc-engine—the_date_column_filters_by_year_month_and_day(hostile values at every depth, year → 3 photos → month → 2 → day → 1, widening, re-pick clears, range replaced, Unknown row swapped for a pick).lcc-ui-egui—the_date_column_opens_to_months_and_days_and_filters_by_them(triangles open the tree, a day filters the grid, the month and year widen it, All clears, the search box opens a folded month).Screenshots
Not available from this environment; the Date column with a year open, a month open and a day picked is the "after". Before, the same column listed years only.
Merging
emmertex/chromaforgePR #1708: filter Metadata Date column by year, month, and day #1738 ("Filtering by date only filters by year. #1708: filter Metadata Date column by year, month, and day", merged 2026-11-30 as71fa4517) is on upstreammain(b43916d2) — not onstaging, which is still at3f0e48aand has no date tree yet, though it does already carrylcc_catalog::date_groups_from. Upstream's shape is atreepayload thatlibrary.facetsreturns and the UI walks; ours assembles the tree in the UI from three facet lists (year/month/dayinlcc_catalog::facets::FIELDS) and keeps the pick a single column constraint. Both work; only one can live in the file. If the fork follows upstream, close this and hand-port #1708: filter Metadata Date column by year, month, and day #1738 perdocs/upstream-pr-intake.md. Fork PR Implemented Tauri alike auto updater #4 (Issue #777, draft) also touchescrates/catalog/src/facets.rs,crates/engine/src/cmd/facets.rsandcrates/ui-egui/src/panels/filterbar.rs.main@16e69e2;mainis nowb43916d2(398 commits on). Landing this means rebasing onto that tree first — the branch addsmonth/dayfacet fields where upstream instead grewFacetPickinto multi-valuevalues/modepicks plus thetreepayload, so the rebase is a re-implementation, not a resolution. 5 files conflict; the other 4 changed files (docs, parity row, notes) may apply cleanly.VERSIONuntouched:month/dayare computed facet fields, nothing new is stored), no saved setting or default. AFilter.dateset before this PR keeps working; it just now also renders the tree at its depth.dates::capture_start/partial_captureare the fork's existing date handling); no external data or profiles.unsafe, build scripts, network access, spawned processes, deleted files, CI orxtaskgate changes: none.Checklist
get, nounwrap/expectoutside tests)tr()and its keys (Expand,Collapse) are already in every catalogdocs/parity-checklist.mdrow updated (LRC-LIB-FILTERBAR)docs/manual-site/…/library/filters.mdx); no screenshot this change makes stale — the page's shots show the filter bar, not this column's tree🤖 Generated with Arena Agent