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(timeline): empty-state arrow buttons navigated in the wrong direction

Louis Beaumontb628048a22dd
diff --git a/apps/screenpipe-app-tauri/components/rewind/timeline.tsx b/apps/screenpipe-app-tauri/components/rewind/timeline.tsx
index d94415534..e83dbbcf2 100644
--- a/apps/screenpipe-app-tauri/components/rewind/timeline.tsx
+++ b/apps/screenpipe-app-tauri/components/rewind/timeline.tsx
@@ -1077,10 +1077,12 @@ export default function Timeline({ embedded = false }: { embedded?: boolean }) {
isArrowNav={isArrowNav}
adjacentFrames={frames.slice(Math.max(0, currentIndex - 3), currentIndex + 4).filter(Boolean)}
onNavigate={(direction) => {
- // newer = lower index (-1), older = higher index (+1)
+ // frames are sorted newest-first: newer = lower index (-1),
+ // older = higher index (+1). Match the keyboard convention
+ // (ArrowLeft = prev = older, ArrowRight = next = newer).
const newIndex = direction === "next"
- ? findNextDevice(currentIndex, 1)
- : findNextDevice(currentIndex, -1);
+ ? findNextDevice(currentIndex, -1)
+ : findNextDevice(currentIndex, 1);
setCurrentIndex(newIndex);
if (frames[newIndex]) {
setCurrentFrame(frames[newIndex]);