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: smooth scrolling with monitor filter + visual bar indicators

Louis Beaumonta69bc132a572
diff --git a/apps/screenpipe-app-tauri/components/rewind/timeline.tsx b/apps/screenpipe-app-tauri/components/rewind/timeline.tsx
index ebed9a2ab..c50e1e0ae 100644
--- a/apps/screenpipe-app-tauri/components/rewind/timeline.tsx
+++ b/apps/screenpipe-app-tauri/components/rewind/timeline.tsx
@@ -256,21 +256,6 @@ export default function Timeline({ embedded = false }: { embedded?: boolean }) {
}
}, [lastFlushTimestamp, newFramesCount, isAtLiveEdge, frames.length, clearNewFramesCount]);
- // Auto-snap: when currentIndex lands on a non-matching device frame (e.g. from
- // audio playback advancing), snap to the nearest matching frame.
- useEffect(() => {
- if (selectedDeviceId === "all" || allDeviceIds.length <= 1) return;
- if (frames.length === 0) return;
- const frame = frames[currentIndex];
- if (!frame) return;
- if (frame.devices.some((d) => d.device_id === selectedDeviceId)) return;
- const snapped = snapToDevice(currentIndex);
- if (snapped !== currentIndex) {
- setCurrentIndex(snapped);
- setCurrentFrame(frames[snapped]);
- }
- }, [currentIndex, selectedDeviceId, allDeviceIds.length, frames, snapToDevice, setCurrentFrame]);
-
// Listen for window focus events to refresh timeline data (debounced)
useEffect(() => {
let debounceTimer: ReturnType<typeof setTimeout> | null = null;
@@ -1029,11 +1014,10 @@ export default function Timeline({ embedded = false }: { embedded?: boolean }) {
requestAnimationFrame(() => {
setCurrentIndex((prevIndex) => {
- const raw = Math.min(
+ const newIndex = Math.min(
Math.max(0, Math.floor(prevIndex + indexChange)),
frames.length - 1,
);
- const newIndex = snapToDevice(raw);
if (newIndex !== prevIndex && frames[newIndex]) {
setCurrentFrame(frames[newIndex]);
@@ -1047,7 +1031,7 @@ export default function Timeline({ embedded = false }: { embedded?: boolean }) {
{ leading: true, trailing: false },
),
// eslint-disable-next-line react-hooks/exhaustive-deps
- [frames, zoomLevel, pausePlayback, snapToDevice], // Re-create when zoom changes
+ [frames, zoomLevel, pausePlayback], // Re-create when zoom changes
);
// Attach scroll/zoom handler so pinch-to-zoom and scroll-to-navigate work.
@@ -1677,6 +1661,7 @@ export default function Timeline({ embedded = false }: { embedded?: boolean }) {
onAskAI={sendSelectionToChat}
isPlaying={isPlaying}
onTogglePlayPause={togglePlayPause}
+ selectedDeviceId={selectedDeviceId}
/>
) : (
<div className="bg-card/80 backdrop-blur-sm p-4 border-t border-border">
diff --git a/apps/screenpipe-app-tauri/components/rewind/timeline/timeline.tsx b/apps/screenpipe-app-tauri/components/rewind/timeline/timeline.tsx
index 9b99bf7ca..147c84181 100644
--- a/apps/screenpipe-app-tauri/components/rewind/timeline/timeline.tsx
+++ b/apps/screenpipe-app-tauri/components/rewind/timeline/timeline.tsx
@@ -62,6 +62,7 @@ interface TimelineSliderProps {
onAskAI?: () => void;
isPlaying?: boolean; // Whether audio playback is active
onTogglePlayPause?: () => void; // Toggle audio playback (Space key)
+ selectedDeviceId?: string; // "all" or a specific device_id — dims non-matching bars
}
interface AppGroup {
@@ -177,6 +178,7 @@ export const TimelineSlider = ({
onAskAI,
isPlaying = false,
onTogglePlayPause,
+ selectedDeviceId = "all",
}: TimelineSliderProps) => {
const containerRef = useRef<HTMLDivElement>(null);
const observerTargetRef = useRef<HTMLDivElement>(null);
@@ -792,6 +794,7 @@ export const TimelineSlider = ({
const hasAudio = Boolean(frame?.devices?.[0]?.audio?.length);
const isCurrent = frameIndex === currentIndex;
+ const matchesDevice = selectedDeviceId === "all" || frame.devices.some((d) => d.device_id === selectedDeviceId);
// Show time marker on first frame of each hour
const showTimeMarker = timeMarkers.some(
@@ -825,7 +828,8 @@ export const TimelineSlider = ({
marginRight: `${frameMargin}px`,
backgroundColor: isCurrent ? 'hsl(var(--foreground))' : hasAudio ? 'hsl(var(--foreground))' : group.color,
height: isCurrent || isSelected || isInRange ? "75%" : hasAudio ? "60%" : "45%",
- opacity: isCurrent || isSelected || isInRange ? 1 : hasAudio ? 0.9 : 0.7,
+ opacity: !matchesDevice ? 0.15 : isCurrent || isSelected || isInRange ? 1 : hasAudio ? 0.9 : 0.7,
+ borderBottom: matchesDevice && selectedDeviceId !== "all" ? '2px solid hsl(var(--primary))' : 'none',
direction: "ltr",
boxShadow: isCurrent
? isPlaying