revert: drop By Date sidebar node and supporting code

Tried it, didn't add value beyond what the date-grouped timeline
already gives. The grouped, sticky-headered timeline (which kicks
in by default whenever sortBy is taken_at) is the better
affordance for date navigation — duplicating that as a sidebar
drilldown was just clutter.

Removes the full stack:
- LeftSidebar: by-date tree node, byDateChildren computation,
  date-year-/date-month- handlers in applyLibraryNode, isItemActive
  branches that matched a date-range filter, the now-unused
  setDateFrom/setDateTo/filterDateFrom/filterDateTo selectors, and
  the Calendar icon import.
- frontend/src/hooks/useDateBucketsQuery.ts deleted entirely.
- api.ts: library.dateBuckets helper and DateBucketYear/Month types.
- backend/app/routers/library.py: GET /library/date_buckets endpoint
  and its strftime aggregation query.

The dateFrom/dateTo filter state stays in filterStore — the
FilterBar still uses it for the "Date" range inputs.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-08 00:19:59 +02:00
parent 7d33e1688a
commit a0c41e38d3
4 changed files with 1 additions and 135 deletions

View File

@@ -1,12 +0,0 @@
import { useQuery } from '@tanstack/react-query'
import { library, type DateBucketYear } from '../services/api'
export const DATE_BUCKETS_QUERY_KEY = ['library', 'date_buckets'] as const
export function useDateBucketsQuery() {
return useQuery<DateBucketYear[]>({
queryKey: DATE_BUCKETS_QUERY_KEY,
queryFn: library.dateBuckets,
staleTime: 60_000,
})
}