From 7bf0984698e43b9aa2dd879f65951318ed410390 Mon Sep 17 00:00:00 2001 From: Maze <167211895+mazeincoding@users.noreply.github.com> Date: Sat, 31 Jan 2026 00:20:04 +0100 Subject: codebase overhaul (#697) --- .../editor/timeline/timeline-cache-indicator.tsx | 126 --------------------- 1 file changed, 126 deletions(-) delete mode 100644 apps/web/src/components/editor/timeline/timeline-cache-indicator.tsx (limited to 'apps/web/src/components/editor/timeline/timeline-cache-indicator.tsx') diff --git a/apps/web/src/components/editor/timeline/timeline-cache-indicator.tsx b/apps/web/src/components/editor/timeline/timeline-cache-indicator.tsx deleted file mode 100644 index 7def2985..00000000 --- a/apps/web/src/components/editor/timeline/timeline-cache-indicator.tsx +++ /dev/null @@ -1,126 +0,0 @@ -"use client"; - -import { cn } from "@/lib/utils"; -import { TIMELINE_CONSTANTS } from "@/constants/timeline-constants"; -import { TimelineTrack } from "@/types/timeline"; -import { MediaFile } from "@/types/media"; -import { TProject } from "@/types/project"; -import { useSceneStore } from "@/stores/scene-store"; - -interface CacheSegment { - startTime: number; - endTime: number; - cached: boolean; -} - -interface TimelineCacheIndicatorProps { - duration: number; - zoomLevel: number; - tracks: TimelineTrack[]; - mediaFiles: MediaFile[]; - activeProject: TProject | null; - getRenderStatus: ( - time: number, - tracks: TimelineTrack[], - mediaFiles: MediaFile[], - activeProject: TProject | null, - sceneId?: string - ) => "cached" | "not-cached"; -} - -export function TimelineCacheIndicator({ - duration, - zoomLevel, - tracks, - mediaFiles, - activeProject, - getRenderStatus, -}: TimelineCacheIndicatorProps) { - const { currentScene } = useSceneStore(); - - // Calculate cache segments by sampling the timeline - const calculateCacheSegments = (): CacheSegment[] => { - const segments: CacheSegment[] = []; - const sampleRate = 10; // Sample every 0.1 seconds - const totalSamples = Math.ceil(duration * sampleRate); - - if (totalSamples === 0) { - return [{ startTime: 0, endTime: duration, cached: false }]; - } - - let currentSegment: CacheSegment | null = null; - - for (let i = 0; i <= totalSamples; i++) { - const time = i / sampleRate; - const cached = - getRenderStatus( - time, - tracks, - mediaFiles, - activeProject, - currentScene?.id - ) === "cached"; - - if (!currentSegment) { - // Start first segment - currentSegment = { - startTime: time, - endTime: time, - cached, - }; - } else if (currentSegment.cached === cached) { - // Extend current segment - currentSegment.endTime = time; - } else { - // Finish current segment and start new one - segments.push(currentSegment); - currentSegment = { - startTime: time, - endTime: time, - cached, - }; - } - } - - // Add the last segment - if (currentSegment) { - currentSegment.endTime = duration; - segments.push(currentSegment); - } - - return segments; - }; - - const cacheSegments = calculateCacheSegments(); - - return ( -