From bd9ec023eefc4b5d26fa8b66c4338e97104f0f96 Mon Sep 17 00:00:00 2001 From: Maze Winther Date: Wed, 1 Apr 2026 19:27:49 +0200 Subject: refactor: split constants by domain and isolate timeline panel from core --- .../editor/panels/timeline/bookmarks.tsx | 24 +- .../editor/panels/timeline/drag-line.tsx | 4 +- .../editor/panels/timeline/drop-target.ts | 251 +++++++++++++++++++++ .../components/editor/panels/timeline/index.tsx | 50 ++-- .../editor/panels/timeline/interaction.ts | 4 + .../components/editor/panels/timeline/layers.ts | 6 + .../components/editor/panels/timeline/layout.ts | 16 ++ .../panels/timeline/selection-hit-testing.ts | 136 +++++++++++ .../editor/panels/timeline/snap-indicator.tsx | 2 +- .../src/components/editor/panels/timeline/theme.ts | 29 +++ .../editor/panels/timeline/timeline-element.tsx | 12 +- .../editor/panels/timeline/timeline-playhead.tsx | 4 +- .../editor/panels/timeline/timeline-ruler.tsx | 14 +- .../editor/panels/timeline/timeline-toolbar.tsx | 11 +- .../editor/panels/timeline/timeline-track.tsx | 5 +- .../editor/panels/timeline/track-layout.ts | 37 +++ 16 files changed, 553 insertions(+), 52 deletions(-) create mode 100644 apps/web/src/components/editor/panels/timeline/drop-target.ts create mode 100644 apps/web/src/components/editor/panels/timeline/interaction.ts create mode 100644 apps/web/src/components/editor/panels/timeline/layers.ts create mode 100644 apps/web/src/components/editor/panels/timeline/layout.ts create mode 100644 apps/web/src/components/editor/panels/timeline/selection-hit-testing.ts create mode 100644 apps/web/src/components/editor/panels/timeline/theme.ts create mode 100644 apps/web/src/components/editor/panels/timeline/track-layout.ts (limited to 'apps/web/src/components/editor/panels/timeline') diff --git a/apps/web/src/components/editor/panels/timeline/bookmarks.tsx b/apps/web/src/components/editor/panels/timeline/bookmarks.tsx index e2dc09f1..d4b1657e 100644 --- a/apps/web/src/components/editor/panels/timeline/bookmarks.tsx +++ b/apps/web/src/components/editor/panels/timeline/bookmarks.tsx @@ -6,10 +6,10 @@ import { useEditor } from "@/hooks/use-editor"; import type { BookmarkDragState } from "@/hooks/timeline/use-bookmark-drag"; import { BOOKMARK_TIME_EPSILON } from "@/lib/timeline/bookmarks"; import { - DEFAULT_BOOKMARK_COLOR, - TIMELINE_BOOKMARK_ROW_HEIGHT, -} from "@/constants/timeline-constants"; -import { DEFAULT_FPS } from "@/constants/project-constants"; + DEFAULT_TIMELINE_BOOKMARK_COLOR, +} from "./theme"; +import { TIMELINE_BOOKMARK_ROW_HEIGHT_PX } from "./layout"; +import { DEFAULT_FPS } from "@/lib/fps/constants"; import { getSnappedSeekTime } from "opencut-wasm"; import { ArrowTurnBackwardIcon, @@ -83,12 +83,12 @@ export function TimelineBookmarksRow({ return (