Month times jumped back and forth. The Month sort keyed on the display day only. The sort is stable, so a day's photos kept DB order, merged across libraries, and the displayed times jumped around (FileViewer renders server order as-is). Month now sorts like Week: full date, then timestamp, undated items last.
The Week sort test tested nothing.test_week_span_sorting_chronological_by_day sorted its own inline copy (day-of-month across years). 7d2a314 later made the real Week sort chronological (full date, then time) on purpose, but the test kept passing on its copy and disagreed with production.
The sort moves into sort_memories(&mut [(MemoryItem, NaiveDate)], MemoriesSpan); Month and Week share one arm, and the created comparison is written once.
Tests now call sort_memories for every span:
month_span_sorts_by_time_within_a_day: one day, two libraries, out of DB order, plus an undated item (fails on the old sort)
week_span_sorts_by_full_date_then_time: replaces the stale test; years group, time breaks same-day ties
day_span_sorts_by_timestamp_across_years: same calendar day across years, undated last
Note
Within a day the key is the true instant (created), not the displayed wall clock, same as Week/Day already were. They agree except when one day mixes photos from different time zones.
Verification
cargo fmt, cargo clippy --all-targets (0 warnings), cargo test --no-fail-fast: green apart from the known prefs::tests::put_prefs_* flake (passes in isolation; tracked separately).
## Summary
**Month times jumped back and forth.** The Month sort keyed on the display day only. The sort is stable, so a day's photos kept DB order, merged across libraries, and the displayed times jumped around (FileViewer renders server order as-is). Month now sorts like Week: full date, then timestamp, undated items last.
**The Week sort test tested nothing.** `test_week_span_sorting_chronological_by_day` sorted its own inline copy (day-of-month across years). 7d2a314 later made the real Week sort chronological (full date, then time) on purpose, but the test kept passing on its copy and disagreed with production.
- The sort moves into `sort_memories(&mut [(MemoryItem, NaiveDate)], MemoriesSpan)`; Month and Week share one arm, and the `created` comparison is written once.
- Tests now call `sort_memories` for every span:
- `month_span_sorts_by_time_within_a_day`: one day, two libraries, out of DB order, plus an undated item (fails on the old sort)
- `week_span_sorts_by_full_date_then_time`: replaces the stale test; years group, time breaks same-day ties
- `day_span_sorts_by_timestamp_across_years`: same calendar day across years, undated last
## Note
Within a day the key is the true instant (`created`), not the displayed wall clock, same as Week/Day already were. They agree except when one day mixes photos from different time zones.
## Verification
`cargo fmt`, `cargo clippy --all-targets` (0 warnings), `cargo test --no-fail-fast`: green apart from the known `prefs::tests::put_prefs_*` flake (passes in isolation; tracked separately).
🤖 Generated with [Claude Code](https://claude.com/claude-code)
The Month sort keyed on the display day only. The sort is stable, so a
day's photos kept DB order, merged across libraries, and their times
jumped back and forth. Month now sorts like Week: full date, then
timestamp (undated items last).
The sort moves into sort_memories so it can be tested directly; the new
test covers a multi-library, out-of-order day.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
test_week_span_sorting_chronological_by_day sorted its own inline copy
(day-of-month across years), so it kept passing after 7d2a314 made the
real Week sort chronological (full date, then time), and it disagreed
with production. Replace it with a test that calls sort_memories, and
add one for Day, so all three spans are pinned against the real sort.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Summary
Month times jumped back and forth. The Month sort keyed on the display day only. The sort is stable, so a day's photos kept DB order, merged across libraries, and the displayed times jumped around (FileViewer renders server order as-is). Month now sorts like Week: full date, then timestamp, undated items last.
The Week sort test tested nothing.
test_week_span_sorting_chronological_by_daysorted its own inline copy (day-of-month across years).7d2a314later made the real Week sort chronological (full date, then time) on purpose, but the test kept passing on its copy and disagreed with production.sort_memories(&mut [(MemoryItem, NaiveDate)], MemoriesSpan); Month and Week share one arm, and thecreatedcomparison is written once.sort_memoriesfor every span:month_span_sorts_by_time_within_a_day: one day, two libraries, out of DB order, plus an undated item (fails on the old sort)week_span_sorts_by_full_date_then_time: replaces the stale test; years group, time breaks same-day tiesday_span_sorts_by_timestamp_across_years: same calendar day across years, undated lastNote
Within a day the key is the true instant (
created), not the displayed wall clock, same as Week/Day already were. They agree except when one day mixes photos from different time zones.Verification
cargo fmt,cargo clippy --all-targets(0 warnings),cargo test --no-fail-fast: green apart from the knownprefs::tests::put_prefs_*flake (passes in isolation; tracked separately).🤖 Generated with Claude Code