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): show export video button when selection is active

Louis Beaumontcfa1c3703a47
diff --git a/screenpipe-app-tauri/components/rewind/export-button.tsx b/screenpipe-app-tauri/components/rewind/export-button.tsx
index 8f75bf5dd..0299211f7 100644
--- a/screenpipe-app-tauri/components/rewind/export-button.tsx
+++ b/screenpipe-app-tauri/components/rewind/export-button.tsx
@@ -1,8 +1,8 @@
import { useState } from "react";
-import { Button } from "./ui/button";
+import { Button } from "@/components/ui/button";
import { Loader2, Video } from "lucide-react";
import { useTimelineSelection } from "@/lib/hooks/use-timeline-selection";
-import { toast } from "./ui/use-toast";
+import { toast } from "@/components/ui/use-toast";
import { useSettings } from "@/lib/hooks/use-settings";
import { parseInt } from "lodash";
import posthog from "posthog-js";
diff --git a/screenpipe-app-tauri/components/rewind/timeline/timeline-controls.tsx b/screenpipe-app-tauri/components/rewind/timeline/timeline-controls.tsx
index ab5e94687..ac8a0874d 100644
--- a/screenpipe-app-tauri/components/rewind/timeline/timeline-controls.tsx
+++ b/screenpipe-app-tauri/components/rewind/timeline/timeline-controls.tsx
@@ -13,6 +13,8 @@ import { cn } from "@/lib/utils";
import { motion, AnimatePresence } from "framer-motion";
import { useMemo } from "react";
import { usePlatform } from "@/lib/hooks/use-platform";
+import { useTimelineSelection } from "@/lib/hooks/use-timeline-selection";
+import { ExportButton } from "@/components/rewind/export-button";
interface TimeRange {
start: Date;
@@ -35,6 +37,8 @@ export function TimelineControls({
className,
}: TimelineControlsProps) {
const { isMac } = usePlatform();
+ const { selectionRange } = useTimelineSelection();
+ const hasSelection = selectionRange && selectionRange.frameIds.length > 0;
const jumpDay = async (days: number) => {
const today = new Date();
@@ -127,6 +131,19 @@ export function TimelineControls({
</Button>
</div>
+ <AnimatePresence>
+ {hasSelection && (
+ <motion.div
+ initial={{ opacity: 0, scale: 0.9 }}
+ animate={{ opacity: 1, scale: 1 }}
+ exit={{ opacity: 0, scale: 0.9 }}
+ transition={{ duration: 0.15 }}
+ >
+ <ExportButton />
+ </motion.div>
+ )}
+ </AnimatePresence>
+
<div className="flex items-center h-10 gap-1.5 bg-card/80 backdrop-blur-sm border border-border rounded-full px-4 shadow-lg">
<span className="text-xs text-muted-foreground">{isMac ? "⌘K" : "Ctrl+K"}</span>
<span className="text-xs text-muted-foreground">search</span>