remember last selected history sidebar tab (#24488)
CI / AMD64 Build (push) Canceled after 0s
CI / AMD64 Smoke Test (push) Canceled after 0s
CI / ARM Build (push) Canceled after 0s
CI / Jetson Jetpack 6 (push) Canceled after 0s
CI / AMD64 Extra Build (push) Canceled after 0s
CI / ARM Extra Build (push) Canceled after 0s
CI / Synaptics Build (push) Canceled after 0s
CI / Assemble and push default build (push) Canceled after 0s

The History view always opened on Timeline unless the link carried a tab. The selected tab is now saved with useUserPersistence and used as the default when no tab is passed. Notification and shared review links no longer default to "timeline", so they pick up the saved tab too, and `?tab=` still overrides it.
This commit is contained in:
Josh Hawkins
2026-09-27 17:21:46 -06:00
committed by GitHub
parent 0977fa5e15
commit f9a37d4f4f
2 changed files with 14 additions and 4 deletions
+1 -2
View File
@@ -132,8 +132,7 @@ export default function Events() {
setMotionSearchDay(normalizedDay);
}, []);
const [notificationTab, setNotificationTab] =
useState<TimelineType>("timeline");
const [notificationTab, setNotificationTab] = useState<TimelineType>();
const getReviewDayBounds = useCallback((date: Date) => {
const now = Date.now() / 1000;
+13 -2
View File
@@ -14,6 +14,7 @@ import { Button } from "@/components/ui/button";
import { ToggleGroup, ToggleGroupItem } from "@/components/ui/toggle-group";
import { useOverlayState } from "@/hooks/use-overlay-state";
import { usePersistence } from "@/hooks/use-persistence";
import { useUserPersistence } from "@/hooks/use-user-persistence";
import { useResizeObserver } from "@/hooks/resize-observer";
import { DEFAULT_DRAWER_FEATURES, ExportMode } from "@/types/filter";
import { FrigateConfig } from "@/types/frigateConfig";
@@ -182,9 +183,19 @@ export function RecordingView({
false,
);
const [timelineType, setTimelineType] = useOverlayState<TimelineType>(
const [savedTimelineType, setSavedTimelineType] =
useUserPersistence<TimelineType>("recordingTimelineType");
const [timelineType, setOverlayTimelineType] = useOverlayState<TimelineType>(
"timelineType",
recording?.timelineType ?? "timeline",
recording?.timelineType ?? savedTimelineType ?? "timeline",
);
const setTimelineType = useCallback(
(value: TimelineType, replace?: boolean) => {
setOverlayTimelineType(value, replace);
setSavedTimelineType(value);
},
[setOverlayTimelineType, setSavedTimelineType],
);
const chunkedTimeRange = useMemo(