Skip to content

YC (S26) | Open Computer History | Continuously record your company computer work, map your workflows, help you find work worth automating, and power your agents' context

fix(ui): calendar navigation to previously visited dates now works

Louis Beaumont6e69b4b9afe3
diff --git a/screenpipe-app-tauri/components/rewind/timeline.tsx b/screenpipe-app-tauri/components/rewind/timeline.tsx
index d23e08743..1ea0d31a4 100644
--- a/screenpipe-app-tauri/components/rewind/timeline.tsx
+++ b/screenpipe-app-tauri/components/rewind/timeline.tsx
@@ -95,7 +95,7 @@ export default function Timeline() {
setShowAudioTranscript(true);
}, [currentIndex]);
- const { currentDate, setCurrentDate, fetchTimeRange, hasDateBeenFetched, loadingProgress, onWindowFocus, newFramesCount, lastFlushTimestamp, clearNewFramesCount } =
+ const { currentDate, setCurrentDate, fetchTimeRange, hasDateBeenFetched, loadingProgress, onWindowFocus, newFramesCount, lastFlushTimestamp, clearNewFramesCount, clearSentRequestForDate } =
useTimelineStore();
const { frames, isLoading, error, message, fetchNextDayData, websocket } =
@@ -578,6 +578,10 @@ export default function Timeline() {
// Set navigation flag to prevent frame-date sync from fighting
isNavigatingRef.current = true;
+ // Clear the sent request cache for this date to force a fresh fetch
+ // This ensures clicking on a date in the calendar always loads fresh data
+ clearSentRequestForDate(newDate);
+
try {
const checkFramesForDate = await hasFramesForDate(newDate);
diff --git a/screenpipe-app-tauri/lib/hooks/use-timeline-store.tsx b/screenpipe-app-tauri/lib/hooks/use-timeline-store.tsx
index ef7b540fb..933f78d16 100644
--- a/screenpipe-app-tauri/lib/hooks/use-timeline-store.tsx
+++ b/screenpipe-app-tauri/lib/hooks/use-timeline-store.tsx
@@ -55,6 +55,7 @@ interface TimelineState {
flushFrameBuffer: () => void;
onWindowFocus: () => void;
clearNewFramesCount: () => void;
+ clearSentRequestForDate: (date: Date) => void;
}
export const useTimelineStore = create<TimelineState>((set, get) => ({
@@ -77,6 +78,15 @@ export const useTimelineStore = create<TimelineState>((set, get) => ({
setCurrentDate: (date) => set({ currentDate: date }),
clearNewFramesCount: () => set({ newFramesCount: 0 }),
+ clearSentRequestForDate: (date: Date) => {
+ const dateKey = `${date.getDate()}-${date.getMonth()}-${date.getFullYear()}`;
+ set((state) => {
+ const newSentRequests = new Set(state.sentRequests);
+ newSentRequests.delete(dateKey);
+ return { sentRequests: newSentRequests };
+ });
+ },
+
hasDateBeenFetched: (date: Date) => {
const { sentRequests } = get();
const dateKey = `${date.getDate()}-${date.getMonth()}-${date.getFullYear()}`;