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

feat(timeline): friendly empty state + auto-skip unavailable frames

Louis Beaumont08b503b4fcfa
diff --git a/screenpipe-app-tauri/components/rewind/current-frame-timeline.tsx b/screenpipe-app-tauri/components/rewind/current-frame-timeline.tsx
index fb7a6e629..94e592aa7 100644
--- a/screenpipe-app-tauri/components/rewind/current-frame-timeline.tsx
+++ b/screenpipe-app-tauri/components/rewind/current-frame-timeline.tsx
@@ -2,13 +2,14 @@ import { StreamTimeSeriesResponse } from "@/components/rewind/timeline";
import React, { FC, useState, useRef } from "react";
import { useFrameOcrData } from "@/lib/hooks/use-frame-ocr-data";
import { TextOverlay } from "@/components/text-overlay";
-import { FileX, ImageOff, RefreshCw, ChevronLeft, ChevronRight } from "lucide-react";
+import { ImageOff, ChevronLeft, ChevronRight, Loader2 } from "lucide-react";
interface CurrentFrameTimelineProps {
currentFrame: StreamTimeSeriesResponse;
onNavigate?: (direction: "prev" | "next") => void;
canNavigatePrev?: boolean;
canNavigateNext?: boolean;
+ onFrameUnavailable?: () => void;
}
export const SkeletonLoader: FC = () => {
@@ -30,6 +31,7 @@ export const CurrentFrameTimeline: FC<CurrentFrameTimelineProps> = ({
onNavigate,
canNavigatePrev = true,
canNavigateNext = true,
+ onFrameUnavailable,
}) => {
const [isLoading, setIsLoading] = useState(true);
const [hasError, setHasError] = useState(false);
@@ -114,6 +116,17 @@ export const CurrentFrameTimeline: FC<CurrentFrameTimelineProps> = ({
}
};
+ // Auto-skip to next frame when error occurs
+ React.useEffect(() => {
+ if (hasError && !isLoading && onFrameUnavailable) {
+ // Small delay to avoid rapid skipping
+ const timer = setTimeout(() => {
+ onFrameUnavailable();
+ }, 300);
+ return () => clearTimeout(timer);
+ }
+ }, [hasError, isLoading, onFrameUnavailable]);
+
if (!frameId) {
return (
<div className="absolute inset-0 overflow-hidden bg-background">
@@ -229,73 +242,14 @@ export const CurrentFrameTimeline: FC<CurrentFrameTimelineProps> = ({
</div>
</div>
)}
+ {/* When frame is unavailable, show skeleton while auto-skipping */}
{hasError && !isLoading && (
- <div className="absolute inset-0 z-10 overflow-hidden bg-background">
+ <div className="absolute inset-0 z-10">
+ <SkeletonLoader />
<div className="absolute inset-0 flex items-center justify-center">
- <div className="max-w-sm w-full mx-4">
- <div className="bg-card border border-border p-8">
- <div className="flex justify-center mb-6">
- <div className="w-16 h-16 border border-destructive/50 flex items-center justify-center">
- <FileX className="w-8 h-8 text-destructive" />
- </div>
- </div>
-
- <div className="text-center space-y-3">
- <h3 className="text-xl font-mono font-semibold text-foreground uppercase tracking-wide">
- Frame Unavailable
- </h3>
- <p className="text-sm font-mono text-muted-foreground leading-relaxed">
- This recording could not be loaded. The video file may be temporarily unavailable or still processing.
- </p>
-
- <div className="inline-flex items-center gap-2 px-3 py-1.5 bg-muted border border-border">
- <span className="text-xs font-mono text-muted-foreground uppercase">Frame</span>
- <span className="text-xs font-mono text-foreground">{frameId}</span>
- </div>
- </div>
-
- <div className="mt-8 space-y-3">
- {retryCount < 3 ? (
- <button
- onClick={handleRetry}
- className="w-full flex items-center justify-center gap-2 px-4 py-3 bg-background hover:bg-accent border border-border text-foreground text-sm font-mono uppercase transition-colors"
- >
- <RefreshCw className="w-4 h-4" />
- Try Again
- <span className="text-muted-foreground text-xs">({3 - retryCount} left)</span>
- </button>
- ) : (
- <div className="text-center text-sm font-mono text-muted-foreground py-2 uppercase">
- Retries exhausted
- </div>
- )}
-
- {onNavigate && (
- <div className="flex gap-2">
- <button
- onClick={() => onNavigate("prev")}
- disabled={!canNavigatePrev}
- className="flex-1 flex items-center justify-center gap-2 px-4 py-3 bg-background hover:bg-accent disabled:opacity-30 disabled:cursor-not-allowed border border-border text-foreground text-sm font-mono uppercase transition-colors"
- >
- <ChevronLeft className="w-4 h-4" />
- Previous
- </button>
- <button
- onClick={() => onNavigate("next")}
- disabled={!canNavigateNext}
- className="flex-1 flex items-center justify-center gap-2 px-4 py-3 bg-background hover:bg-accent disabled:opacity-30 disabled:cursor-not-allowed border border-border text-foreground text-sm font-mono uppercase transition-colors"
- >
- Next
- <ChevronRight className="w-4 h-4" />
- </button>
- </div>
- )}
- </div>
- </div>
-
- <p className="text-center text-xs font-mono text-muted-foreground mt-4">
- If this persists, try restarting the screenpipe server
- </p>
+ <div className="flex items-center gap-2 px-4 py-2 bg-card/90 backdrop-blur-sm rounded-lg border border-border">
+ <Loader2 className="w-4 h-4 animate-spin text-muted-foreground" />
+ <span className="text-sm text-muted-foreground">Finding next frame...</span>
</div>
</div>
</div>
diff --git a/screenpipe-app-tauri/components/rewind/image-card.tsx b/screenpipe-app-tauri/components/rewind/image-card.tsx
index d75d85e93..6eda8caa0 100644
--- a/screenpipe-app-tauri/components/rewind/image-card.tsx
+++ b/screenpipe-app-tauri/components/rewind/image-card.tsx
@@ -57,9 +57,8 @@ const FrameImage = ({ frameId, alt }: { frameId: number; alt: string }) => {
</div>
)}
{hasError ? (
- <div className="absolute inset-0 flex flex-col items-center justify-center bg-muted gap-1">
- <ImageOff className="h-5 w-5 text-muted-foreground" />
- <span className="text-xs text-muted-foreground">frame unavailable</span>
+ <div className="absolute inset-0 flex items-center justify-center bg-muted/50">
+ <div className="w-8 h-8 rounded bg-muted/80" />
</div>
) : (
<img
diff --git a/screenpipe-app-tauri/components/rewind/timeline.tsx b/screenpipe-app-tauri/components/rewind/timeline.tsx
index 19ff9a26d..523d67f60 100644
--- a/screenpipe-app-tauri/components/rewind/timeline.tsx
+++ b/screenpipe-app-tauri/components/rewind/timeline.tsx
@@ -1,6 +1,6 @@
"use client";
import { useEffect, useState, useRef, useMemo, useCallback } from "react";
-import { Loader2, RotateCcw, AlertCircle, X } from "lucide-react";
+import { Loader2, RotateCcw, AlertCircle, X, Sparkles } from "lucide-react";
import { SearchModal } from "@/components/rewind/search-modal";
import { commands } from "@/lib/utils/tauri";
import { listen, emit } from "@tauri-apps/api/event";
@@ -757,13 +757,59 @@ export default function Timeline() {
}}
canNavigatePrev={currentIndex > 0}
canNavigateNext={currentIndex < frames.length - 1}
+ onFrameUnavailable={() => {
+ // Auto-skip to next available frame
+ if (currentIndex < frames.length - 1) {
+ const newIndex = currentIndex + 1;
+ setCurrentIndex(newIndex);
+ if (frames[newIndex]) {
+ setCurrentFrame(frames[newIndex]);
+ }
+ } else if (currentIndex > 0) {
+ // If at end, try previous
+ const newIndex = currentIndex - 1;
+ setCurrentIndex(newIndex);
+ if (frames[newIndex]) {
+ setCurrentFrame(frames[newIndex]);
+ }
+ }
+ }}
/>
) : !showBlockingLoader && !error && frames.length === 0 && !isLoading ? (
- <div className="absolute inset-0 flex items-center justify-center bg-background/90">
- <div className="text-center text-foreground p-8">
- <h3 className="text-lg font-medium mb-2">No Frame Available</h3>
- <p className="text-sm text-muted-foreground">
- No frames found for this date
+ <div className="absolute inset-0 flex items-center justify-center bg-gradient-to-b from-background via-background to-muted/20">
+ <div className="text-center p-8 max-w-md">
+ {/* Animated icon */}
+ <div className="relative mx-auto mb-8 w-24 h-24">
+ {/* Pulsing rings */}
+ <div className="absolute inset-0 rounded-full border-2 border-primary/20 animate-ping" style={{ animationDuration: '3s' }} />
+ <div className="absolute inset-2 rounded-full border-2 border-primary/30 animate-ping" style={{ animationDuration: '3s', animationDelay: '0.5s' }} />
+ <div className="absolute inset-4 rounded-full border-2 border-primary/40 animate-ping" style={{ animationDuration: '3s', animationDelay: '1s' }} />
+ {/* Center icon */}
+ <div className="absolute inset-0 flex items-center justify-center">
+ <div className="w-16 h-16 rounded-full bg-primary/10 border border-primary/30 flex items-center justify-center">
+ <Sparkles className="w-8 h-8 text-primary animate-pulse" />
+ </div>
+ </div>
+ </div>
+
+ <h3 className="text-xl font-semibold text-foreground mb-3">
+ Building Your Memory
+ </h3>
+ <p className="text-muted-foreground mb-6 leading-relaxed">
+ Screenpipe is recording your screen activity. Your timeline will appear here as frames are captured.
+ </p>
+
+ {/* Friendly suggestion */}
+ <div className="inline-flex items-center gap-2 px-4 py-2 bg-muted/50 rounded-full border border-border text-sm text-muted-foreground">
+ <span className="relative flex h-2 w-2">
+ <span className="animate-ping absolute inline-flex h-full w-full rounded-full bg-green-400 opacity-75"></span>
+ <span className="relative inline-flex rounded-full h-2 w-2 bg-green-500"></span>
+ </span>
+ Recording in progress
+ </div>
+
+ <p className="text-xs text-muted-foreground mt-6">
+ Check back in a few minutes
</p>
</div>
</div>
@@ -930,7 +976,13 @@ export default function Timeline() {
) : error ? (
<div className="text-destructive text-center">Failed to load timeline data</div>
) : (
- <div className="text-center">No timeline data available for this date</div>
+ <div className="text-center text-muted-foreground flex items-center justify-center gap-2">
+ <span className="relative flex h-2 w-2">
+ <span className="animate-ping absolute inline-flex h-full w-full rounded-full bg-green-400 opacity-75"></span>
+ <span className="relative inline-flex rounded-full h-2 w-2 bg-green-500"></span>
+ </span>
+ Recording... timeline will appear soon
+ </div>
)}
</div>
</div>