Skip to content

Sidebar Dates filter: show a file when any of its dates is in the range - #270

Merged
charpy4n6 merged 2 commits into
mainfrom
feat/any-date-filter
Oct 9, 2026
Merged

charpy4n6 merged 2 commits into
mainfrom
feat/any-date-filter

Conversation

@charpy4n6

@charpy4n6 charpy4n6 commented Oct 8, 2026 •

Copy link
Copy Markdown
Collaborator

What

A Dates section in the sidebar, with From / To and an Include files with no dates checkbox. Like every other sidebar filter, it applies in both the gallery and the list. The list's per-column date filters apply only in the list.

A file is shown when any of its dates falls in the range, both days included:

  • Captured (EXIF)
  • FS created
  • FS written
  • FS accessed
  • Recorded (as stored)

Either end of the range can be left empty. Ingested is not one of the dates.

Include files with no dates:

  • with a range set, it adds every file that has none of those five dates
  • with no range set, it shows only those files
  • a 0 or an empty value counts as no date, because the columns show it blank

How the dates are compared

  • Filesystem times are instants. The page works out the day bounds in the display time zone with zonedDayEpoch, as the list's date filters already do. It sends the first day's start and the start of the day after the last day, and the server compares with >= and <. Without those bounds, the server reads the days in UTC.
  • EXIF capture time and FAT/exFAT readings (recorded_times) have no time zone, so they're compared on the date as written, which is what their columns show. recorded_times goes through json_each behind json_valid, so a value that isn't JSON can't fail the query.
  • The filter is applied to each file before duplicates are collapsed. With collapsing on, the gallery shows one tile per group that has a matching file, so its count can be lower than the list's.

The chip, the section dot, the chip's ✕ and Clear work as they do for the other sidebar filters. docs/MANUAL.md and help.html describe the section.

Testing

  • tests/test_any_date_filter.py, 8 tests:
    • one file per kind of date, plus files outside the range
    • the display-zone shift: in UTC-4, a file stamped 00:00 UTC on June 1 falls on May 31
    • a range open at either end
    • a malformed day
    • the no-dates checkbox with and without a range
    • a blank value under a range open at the start
  • Full suite locally on Windows, Python 3.12: 948 passed, 6 skipped.
    • An earlier run, before the checkbox, had one failure that its summary didn't name. The next run passed all 945, so I couldn't say which test it was.
  • tools/lint_changed.py: no new warnings. Line endings: all LF.
  • In the browser on a synthetic scratch case:
    • a range narrowed 12 tiles to the 3 files whose one in-range date was the FS written time, the EXIF capture time or a FAT reading
    • in America/New_York, the request's bounds moved to 04:00 UTC
  • The range filter, before the checkbox, was built into the Windows exe and tried by the requester on their own case. The checkbox is in a Windows exe build that hasn't been tried on that case yet.

🤖 Generated with Claude Code

charpy4n6 and others added 2 commits October 8, 2026 17:44
The list's per-column date filters apply only in the list view. The new
Dates section (From / To) in the sidebar applies in the gallery and the list
alike, and matches a file when any one of its dates falls in the range, both
days included: Captured (EXIF), FS created, FS written, FS accessed, or
Recorded (as stored). Either end can be left open.

- the filesystem times are instants: the page works out the day bounds in
  the display time zone (zonedDayEpoch, as the list's date filters do) and
  sends the start of the day after the last one as the upper bound
- the EXIF capture time and a FAT or exFAT volume's as-stored readings carry
  no zone, so they are compared on the date as written, which is what their
  columns show; recorded_times goes through json_each behind json_valid
- Ingested is not one of the dates
- chip, section dot and Clear like every other sidebar filter
- MANUAL.md and help.html describe it

Co-Authored-By: Claude Opus 5.5 <[email protected]>
A checkbox under From / To. With a range set it adds every file that has
none of the five dates (Captured (EXIF), FS created, written, accessed,
Recorded (as stored)); with no range set it shows only those files. A 0 or
an empty value counts as no date, as the columns show it blank, and the
range itself no longer matches one: an instant of 0 used to fall inside a
range left open at the start.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@charpy4n6
charpy4n6 merged commit 3dc2334 into main Oct 9, 2026
8 checks passed
@charpy4n6
charpy4n6 deleted the feat/any-date-filter branch October 17, 2026 22:16
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.

1 participant