auto zoom marker

This commit is contained in:
Siddharth
2026-04-26 17:25:20 -07:00
parent 5e994d214e
commit 1fefde8881
2 changed files with 12 additions and 1 deletions
@@ -1,6 +1,6 @@
import type { Span } from "dnd-timeline";
import { useItem } from "dnd-timeline";
import { Gauge, MessageSquare, Scissors, ZoomIn } from "lucide-react";
import { Gauge, MessageSquare, MousePointer2, Scissors, ZoomIn } from "lucide-react";
import { useMemo } from "react";
import { useScopedT } from "@/contexts/I18nContext";
import { cn } from "@/lib/utils";
@@ -15,6 +15,7 @@ interface ItemProps {
onSelect?: () => void;
zoomDepth?: number;
speedValue?: number;
isAutoFocus?: boolean;
variant?: "zoom" | "trim" | "annotation" | "speed" | "blur";
}
@@ -46,6 +47,7 @@ export default function Item({
onSelect,
zoomDepth = 1,
speedValue,
isAutoFocus = false,
variant = "zoom",
children,
}: ItemProps) {
@@ -134,6 +136,12 @@ export default function Item({
<span className="text-[11px] font-semibold tracking-tight whitespace-nowrap">
{ZOOM_LABELS[zoomDepth] || `${zoomDepth}×`}
</span>
{isAutoFocus && (
<MousePointer2
className="w-3 h-3 shrink-0 opacity-90"
aria-label="Cursor-follow"
/>
)}
</>
) : isTrim ? (
<>
@@ -103,6 +103,7 @@ interface TimelineRenderItem {
label: string;
zoomDepth?: number;
speedValue?: number;
isAutoFocus?: boolean;
variant: "zoom" | "trim" | "annotation" | "speed" | "blur";
}
@@ -682,6 +683,7 @@ function Timeline({
isSelected={item.id === selectedZoomId}
onSelect={() => onSelectZoom?.(item.id)}
zoomDepth={item.zoomDepth}
isAutoFocus={item.isAutoFocus}
variant="zoom"
>
{item.label}
@@ -1337,6 +1339,7 @@ export default function TimelineEditor({
span: { start: region.startMs, end: region.endMs },
label: t("labels.zoomItem", { index: String(index + 1) }),
zoomDepth: region.depth,
isAutoFocus: region.focusMode === "auto",
variant: "zoom",
}));