feat(timeline): open on three months unless the URL names a zoom

This commit is contained in:
Marc-André Bombeck committed 2026-10-11 13:40:19 +02:00
1 parent b7eef0dff4
commit 8cd6cf3c06
2 files changed
+26 -14

No files matched your search

+3 -3
View File
@@ -146,10 +146,10 @@ export function TimelineView() {
const canAddLifeEvent = !caps.inSharedRecord;
// The zoom and a chosen range live in the URL (`timeline-url.ts`), so Back
// and a bookmark return to them. Without a `zoom`, an incoming `?day=`
// opens three months around that day and anything else the whole record.
// and a bookmark return to them. Without a `zoom` the page opens on three
// months: around an incoming `?day=`, otherwise up to today.
const urlState = parseTimelineUrl(searchParams, today);
const zoom: TimelineZoom = urlState.zoom ?? (dayParam ? "quarter" : "all");
const zoom: TimelineZoom = urlState.zoom ?? "quarter";
const range = zoom === "range" ? urlState.range : null;
const [grouping, setGrouping] = useState<ChronicleGrouping>("month");
// The selection follows `?day=` (Back, Forward, the day panel's previous