From fd2cf591b797be792f2b79d3bdd41c52cf04149a Mon Sep 17 00:00:00 2001
From: priyankarpal <88102392+priyankarpal@users.noreply.github.com>
Date: Wed, 25 Jun 2025 12:01:30 +0530
Subject: [PATCH 01/10] fix: text visible
---
apps/web/src/components/editor/timeline.tsx | 121 ++++++++++----------
1 file changed, 58 insertions(+), 63 deletions(-)
diff --git a/apps/web/src/components/editor/timeline.tsx b/apps/web/src/components/editor/timeline.tsx
index ce0ffa3..3242f40 100644
--- a/apps/web/src/components/editor/timeline.tsx
+++ b/apps/web/src/components/editor/timeline.tsx
@@ -1,33 +1,27 @@
"use client";
-import { ScrollArea } from "../ui/scroll-area";
-import { Button } from "../ui/button";
-import {
- Scissors,
- ArrowLeftToLine,
- ArrowRightToLine,
- Trash2,
- Snowflake,
- Copy,
- SplitSquareHorizontal,
- MoreVertical,
- Volume2,
- VolumeX,
- Pause,
- Play,
-} from "lucide-react";
-import {
- Tooltip,
- TooltipContent,
- TooltipTrigger,
- TooltipProvider,
-} from "../ui/tooltip";
-import { useTimelineStore, type TimelineTrack } from "@/stores/timeline-store";
+import { processMediaFiles } from "@/lib/media-processing";
import { useMediaStore } from "@/stores/media-store";
import { usePlaybackStore } from "@/stores/playback-store";
-import { processMediaFiles } from "@/lib/media-processing";
+import { useTimelineStore, type TimelineTrack } from "@/stores/timeline-store";
+import {
+ ArrowLeftToLine,
+ ArrowRightToLine,
+ Copy,
+ MoreVertical,
+ Pause,
+ Play,
+ Scissors,
+ Snowflake,
+ SplitSquareHorizontal,
+ Trash2,
+ Volume2,
+ VolumeX,
+} from "lucide-react";
+import { useCallback, useEffect, useRef, useState } from "react";
import { toast } from "sonner";
-import { useState, useRef, useEffect, useCallback } from "react";
+import { Button } from "../ui/button";
+import { ScrollArea } from "../ui/scroll-area";
import {
Select,
SelectContent,
@@ -35,6 +29,12 @@ import {
SelectTrigger,
SelectValue,
} from "../ui/select";
+import {
+ Tooltip,
+ TooltipContent,
+ TooltipProvider,
+ TooltipTrigger,
+} from "../ui/tooltip";
export function Timeline() {
// Timeline shows all tracks (video, audio, effects) and their clips.
@@ -213,7 +213,7 @@ export function Timeline() {
const bx2 = clamp(x2, 0, rect.width);
const by1 = clamp(y1, 0, rect.height);
const by2 = clamp(y2, 0, rect.height);
- let newSelection: { trackId: string; clipId: string }[] = [];
+ let newSelection: { trackId: string; clipId: string; }[] = [];
tracks.forEach((track, trackIdx) => {
track.clips.forEach((clip) => {
const effectiveDuration = clip.duration - clip.trimStart - clip.trimEnd;
@@ -604,8 +604,8 @@ export function Timeline() {
{/* Time Display */}
- {currentTime.toFixed(1)}s / {duration.toFixed(1)}s
+ >
+ {currentTime.toFixed(1)}s / {duration.toFixed(1)}s
{/* Test Clip Button - for debugging */}
@@ -786,19 +786,17 @@ export function Timeline() {
return (
{(() => {
const formatTime = (seconds: number) => {
@@ -859,13 +857,12 @@ export function Timeline() {
>
{track.name}
@@ -1194,7 +1191,7 @@ function TimelineTrackContent({
});
};
- const updateTrimFromMouseMove = (e: { clientX: number }) => {
+ const updateTrimFromMouseMove = (e: { clientX: number; }) => {
if (!resizing) return;
const clip = track.clips.find((c) => c.id === resizing.clipId);
@@ -1284,7 +1281,7 @@ function TimelineTrackContent({
return;
}
}
- } catch (error) {}
+ } catch (error) { }
}
// Calculate drop position for overlap checking
@@ -1662,13 +1659,12 @@ function TimelineTrackContent({
return (
{
e.preventDefault();
// Only show track menu if we didn't click on a clip
@@ -1692,13 +1688,12 @@ function TimelineTrackContent({
{track.clips.length === 0 ? (
{isDropping
? wouldOverlap
@@ -1722,7 +1717,7 @@ function TimelineTrackContent({
return (
{
e.stopPropagation();
@@ -1785,7 +1780,7 @@ function TimelineTrackContent({
{clipMenuOpen === clip.id && (
-
+