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: suppress loading blocker during navigation, prevent double-click

Louis Beaumont56814d1ef8de
diff --git a/apps/screenpipe-app-tauri/components/rewind/timeline.tsx b/apps/screenpipe-app-tauri/components/rewind/timeline.tsx
index cb1f1bc73..f15613ac7 100644
--- a/apps/screenpipe-app-tauri/components/rewind/timeline.tsx
+++ b/apps/screenpipe-app-tauri/components/rewind/timeline.tsx
@@ -487,9 +487,11 @@ export default function Timeline({ embedded = false }: { embedded?: boolean }) {
return () => clearTimeout(timer);
}, [seekingTimestamp, setPendingNavigation]);
- // Progressive loading: show UI immediately once we have any frames
+ // Progressive loading: show UI immediately once we have any frames.
+ // During navigation, frames are cleared but we DON'T show the full-screen
+ // blocker — the inline spinner on the date control is enough feedback.
const hasInitialFrames = frames.length > 0;
- const showBlockingLoader = isLoading && !hasInitialFrames;
+ const showBlockingLoader = isLoading && !hasInitialFrames && !isNavigating;
// Auto-select first frame when frames arrive and no frame is selected
@@ -1118,6 +1120,9 @@ export default function Timeline({ embedded = false }: { embedded?: boolean }) {
};
const handleDateChange = async (newDate: Date) => {
+ // Guard against double-click / re-entry while navigation is in progress
+ if (isNavigatingRef.current) return;
+
// Pause playback on date change
pausePlayback();
diff --git a/apps/screenpipe-app-tauri/lib/hooks/use-timeline-store.tsx b/apps/screenpipe-app-tauri/lib/hooks/use-timeline-store.tsx
index 3cb4caa07..63d65dedd 100644
--- a/apps/screenpipe-app-tauri/lib/hooks/use-timeline-store.tsx
+++ b/apps/screenpipe-app-tauri/lib/hooks/use-timeline-store.tsx
@@ -148,16 +148,18 @@ export const useTimelineStore = create<TimelineState>((set, get) => ({
requestTimeoutTimer = null;
}
requestRetryCount = 0;
- // Keep existing frames visible to avoid the full-screen "Loading Timeline"
- // blocker. The pendingNavigation effect in timeline.tsx filters by target
- // date to find the right frame once new data arrives.
- // Clear frameTimestamps so incoming frames from the new date aren't
- // rejected as duplicates if they somehow share timestamps with old frames.
- set((state) => ({
+ // Clear frames + timestamps so:
+ // 1) request timeout logic correctly sees "no frames" and retries
+ // 2) pendingNavigation effect triggers on first batch from new date
+ // 3) no stale old-date frames confuse the frame selection
+ // The full-screen "Loading Timeline" blocker is suppressed during
+ // navigation by the isNavigating flag in timeline.tsx.
+ set(() => ({
+ frames: [],
frameTimestamps: new Set<string>(),
sentRequests: new Set<string>(),
isLoading: true,
- loadingProgress: { loaded: state.frames.length, isStreaming: false },
+ loadingProgress: { loaded: 0, isStreaming: false },
error: null,
message: "loading...",
}));