Skip to content

#1708: filter the Metadata Date column by year, month and day - #1767

Closed
1234destiny1234 wants to merge 1 commit into
emmertex:stagingfrom
1234destiny1234:arena/f8076244-lightcraft-classic
Closed

1234destiny1234 wants to merge 1 commit into
emmertex:stagingfrom
1234destiny1234:arena/f8076244-lightcraft-classic

Conversation

@1234destiny1234

@1234destiny1234 1234destiny1234 commented Dec 1, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #1708

⚠️ This PR cannot merge as it stands, and it answers an issue upstream has already closed.
main was force-updated to b43916d2 while this branch sat on 16e69e2; that tree already carries
upstream's fix for #1708 (PR #1738, merged 71fa4517). Against main this branch is CONFLICTING
in 5 files (crates/engine/src/cmd/facets.rs, crates/engine/src/tests_facets.rs,
crates/ui-egui/src/panels/filterbar.rs, crates/ui-egui/src/tests_filter_search.rs,
docs/manual-site/…/library/filters.mdx). Kept open as the fork-shaped alternative described below;
close it if upstream's shape is what the fork wants. See Merging.

Problem

The filter bar's Date Metadata column filtered by capture year only: its field listed 2019, 2020, 2024… and library.facetPick accepted 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, month and day are the same capture time at three depths (2026, 2026-05, 2026-05-14), built from dates::capture_start, so a time recorded only to the year or month counts as the first day of its period.

  • Catalog (crates/catalog/src/facets.rs): month and day join FIELDS (28, lcc_catalog::facets); date_key(field, value) checks a value per depth (real month and day, no 0000); sort_key orders 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.
  • Engine (crates/engine/src/cmd/facets.rs): library.facets counts month/day like any other field (year is still the field the Date column asks for); library.facetPick takes a pick at any depth, replaces Filter::date and clears dateFrom/dateTo. The no-value row and the date are the same column constraint (one Filter::facets entry under year), so picking a period clears it and picking it clears the period. chosen reports the picked depth only — clicking the year 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 still be narrowed to.
  • UI (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: rows filterDateRow:{column}:{date}, triangles filterValueToggle:{column}:{date}, in-row position filterValue:{column}:{index}.
  • Docs: docs/manual-site/src/content/docs/library/filters.mdx (the Metadata columns bullet), parity row LRC-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 sil and cargo test -p for the touched crates pass on this branch
  • A test that fails without this change (see below)
  • User-visible change: ran the app and looked at the result
  • Mergeable: the branch is 5 conflicted files behind main (see Merging) — needs a rebase onto b43916d2 before any check can run

Not 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

  • Overlap: ⚠️ the same issue, twice, in two shapes. emmertex/chromaforge PR #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 as 71fa4517) is on upstream main (b43916d2) — not on staging, which is still at 3f0e48a and has no date tree yet, though it does already carry lcc_catalog::date_groups_from. Upstream's shape is a tree payload that library.facets returns and the UI walks; ours assembles the tree in the UI from three facet lists (year/month/day in lcc_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 per docs/upstream-pr-intake.md. Fork PR Implemented Tauri alike auto updater #4 (Issue #777, draft) also touches crates/catalog/src/facets.rs, crates/engine/src/cmd/facets.rs and crates/ui-egui/src/panels/filterbar.rs.
  • Base and conflicts: branched from main @ 16e69e2; main is now b43916d2 (398 commits on). Landing this means rebasing onto that tree first — the branch adds month/day facet fields where upstream instead grew FacetPick into multi-value values/mode picks plus the tree payload, 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.
  • Existing edits and libraries: unchanged — no rendering, no catalog format (VERSION untouched: month/day are computed facet fields, nothing new is stored), no saved setting or default. A Filter.date set before this PR keeps working; it just now also renders the tree at its depth.
  • Shared numbers taken: none.
  • Where it came from: own design (dates::capture_start/partial_capture are the fork's existing date handling); no external data or profiles.
  • New dependencies, unsafe, build scripts, network access, spawned processes, deleted files, CI or xtask gate changes: none.

Checklist

  • No new panic path in non-test code (string slicing goes through get, no unwrap/expect outside tests)
  • New on-screen text goes through tr() and its keys (Expand, Collapse) are already in every catalog
  • docs/parity-checklist.md row updated (LRC-LIB-FILTERBAR)
  • User-visible change: manual page updated (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
  • New code has a caller: the commands are the UI's own; no dead module or setting
  • No new image, icon, font or media asset

🤖 Generated with Arena Agent

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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Filtering by date only filters by year.

1 participant