The video editor (src/tools/video-editor/) has 8 issues across drag-drop UX, pane layout, rendering, property panel filtering, and lightbox interaction. The editor uses two distinct drag systems (pointer events for internal clip movement, HTML5 drag-drop for external assets), a Remotion-based preview, and integrates as both a standalone page and a compact sliding pane.
Key constraints:
Shared drag-drop utilities in src/shared/lib/dnd/dragDrop.ts must not break gallery/shot targets.
Remotion render is currently a stub — the "broken render" issue may mean either fixing the stub or wiring a real render pipeline.
The @xzdarcy/react-timeline-editor library controls much of the internal clip movement UX; some drag-drop unification may be limited by its API.
Phase 1: Low-Risk UI/UX Fixes (no data flow changes)
Step 1: Add type mismatch indicator to cross-track drag (useCrossTrackDrag.ts, timeline-overrides.css)
Scope: Small
InspectuseCrossTrackDrag.ts:180-183 — currently when targetTrack.kind !== session.sourceKind, the drop target is silently cleared with no indicator.
Implement a "reject" visual indicator: when the drop target track has a mismatched kind, show the highlight row with a red/warning tint instead of hiding it. Add a CSS class cross-track-drop-reject to timeline-overrides.css.
UpdateupdateDropTarget() to set session.createTrackOnDrop = false and render a red-tinted highlight (e.g., rgb(250 137 137 / 0.12)) when the target kind doesn't match, and set cursor to not-allowed on the ghost.
the existing helper in which already returns for mismatched kinds.
Assistant
User
Assistant
I’m checking the revised plan against the current hooks and components now. The main question is whether the remaining steps still map cleanly onto the existing data flow, especially external drag handling and track creation.
Assistant
{"flags":[{"id":"external-asset-kind-dragover-inference-wrong","concern":"Step 5's asset-panel dragover inference is incorrect: checking dataTransfer.types or hasDataTransferType('asset-kind') only tells you that an asset-kind entry exists, not whether the dragged asset is audio or visual.","category":"correctness","severity_hint":"likely-significant","evidence":"/Users/user_c042661f/Documents/reigh-workspace/reigh-app/src/tools/video-editor/components/PropertiesPanel/AssetPanel.tsx:280-283 sets dataTransfer.setData('asset-key', assetKey) and dataTransfer.setData('asset-kind', kind). During dragover, the types list will contain the string asset-kind, but not its stored value. The current timeline code already uses types as a presence check only in /Users/user_c042661f/Documents/reigh-workspace/reigh-app/src/tools/video-editor/hooks/useTimelineEditing.ts:557-560, so the plan as written would not actually be able to decide whether to show a reject indicator or which kind of new track to create for asset drags."}],"verified_flag_ids":["external-drop-zone-step-misdiagnoses-gap","drag-unification-misses-existing-internal-indicator","clip-panel-hidden-tab-state-not-handled","preview-lightbox-step-misses-generation-dependency","render-step-is-open-ended-scope-creep"],"disputed_flag_ids":[]}
User
Assistant
I’m checking the two new user-mandated decisions against the repo now: the exact LayoutMainContent pane-offset pattern, and whether the Remotion setup in this repo is actually prepared for a browser-side WebCodecs render path.
Assistant
User
Assistant
{"flags":[{"id":"pane-control-tab-offset-removal-breaks-alignment","concern":"Step 6 removes horizontalOffset from PaneControlTab, but that offset is still needed to keep the top control tab centered over the editor pane after the pane itself shifts with side-pane margins.","category":"correctness","severity_hint":"likely-significant","evidence":"The plan explicitly says to remove horizontalOffset from EditorPaneTab. In the repo, PaneControlTab consumes that value at /Users/user_c042661f/Documents/reigh-workspace/reigh-app/src/shared/components/PaneControlTab.tsx:91,136, and the top-pane positioning strategy applies it via translateX(${horizontalOffset / 2}px) at /Users/user_c042661f/Documents/reigh-workspace/reigh-app/src/shared/hooks/panePositioning/strategies/TopPaneStrategy.ts:7-15. Since the control tab is a separate fixed element, switching the pane surface to margin-based offsets does not automatically move the tab with it."}],"verified_flag_ids":["external-asset-kind-dragover-inference-wrong","pane-shift-pattern-does-not-match-layoutmaincontent","render-metadata-still-contradicts-plan-body"],"disputed_flag_ids":[]}
Leverage
resolveDropTarget()
coordinate-utils.ts:118-132
{ kind: 'reject' }
Step 2: Filter ClipPanel tabs based on clip type (ClipPanel.tsx)
Scope: Small
InspectClipPanel.tsx:94-101 — all 5 tabs always shown regardless of clip.clipType.
Implement conditional tab rendering:
For clipType === 'text': hide "Audio" tab (text clips have no audio), hide "Timing > Source In/Out" fields (no source media).
For clipType !== 'text': hide "Text" tab entirely.
For audio tracks (track?.kind === 'audio'): hide "Position" and "Text" tabs.
UpdateTabsList grid-cols-5 to dynamically adjust column count based on visible tabs.
Step 3: Add double-click lightbox for media clips in preview (OverlayEditor.tsx, AssetPanel.tsx)
Scope: Small–Medium
InspectOverlayEditor.tsx:390 — onDoubleClick currently only triggers beginTextEdit for text clips. Non-text clips have no double-click handler.
Implement double-click on non-text overlay clips opens the source generation lightbox:
When clipMeta.clipType !== 'text' and clipMeta.asset is set, double-click should open MediaLightbox for the asset's generation.
Add onDoubleClickAsset?: (assetKey: string) => void callback to OverlayEditorProps.
Wire the lightbox state from the existing AssetPanel lightbox infrastructure or lift it to PropertiesPanel/VideoEditorShell level.
Phase 2: Drag-Drop Unification
Step 4: Unify drop zone visual indicators (useTimelineEditing.ts, useCrossTrackDrag.ts)
Scope: Medium
Audit the two indicator systems:
Internal (pointer): creates DOM elements in useCrossTrackDrag.ts:186-198 (.cross-track-drop-highlight, .cross-track-ghost).
External (HTML5 drag): creates DOM elements in useTimelineEditing.ts:153-217 (row highlight, line, ghost, label).
Extract a shared DropIndicator module (or utility functions) that both systems use for consistent visual feedback. Key elements: row highlight, time position line, ghost preview, label.
Implement consistent styling: same blue highlight color (rgb(137 180 250 / 0.12)), same ghost opacity, same label format (TrackName · Xs).
Update both drag handlers to use the shared indicator.
Step 5: Add drop rejection feedback for external drops (useTimelineEditing.ts)
Scope: Small
InspectonTimelineDragOver (useTimelineEditing.ts:556-619) — currently highlights the drop row but doesn't indicate if the asset kind is incompatible with the target track.
Implement kind checking during onTimelineDragOver:
For asset-key drags: read asset-kind from dataTransfer types to determine if the hovered track is compatible.
For generation drags: infer kind from metadata (generation drags are always visual).
For file drags: infer from file extension via MIME types in dataTransfer.items.
Show the reject indicator (red-tinted row from Step 1) when kinds don't match.
Step 6: Add explicit drop zone boundaries and empty-track affordance (TimelineEditor.tsx)
Scope: Small
InspectTimelineEditor.tsx:209-214 — the wrapper div is the only drop zone.
Implement visual drop zone borders during drag: add a data-drag-over CSS rule in timeline-overrides.css that shows a dashed border around the timeline area when a valid drag is in progress.
Consider adding a "drop below to create new track" indicator at the bottom of the track list during external drags (similar to the cross-track drag's drop-target-new-track class).
InspectEditorPaneTab.tsx:71-73 — horizontalOffset is computed from shots/tasks pane widths, and left/right are applied inline (lines 126-127). When these panes lock/unlock, the editor pane jumps.
Implement smooth transition on left and right style changes by adding transition-[left,right] and duration-300 to the pane's className (line 130-133).
Verify the compact VideoEditorShell resizes its content correctly when the container dimensions change (Remotion Player uses width: '100%').
Test edge case: locking editor pane, then locking shots pane — editor should smoothly shift right without content jump.
InspectuseTimelineData.ts:603-606 — startRender is a stub showing a toast.
Decision point: This is either:
(A) Wire to existing task creation infrastructure (unified_task_creation.md) to create a render task that a worker picks up, OR
(B) Implement client-side Remotion rendering using @remotion/renderer, OR
(C) Keep stub but fix any UI that implies rendering works (remove Render button or mark as "Coming Soon").
If (A): Create a render-video task type, add a migration for video render tasks table, wire startRender to createTask() with the timeline config as params.
If (C): Update the Render button in VideoEditorShell.tsx:135-139 to show "Coming Soon" badge and disable the button.
Execution Order
Steps 1–3 first (Phase 1): pure UI fixes, no side effects, independently testable.
Steps 4–6 next (Phase 2): drag-drop unification builds on Step 1's reject indicator.
Steps 7–8 last (Phase 3): layout and render fixes are independent from drag-drop.
Validation Order
Manual: drag an audio clip to a visual track → see red reject indicator (Step 1).
Manual: select a text clip → only relevant tabs visible; select media clip → no Text tab (Step 2).
Manual: double-click a media clip in preview → lightbox opens (Step 3).
Visual comparison: internal vs external drag indicators should look identical (Step 4).
Manual: drag an audio file over a visual track → red indicator (Step 5).
Manual: drag over empty timeline → visible drop zone border (Step 6).
Manual: lock/unlock shots pane while editor pane is open → smooth transition (Step 7).
"version": 1,
"timestamp": "2026-03-25T14:42:29Z",
"hash": "sha256:d58819cacfaba20ab1f4a88aa270ff716b35bfeba792dc008579eb73006e83e9",
"questions": [
"Issue 8 (broken Remotion render): Is the goal to (A) wire server-side rendering via the existing task/worker infrastructure, (B) implement client-side rendering with @remotion/renderer, or (C) just fix the UI to indicate rendering isn't available yet? This fundamentally changes scope \u2014 (A) or (B) could be a multi-day effort, while (C) is a 15-minute fix.",
"Issue 3 (drop zones): Should dropping on an incompatible track silently redirect to the first compatible track (current behavior of getCompatibleTrackId for external drops), or should it reject the drop with visual feedback? Currently internal cross-track drag rejects, but external drag silently finds a compatible track.",
"Issue 7 (double-click lightbox): Should double-clicking a media clip in the preview overlay open a lightbox showing the source generation, or should it do something else (e.g., open clip properties, start playback from that point)? And should this work for clips that have no generationId (external uploads)?",
"Issue 4 (pane locking view shifts): Is the fix just adding CSS transitions to smooth the shift, or should the editor pane NOT shift at all (e.g., overlay other panes or use a different layout strategy)?"
],
"success_criteria": [
"Dragging a clip to an incompatible track type shows a red/warning visual indicator instead of silently rejecting",
"Internal (pointer-based) and external (HTML5 drag-drop) drop indicators use consistent visual styling",
"ClipPanel only shows tabs relevant to the selected clip type (no Text tab for media, no Audio tab for text)",
"Double-clicking a media clip in the preview overlay opens a lightbox for its source generation",
"Locking/unlocking adjacent panes while the editor pane is open results in smooth transitions (no content jump)",
"The Render button behaves correctly per the chosen approach (either triggers a render or clearly indicates unavailability)",
"All existing drag-drop functionality (gallery \u2192 timeline, asset panel \u2192 timeline, cross-track) continues to work",
"No regressions in shared drag-drop utilities (gallery, shots, batch drop zone still functional)"
],
"assumptions": [
"The 'broken Remotion render' refers to the startRender stub in useTimelineData.ts:603-606 that only shows a toast \u2014 assuming fix approach (C) unless told otherwise, since (A) and (B) require significant new infrastructure",
"The 'double-click lightbox' issue means we should add lightbox support for media clips in the preview overlay (OverlayEditor), since the only existing double-click handler is for text editing",
"The 'drop zone' issue covers both visual feedback on incompatible drops AND making drop target areas more discoverable with visual borders during drag",
"Type mismatch indicators apply to both internal cross-track drag AND external asset/generation drops onto the timeline",
"The 'text option filtering' means conditionally showing/hiding ClipPanel tabs rather than disabling them",
"Pane locking view shift fix is a CSS transition smoothing fix, not a fundamental layout change",
"The 'internal/external drag consistency' issue is about visual indicator styling, not about merging the two drag mechanisms into one (which would require replacing the pointer-based system)"
],
"structure_warnings": []
}
code
Plan structure warnings from validator:
[]
Existing flags:
[]
Requirements:
- Consider whether the plan is at the right level of abstraction.
- Reuse existing flag IDs when the same concern is still open.
- `verified_flag_ids` should list previously addressed flags that now appear resolved.
- Focus on concrete issues that would cause real problems.
- Robustness level: standard. Use balanced judgment. Flag significant risks, but do not spend flags on minor polish or executor-obvious boilerplate.
- Verify that the plan remains aligned with the user's original intent.
- Verify that the plan follows the expected structure: one H1 title, `## Overview`, numbered step sections (`### Step N:` under `## Phase` headers, or flat `## Step N:`) with file references and numbered substeps, plus `## Execution Order` or `## Validation Order`.
- Missing required sections or step coverage (for example: no H1, no `## Overview`, or no step sections at all) should be flagged as category `completeness` with severity_hint `likely-significant`.
- Structural formatting within steps (for example: prose instead of numbered substeps, or a missing file reference inside an otherwise actionable step) should usually be category `completeness` with severity_hint `likely-minor` because the executor can still follow the instructions.
- Flag scope creep explicitly when the plan grows beyond the original idea or recorded user notes. Use the phrase "Scope creep:" in the concern.
- Assign severity_hint carefully. Implementation details the executor will naturally resolve should usually be `likely-minor`.
{"flags":[{"id":"external-drop-zone-step-misdiagnoses-gap","concern":"Step 6 is aimed at the wrong implementation gap: the timeline already has drag-over boundary styling, but external drops still cannot target a new track below the list because the drop math and drop handler only resolve existing rows.","category":"correctness","severity_hint":"likely-significant","evidence":"/Users/user_c042661f/Documents/reigh-workspace/reigh-app/src/tools/video-editor/components/TimelineEditor/timeline-overrides.css:65 already defines data-drag-over styling and :69 already defines the drop-target-new-track affordance. The real limitation is in /Users/user_c042661f/Documents/reigh-workspace/reigh-app/src/tools/video-editor/hooks/useTimelineEditing.ts:243, which clamps rowIndex to rowCount - 1, and in :643-646 plus :734-738, which only resolve compatible existing tracks."},{"id":"drag-unification-misses-existing-internal-indicator","concern":"Step 4 does not cover the existing same-row move indicator in TimelineEditor, so the stated internal/external drag consistency goal would still be only partially addressed.","category":"completeness","severity_hint":"likely-significant","evidence":"/Users/user_c042661f/Documents/reigh-workspace/reigh-app/src/tools/video-editor/components/TimelineEditor/TimelineEditor.tsx:45-50, :146-185, and :216-245 render a separate dragIndicator overlay for normal action moves. Its styling lives in /Users/user_c042661f/Documents/reigh-workspace/reigh-app/src/tools/video-editor/components/TimelineEditor/timeline-overrides.css:32-63. Step 4 only mentions useTimelineEditing.ts and useCrossTrackDrag.ts."},{"id":"clip-panel-hidden-tab-state-not-handled","concern":"Step 2 hides tabs but never clamps or resets activeTab, which can leave the properties panel on an invisible tab after switching clip types.","category":"correctness","severity_hint":"likely-significant","evidence":"/Users/user_c042661f/Documents/reigh-workspace/reigh-app/src/tools/video-editor/components/PropertiesPanel/ClipPanel.tsx:94 binds Tabs directly to activeTab, and :95-100 currently renders all triggers. /Users/user_c042661f/Documents/reigh-workspace/reigh-app/src/tools/video-editor/components/PropertiesPanel/PropertiesPanel.tsx:28-33 only auto-switches into text for text clips; there is no inverse reset when the selected clip is media or audio."},{"id":"preview-lightbox-step-misses-generation-dependency","concern":"Step 3 understates the data dependency for opening a source lightbox from the preview: clipMeta.asset alone is not enough, and many assets have no generation-backed lightbox available.","category":"correctness","severity_hint":"likely-significant","evidence":"/Users/user_c042661f/Documents/reigh-workspace/reigh-app/src/tools/video-editor/components/PropertiesPanel/AssetPanel.tsx:148-186 builds lightbox queries from registry[assetKey].generationId, and :267-303 only enables the source button when generation data is actually loaded. OverlayEditor currently only has clip meta plus the asset registry entry (/Users/user_c042661f/Documents/reigh-workspace/reigh-app/src/tools/video-editor/components/PreviewPanel/OverlayEditor.tsx:8-20), not the loaded GenerationRow that MediaLightbox needs."},{"id":"render-step-is-open-ended-scope-creep","concern":"Scope creep: Step 8 turns one bug in this bundle into an open-ended render-pipeline project, but the repo currently exposes only a toast stub and no video-editor render backend contract.","category":"completeness","severity_hint":"likely-significant","evidence":"/Users/user_c042661f/Documents/reigh-workspace/reigh-app/src/tools/video-editor/hooks/useTimelineData.ts:603-606 is an explicit toast-only startRender stub. /Users/user_c042661f/Documents/reigh-workspace/reigh-app/src/tools/video-editor/data/DataProvider.ts:19-30 has no render method, and /Users/user_c042661f/Documents/reigh-workspace/reigh-app/src/tools/video-editor/data/SupabaseDataProvider.ts:11-149 implements timeline/asset loading and uploads only. Repo search also found no existing video-editor render task type or worker wiring to support options A or B."}],"verified_flag_ids":[],"disputed_flag_ids":[]}
You are an independent reviewer. Critique the plan against the actual repository.
The video editor (src/tools/video-editor/) has 8 issues across drag-drop UX, pane layout, rendering, property panel filtering, and lightbox interaction. The editor uses two distinct drag systems (pointer events for internal clip movement, HTML5 drag-drop for external assets), a Remotion-based preview, and integrates as both a standalone page and a compact sliding pane.
Key constraints:
Shared drag-drop utilities in src/shared/lib/dnd/dragDrop.ts must not break gallery/shot targets.
The @xzdarcy/react-timeline-editor library controls much of the internal clip movement UX; some drag-drop unification is limited by its API.
Remotion render is a toast-only stub with no backend contract — this bundle fixes the UI, not the pipeline.
Settled decisions:
Render (Step 8): Option C — disable Render button with "Coming Soon" indicator. No backend render work.
External drop rejection: Show reject indicator (red row highlight) on incompatible tracks, matching internal drag behavior.
Two drag systems stay: Unify visual indicators only; keep pointer-based internal and HTML5 external mechanisms.
Phase 1: Low-Risk UI/UX Fixes (no data flow changes)
Step 1: Add type mismatch indicator to cross-track drag (useCrossTrackDrag.ts, timeline-overrides.css)
Scope: Small
InspectuseCrossTrackDrag.ts:180-183 — when targetTrack.kind !== session.sourceKind, the drop target is silently cleared with no visual feedback.
Implement a "reject" visual indicator in updateDropTarget(): when resolveDropTarget() (from coordinate-utils.ts:118-132) returns { kind: 'reject' }, show the highlight row with a red-tinted background (rgb(250 137 137 / 0.12) and border: 1px solid rgb(250 137 137 / 0.3)) and set cursor: not-allowed on the ghost element.
Add CSS class .cross-track-drop-reject to timeline-overrides.css for the reject indicator styling.
Ensuresession.targetRowId remains null and session.createTrackOnDrop remains false when rejected, so the drop handler still does nothing on incompatible tracks.
Step 2: Filter ClipPanel tabs and clamp activeTab on clip type change (ClipPanel.tsx, PropertiesPanel.tsx)
Scope: Small
InspectClipPanel.tsx:94-101 — all 5 tabs rendered regardless of clip.clipType. PropertiesPanel.tsx:28-33 auto-switches to text tab for text clips but never resets for non-text clips.
Compute visible tabs based on clip type and track kind:
clipType === 'text': show Effects, Timing, Position, Text (hide Audio).
track?.kind === 'audio': show Effects, Timing, Audio (hide Position, Text).
Otherwise (visual media): show Effects, Timing, Position, Audio (hide Text).
Clamp activeTab: In PropertiesPanel.tsx, expand the useEffect at :28-33 to also reset activeTab when switching to a non-text clip. If the current activeTab is not in the visible set for the new clip type, reset to 'effects'.
UpdateTabsList in ClipPanel.tsx to use grid-cols-{N} dynamically based on the visible tab count. Pass the visible tabs array as a prop or compute inside ClipPanel.
Step 3: Add double-click lightbox for media clips in preview (OverlayEditor.tsx, PreviewPanel.tsx, PropertiesPanel.tsx)
Scope: Medium
Data dependency:MediaLightbox requires a GenerationRow object. The OverlayEditor currently receives registry: ResolvedTimelineConfig['registry'] (which maps asset keys to ResolvedAssetRegistryEntry containing generationId), but not the loaded GenerationRow data that the lightbox needs.
Reuse AssetPanel's generation query infrastructure: The loadGenerationForLightbox function and useQueries pattern in AssetPanel.tsx:49-97,167-183 already loads GenerationRow by generationId.
Implementation approach — lift lightbox state to context:
Add lightboxAssetKey: string | null and setLightboxAssetKey to the TimelineEditorContext (or add a simple useState in VideoEditorShell/PreviewPanel).
In OverlayEditor.tsx:389-390, change double-click handler:
tsx
onDoubleClick={() => {
if (clipMeta?.clipType === 'text') {
beginTextEdit(overlay.actionId);
} else if (clipMeta?.asset) {
onDoubleClickAsset?.(clipMeta.asset);
}
}}
Add onDoubleClickAsset?: (assetKey: string) => void to OverlayEditorProps.
Wire from PreviewPanel.tsx → OverlayEditor the callback that sets lightboxAssetKey.
Lightbox rendering: Render the MediaLightbox in PreviewPanel.tsx (or VideoEditorShell), using loadGenerationForLightbox for the selected asset's generationId. Only enable when registry[assetKey]?.generationId exists and the query succeeds.
Graceful fallback: If an asset has no generationId (external upload without generation record), double-click does nothing (no lightbox button, no error). This matches AssetPanel's existing behavior where the source button is hidden for non-generation assets.
Phase 2: Drag-Drop Unification
Step 4: Unify all three drag indicator systems (TimelineEditor.tsx, useCrossTrackDrag.ts, useTimelineEditing.ts, timeline-overrides.css)
Scope: Medium
Audit the three indicator systems:
Same-row move indicator (internal): TimelineEditor.tsx:45-50,146-185,216-245 renders a dragIndicator React state overlay with CSS classes .drop-position-ghost, .drop-position-line, .drop-position-label (styled in timeline-overrides.css:32-63).
Cross-track indicator (internal pointer): useCrossTrackDrag.ts:186-198 creates DOM elements (.cross-track-drop-highlight, .cross-track-ghost) with inline styles using rgb(137 180 250 / 0.12).
External drop indicator (HTML5 drag): useTimelineEditing.ts:153-217 creates DOM elements with inline styles using rgba(137,180,250,0.08) for row highlight, #89b4fa for line, etc.
Unify styling by defining shared CSS custom properties or classes in timeline-overrides.css:
Refactor the external drop indicator (useTimelineEditing.ts:153-217) to use the same CSS classes as the same-row indicator from timeline-overrides.css:32-63. Replace inline styles with class assignments.
Refactor the cross-track indicator (useCrossTrackDrag.ts:186-198) to use the same CSS classes. Replace inline style.background = 'rgb(137 180 250 / 0.12)' with the shared .drop-indicator-row class.
Result: All three systems produce visually identical indicators — same colors, same border radius, same label format.
Step 5: Add drop rejection feedback and new-track support for external drops (useTimelineEditing.ts)
Scope: Medium
Fix row index clamping in getDropPosition() (useTimelineEditing.ts:243): currently Math.min(raw, rowCount - 1) prevents external drops from targeting "below all tracks." Change to allow rowIndex >= rowCount when raw >= rowCount, matching useCrossTrackDrag.ts:174 behavior.
Add new-track creation for external drops in onTimelineDrop (useTimelineEditing.ts:626+): when rowIndex >= rowCount, instead of resolving to an existing track, create a new track of the appropriate kind and drop the clip there. Mirror the createTrackAndMoveClip pattern from cross-track drag.
Add kind checking during onTimelineDragOver (useTimelineEditing.ts:556-619):
For asset-key drags: dataTransfer.types includes asset-kind during dragover (set as a custom type). Use hasDataTransferType or check types array.
For generation drags: always visual.
For file drags: dataTransfer.items[i].type is available during dragover — infer audio vs visual from MIME prefix.
When hovered track is incompatible with inferred kind: tint the row indicator red (reject style).
When rowIndex >= rowCount: show the drop-target-new-track class on the edit area (already styled in timeline-overrides.css:69-83).
Update drop handlers at useTimelineEditing.ts:643-646 (file drops) and :734-738 (asset drops) to handle the new-track case when rowIndex >= rowCount.
Steps 6–7 (Phase 3): pane layout and render fixes are independent from drag-drop work.
Validation Order
Manual: drag an audio clip vertically to a visual track → see red reject indicator (Step 1).
Manual: select a text clip → only Effects/Timing/Position/Text tabs visible; select media clip → no Text tab; select audio clip → no Position/Text tab. Switch between clip types — active tab should never be invisible (Step 2).
Manual: double-click a media clip in preview overlay → lightbox opens if it has a generation source; double-click an external-upload clip → nothing happens (no error) (Step 3).
Visual comparison: same-row drag, cross-track drag, and external drop all produce visually identical indicators (same colors, borders, labels) (Step 4).
Manual: drag an audio file over a visual track → red indicator. Drag below all tracks → "Drop to create matching track" affordance appears (Step 5).
Manual: lock/unlock shots pane while editor pane is open → smooth left/right transition, no jump (Step 6).
Manual: Render button is disabled with "Coming Soon" tooltip, no toast on click (Step 7).
Regression: drag generation from gallery to timeline → still works. Drag asset from panel to timeline → still works. Cross-track drag → still works.
code
Plan metadata:
{
"version": 2,
"timestamp": "2026-03-25T14:49:41Z",
"hash": "sha256:25f0bb356979ad687ee37063ae1eea28d9760668cdb23b4e8111c881a6d5e781",
"changes_summary": "Revision summary (v1 \u2192 v2):\n\n1. Step 6 rewritten (flag: external-drop-zone-step-misdiagnoses-gap): Removed the incorrect instruction to add CSS that already exists in timeline-overrides.css:65-83. Replaced with the real fix: unclamping rowIndex in getDropPosition() at useTimelineEditing.ts:243, adding new-track creation for external drops, and wiring the drop-target-new-track affordance. Merged into Step 5 alongside reject feedback since they're the same code path.\n\n2. Step 4 expanded (flag: drag-unification-misses-existing-internal-indicator): Now explicitly covers all three indicator systems: same-row move (TimelineEditor.tsx:45-50,146-185,216-245 with timeline-overrides.css:32-63), cross-track (useCrossTrackDrag.ts), and external (useTimelineEditing.ts). Plan specifies unifying via shared CSS classes rather than just matching colors.\n\n3. Step 2 expanded (flag: clip-panel-hidden-tab-state-not-handled): Added explicit activeTab clamping in PropertiesPanel.tsx:28-33 useEffect. Provided code example showing how to reset to 'effects' when current tab would be hidden for the new clip type. Covers the inverse of the existing text-clip auto-switch.\n\n4. Step 3 rewritten (flag: preview-lightbox-step-misses-generation-dependency): Now details the full data dependency chain: OverlayEditor only has registry \u2192 need generationId \u2192 need loadGenerationForLightbox query \u2192 need GenerationRow for MediaLightbox. Specifies lifting lightbox state to context/parent, reusing AssetPanel's query pattern, and graceful fallback for assets without generationId.\n\n5. Step 8 \u2192 Step 7, scoped down (flag: render-step-is-open-ended-scope-creep): Removed options A and B entirely. Locked to option C: disable button, add tooltip, remove onClick. No backend render work. Renumbered to Step 7 since the external drop zone step was merged into Step 5.\n\n6. Total steps reduced from 8 to 7 by merging the corrected drop-zone fix into the external drop rejection step.",
"flags_addressed": [
"external-drop-zone-step-misdiagnoses-gap",
"drag-unification-misses-existing-internal-indicator",
"clip-panel-hidden-tab-state-not-handled",
"preview-lightbox-step-misses-generation-dependency",
"render-step-is-open-ended-scope-creep"
],
"questions": [
"Issue 3 (double-click lightbox): Should double-clicking a media clip in the preview overlay open a lightbox showing the source generation, or should it do something else (e.g., open clip properties, start playback from that point)?",
"Issue 4 (pane locking view shifts): Is the fix just adding CSS transitions to smooth the shift, or should the editor pane NOT shift at all (e.g., overlay other panes)?"
],
"success_criteria": [
"Dragging a clip to an incompatible track type shows a red/warning visual indicator instead of silently rejecting",
"All three drag indicator systems (same-row move, cross-track, external drop) use consistent visual styling via shared CSS classes",
"ClipPanel only shows tabs relevant to the selected clip type, and activeTab is clamped when switching between clip types so the panel never shows an invisible tab",
"Double-clicking a media clip with a generation source in the preview overlay opens a lightbox; clips without a generation source gracefully do nothing",
"External drops below all tracks trigger new-track creation (matching internal cross-track behavior), with the existing 'Drop to create matching track' affordance visible during drag",
"Locking/unlocking adjacent panes while the editor pane is open results in smooth CSS transitions on left/right (no content jump)",
"The Render button is disabled with a 'Coming Soon' tooltip \u2014 no toast, no broken interaction",
"All existing drag-drop functionality (gallery to timeline, asset panel to timeline, cross-track) continues to work without regression"
],
"assumptions": [
"The 'broken Remotion render' refers to the startRender stub in useTimelineData.ts:603-606 \u2014 fix is option C (disable button) since no backend render contract exists",
"The 'double-click lightbox' means adding lightbox support for media clips in the preview overlay (OverlayEditor), with graceful no-op for assets without generationId",
"Type mismatch indicators apply to both internal cross-track drag AND external asset/generation drops onto the timeline",
"The 'text option filtering' means conditionally showing/hiding ClipPanel tabs AND clamping activeTab when switching between clip types",
"Pane locking view shift fix is a CSS transition smoothing fix, not a fundamental layout change",
"The 'internal/external drag consistency' covers all three indicator systems (same-row, cross-track, external drop), not just two",
"External drops below all tracks should create a new track (matching internal cross-track behavior), which requires unclamping rowIndex in getDropPosition"
],
"structure_warnings": [],
"delta_from_previous_percent": 67.92
}
code
Plan structure warnings from validator:
[]
Existing flags:
[
{
"id": "external-drop-zone-step-misdiagnoses-gap",
"concern": "Step 6 is aimed at the wrong implementation gap: the timeline already has drag-over boundary styling, but external drops still cannot target a new track below the list because the drop math and drop handler only resolve existing rows.",
"status": "addressed",
"severity": "significant"
},
{
"id": "drag-unification-misses-existing-internal-indicator",
"concern": "Step 4 does not cover the existing same-row move indicator in TimelineEditor, so the stated internal/external drag consistency goal would still be only partially addressed.",
"status": "addressed",
"severity": "significant"
},
{
"id": "clip-panel-hidden-tab-state-not-handled",
"concern": "Step 2 hides tabs but never clamps or resets activeTab, which can leave the properties panel on an invisible tab after switching clip types.",
"status": "addressed",
"severity": "significant"
},
{
"id": "preview-lightbox-step-misses-generation-dependency",
"concern": "Step 3 understates the data dependency for opening a source lightbox from the preview: clipMeta.asset alone is not enough, and many assets have no generation-backed lightbox available.",
"status": "addressed",
"severity": "significant"
},
{
"id": "render-step-is-open-ended-scope-creep",
"concern": "Scope creep: Step 8 turns one bug in this bundle into an open-ended render-pipeline project, but the repo currently exposes only a toast stub and no video-editor render backend contract.",
"status": "addressed",
"severity": "significant"
}
]
code
Requirements:
- Consider whether the plan is at the right level of abstraction.
- Reuse existing flag IDs when the same concern is still open.
- `verified_flag_ids` should list previously addressed flags that now appear resolved.
- Focus on concrete issues that would cause real problems.
- Robustness level: standard. Use balanced judgment. Flag significant risks, but do not spend flags on minor polish or executor-obvious boilerplate.
- Verify that the plan remains aligned with the user's original intent.
- Verify that the plan follows the expected structure: one H1 title, `## Overview`, numbered step sections (`### Step N:` under `## Phase` headers, or flat `## Step N:`) with file references and numbered substeps, plus `## Execution Order` or `## Validation Order`.
- Missing required sections or step coverage (for example: no H1, no `## Overview`, or no step sections at all) should be flagged as category `completeness` with severity_hint `likely-significant`.
- Structural formatting within steps (for example: prose instead of numbered substeps, or a missing file reference inside an otherwise actionable step) should usually be category `completeness` with severity_hint `likely-minor` because the executor can still follow the instructions.
- Ask whether the plan is the simplest approach that solves the stated problem, whether it could use fewer steps or less machinery, and whether it introduces unnecessary complexity.
- Over-engineering concerns should use category `maintainability`, should usually prefix the concern with "Over-engineering:", and should scale severity_hint to the practical impact.
- Flag scope creep explicitly when the plan grows beyond the original idea or recorded user notes. Use the phrase "Scope creep:" in the concern.
- Assign severity_hint carefully. Implementation details the executor will naturally resolve should usually be `likely-minor`.
You are an independent reviewer. Critique the plan against the actual repository.
Video editor tool fixes: 8 issues covering drag-drop unification (type mismatch indicators, internal/external drag consistency, drop zones), pane locking view shifts, broken Remotion render, text option filtering for non-text assets, and double-click lightbox
User notes and answers:
USER DECISION: T7 (render) must NOT just disable the button. Instead, implement actual client-side rendering using @remotion/webcodecs (browser-based WebCodecs API). The announcement-video repo uses @remotion/renderer via CLI (npx remotion render) but that's Node.js only. For browser, use @remotion/webcodecs which renders Remotion compositions in-browser. The existing startRender stub, renderStatus, renderProgress state in useTimelineData.ts is already wired. Implementation: install @remotion/webcodecs, implement startRender to call renderMedia equivalent, show progress, produce blob, trigger download. T6 (pane shift): must follow the EXACT existing pattern from LayoutMainContent.tsx which uses marginLeft/marginRight with transition-[margin,padding] duration-300 ease-smooth based on isShotsPaneLocked/isTasksPaneLocked and their widths from PanesContext.
See the add-note override for full details on both decisions.
The video editor (src/tools/video-editor/) has 8 issues across drag-drop UX, pane layout, rendering, property panel filtering, and lightbox interaction. The editor uses two distinct drag systems (pointer events for internal clip movement, HTML5 drag-drop for external assets), a Remotion-based preview, and integrates as both a standalone page and a compact sliding pane.
Key constraints:
Shared drag-drop utilities in src/shared/lib/dnd/dragDrop.ts must not break gallery/shot targets.
The @xzdarcy/react-timeline-editor library controls much of the internal clip movement UX; some drag-drop unification is limited by its API.
Remotion render is a toast-only stub — this bundle wires up actual client-side rendering via @remotion/webcodecs.
Settled decisions:
Render (Step 7): Implement client-side rendering using @remotion/webcodecs (WebCodecs API in browser). No server-side render needed.
External drop rejection: Show reject indicator (red row highlight) on incompatible tracks, matching internal drag behavior.
Two drag systems stay: Unify visual indicators only; keep pointer-based internal and HTML5 external mechanisms.
Phase 1: Low-Risk UI/UX Fixes (no data flow changes)
Step 1: Add type mismatch indicator to cross-track drag (useCrossTrackDrag.ts, timeline-overrides.css)
Scope: Small
InspectuseCrossTrackDrag.ts:180-183 — when targetTrack.kind !== session.sourceKind, the drop target is silently cleared with no visual feedback.
Implement a "reject" visual indicator in updateDropTarget(): when resolveDropTarget() (from coordinate-utils.ts:118-132) returns { kind: 'reject' }, show the highlight row with a red-tinted background (rgb(250 137 137 / 0.12) and border: 1px solid rgb(250 137 137 / 0.3)) and set cursor: not-allowed on the ghost element.
Add CSS class .cross-track-drop-reject to timeline-overrides.css for the reject indicator styling.
Ensuresession.targetRowId remains null and session.createTrackOnDrop remains false when rejected, so the drop handler still does nothing on incompatible tracks.
Step 2: Filter ClipPanel tabs and clamp activeTab on clip type change (ClipPanel.tsx, PropertiesPanel.tsx)
Scope: Small
InspectClipPanel.tsx:94-101 — all 5 tabs rendered regardless of clip.clipType. PropertiesPanel.tsx:28-33 auto-switches to text tab for text clips but never resets for non-text clips.
Compute visible tabs based on clip type and track kind:
clipType === 'text': show Effects, Timing, Position, Text (hide Audio).
track?.kind === 'audio': show Effects, Timing, Audio (hide Position, Text).
Otherwise (visual media): show Effects, Timing, Position, Audio (hide Text).
Clamp activeTab: In PropertiesPanel.tsx, expand the useEffect at :28-33 to also reset activeTab when switching to a non-text clip. If the current activeTab is not in the visible set for the new clip type, reset to 'effects'.
UpdateTabsList in ClipPanel.tsx to use grid-cols-{N} dynamically based on the visible tab count. Pass the visible tabs array as a prop or compute inside ClipPanel.
Step 3: Add double-click lightbox for media clips in preview (OverlayEditor.tsx, PreviewPanel.tsx, PropertiesPanel.tsx)
Scope: Medium
Data dependency:MediaLightbox requires a GenerationRow object. The OverlayEditor currently receives registry: ResolvedTimelineConfig['registry'] (which maps asset keys to ResolvedAssetRegistryEntry containing generationId), but not the loaded GenerationRow data that the lightbox needs.
Reuse AssetPanel's generation query infrastructure: The loadGenerationForLightbox function and useQueries pattern in AssetPanel.tsx:49-97,167-183 already loads GenerationRow by generationId.
Implementation approach — lift lightbox state to context:
Add lightboxAssetKey: string | null and setLightboxAssetKey to the TimelineEditorContext (or add a simple useState in VideoEditorShell/PreviewPanel).
In OverlayEditor.tsx:389-390, change double-click handler:
tsx
onDoubleClick={() => {
if (clipMeta?.clipType === 'text') {
beginTextEdit(overlay.actionId);
} else if (clipMeta?.asset) {
onDoubleClickAsset?.(clipMeta.asset);
}
}}
Add onDoubleClickAsset?: (assetKey: string) => void to OverlayEditorProps.
Wire from PreviewPanel.tsx → OverlayEditor the callback that sets lightboxAssetKey.
Lightbox rendering: Render the MediaLightbox in PreviewPanel.tsx (or VideoEditorShell), using loadGenerationForLightbox for the selected asset's generationId. Only enable when registry[assetKey]?.generationId exists and the query succeeds.
Graceful fallback: If an asset has no generationId (external upload without generation record), double-click does nothing (no lightbox button, no error). This matches AssetPanel's existing behavior where the source button is hidden for non-generation assets.
Phase 2: Drag-Drop Unification
Step 4: Unify all three drag indicator systems (TimelineEditor.tsx, useCrossTrackDrag.ts, useTimelineEditing.ts, timeline-overrides.css)
Scope: Medium
Audit the three indicator systems:
Same-row move indicator (internal): TimelineEditor.tsx:45-50,146-185,216-245 renders a dragIndicator React state overlay with CSS classes .drop-position-ghost, .drop-position-line, .drop-position-label (styled in timeline-overrides.css:32-63).
Cross-track indicator (internal pointer): useCrossTrackDrag.ts:186-198 creates DOM elements (.cross-track-drop-highlight, .cross-track-ghost) with inline styles using rgb(137 180 250 / 0.12).
External drop indicator (HTML5 drag): useTimelineEditing.ts:153-217 creates DOM elements with inline styles using rgba(137,180,250,0.08) for row highlight, #89b4fa for line, etc.
Unify styling by defining shared CSS custom properties or classes in timeline-overrides.css:
Refactor the external drop indicator (useTimelineEditing.ts:153-217) to use the same CSS classes as the same-row indicator from timeline-overrides.css:32-63. Replace inline styles with class assignments.
Refactor the cross-track indicator (useCrossTrackDrag.ts:186-198) to use the same CSS classes. Replace inline style.background = 'rgb(137 180 250 / 0.12)' with the shared .drop-indicator-row class.
Result: All three systems produce visually identical indicators — same colors, same border radius, same label format.
Step 5: Add drop rejection feedback and new-track support for external drops (useTimelineEditing.ts)
Scope: Medium
Fix row index clamping in getDropPosition() (useTimelineEditing.ts:243): currently Math.min(raw, rowCount - 1) prevents external drops from targeting "below all tracks." Change to allow rowIndex >= rowCount when raw >= rowCount, matching useCrossTrackDrag.ts:174 behavior.
Add new-track creation for external drops in onTimelineDrop (useTimelineEditing.ts:626+): when rowIndex >= rowCount, instead of resolving to an existing track, create a new track of the appropriate kind and drop the clip there. Mirror the createTrackAndMoveClip pattern from cross-track drag.
Add kind checking during onTimelineDragOver (useTimelineEditing.ts:556-619):
For asset-key drags: dataTransfer.types includes asset-kind during dragover (set as a custom type). Use hasDataTransferType or check types array.
For generation drags: always visual.
For file drags: dataTransfer.items[i].type is available during dragover — infer audio vs visual from MIME prefix.
When hovered track is incompatible with inferred kind: tint the row indicator red (reject style).
When rowIndex >= rowCount: show the drop-target-new-track class on the edit area (already styled in timeline-overrides.css:69-83).
Update drop handlers at useTimelineEditing.ts:643-646 (file drops) and :734-738 (asset drops) to handle the new-track case when rowIndex >= rowCount.
Follow the existing pattern from LayoutMainContent.tsx:37-50: The main content uses marginLeft/marginRight with transition-[margin,padding] duration-300 ease-smooth based on isShotsPaneLocked/isTasksPaneLocked and their widths from PanesContext.
InspectEditorPaneTab.tsx:126-133 — left and right are set inline with no transition. When shots/tasks pane lock/unlock, the editor pane jumps.
Addtransition-[left,right] and duration-300 ease-smooth to the pane div's className at line 130-133, matching the LayoutMainContent transition pattern.
Verify the Remotion Player (width: '100%' in RemotionPreview.tsx:109) resizes smoothly when the container dimensions animate.
Test edge case: lock editor pane, then lock shots pane — editor should smoothly shift right.
Import renderMediaOnWebcodecs (or equivalent) from @remotion/webcodecs.
Accept the ResolvedTimelineConfig and Remotion composition metadata (fps, resolution, duration).
Implement startRender():
a. Set renderStatus to 'rendering'.
b. Call the WebCodecs render function with the TimelineRenderer component and the resolved config as inputProps.
c. Report progress via onProgress callback → update renderProgress state.
d. On completion: convert output to Blob, create download URL, trigger browser download.
e. Set renderStatus to 'done' (or 'error' on failure).
Handle browser compatibility: check typeof VideoEncoder !== 'undefined' before attempting. Show toast if WebCodecs not supported.
WireuseClientRender into useTimelineData.ts:603-606, replacing the toast stub.
UpdateVideoEditorShell.tsx:135-139 Render button:
Show progress indicator when renderStatus === 'rendering' (e.g., spinner or progress bar).
Disable button during render.
Show download link when renderStatus === 'done'.
Reference: The existing Remotion composition (TimelineRenderer.tsx) already handles getRemotionEnvironment().isRendering to switch from <Video> to <OffthreadVideo> — this should work with WebCodecs rendering.
Execution Order
Steps 1–3 (Phase 1): independent UI fixes, no side effects, safe to parallelize.
Steps 6–7 (Phase 3): pane layout and render fixes are independent from drag-drop work.
Validation Order
Manual: drag an audio clip vertically to a visual track → see red reject indicator (Step 1).
Manual: select a text clip → only Effects/Timing/Position/Text tabs visible; select media clip → no Text tab; select audio clip → no Position/Text tab. Switch between clip types — active tab should never be invisible (Step 2).
Manual: double-click a media clip in preview overlay → lightbox opens if it has a generation source; double-click an external-upload clip → nothing happens (no error) (Step 3).
Visual comparison: same-row drag, cross-track drag, and external drop all produce visually identical indicators (same colors, borders, labels) (Step 4).
Manual: drag an audio file over a visual track → red indicator. Drag below all tracks → "Drop to create matching track" affordance appears (Step 5).
Manual: lock/unlock shots pane while editor pane is open → smooth left/right transition, no jump (Step 6).
Manual: click Render → progress indicator shown → video file downloads on completion (Step 7). Verify on a browser without WebCodecs support → graceful error toast.
Regression: drag generation from gallery to timeline → still works. Drag asset from panel to timeline → still works. Cross-track drag → still works.
code
Plan metadata:
{
"version": 2,
"timestamp": "2026-03-25T14:49:41Z",
"hash": "sha256:25f0bb356979ad687ee37063ae1eea28d9760668cdb23b4e8111c881a6d5e781",
"changes_summary": "Revision summary (v1 \u2192 v2):\n\n1. Step 6 rewritten (flag: external-drop-zone-step-misdiagnoses-gap): Removed the incorrect instruction to add CSS that already exists in timeline-overrides.css:65-83. Replaced with the real fix: unclamping rowIndex in getDropPosition() at useTimelineEditing.ts:243, adding new-track creation for external drops, and wiring the drop-target-new-track affordance. Merged into Step 5 alongside reject feedback since they're the same code path.\n\n2. Step 4 expanded (flag: drag-unification-misses-existing-internal-indicator): Now explicitly covers all three indicator systems: same-row move (TimelineEditor.tsx:45-50,146-185,216-245 with timeline-overrides.css:32-63), cross-track (useCrossTrackDrag.ts), and external (useTimelineEditing.ts). Plan specifies unifying via shared CSS classes rather than just matching colors.\n\n3. Step 2 expanded (flag: clip-panel-hidden-tab-state-not-handled): Added explicit activeTab clamping in PropertiesPanel.tsx:28-33 useEffect. Provided code example showing how to reset to 'effects' when current tab would be hidden for the new clip type. Covers the inverse of the existing text-clip auto-switch.\n\n4. Step 3 rewritten (flag: preview-lightbox-step-misses-generation-dependency): Now details the full data dependency chain: OverlayEditor only has registry \u2192 need generationId \u2192 need loadGenerationForLightbox query \u2192 need GenerationRow for MediaLightbox. Specifies lifting lightbox state to context/parent, reusing AssetPanel's query pattern, and graceful fallback for assets without generationId.\n\n5. Step 8 \u2192 Step 7, scoped down (flag: render-step-is-open-ended-scope-creep): Removed options A and B entirely. Locked to option C: disable button, add tooltip, remove onClick. No backend render work. Renumbered to Step 7 since the external drop zone step was merged into Step 5.\n\n6. Total steps reduced from 8 to 7 by merging the corrected drop-zone fix into the external drop rejection step.",
"flags_addressed": [
"external-drop-zone-step-misdiagnoses-gap",
"drag-unification-misses-existing-internal-indicator",
"clip-panel-hidden-tab-state-not-handled",
"preview-lightbox-step-misses-generation-dependency",
"render-step-is-open-ended-scope-creep"
],
"questions": [
"Issue 3 (double-click lightbox): Should double-clicking a media clip in the preview overlay open a lightbox showing the source generation, or should it do something else (e.g., open clip properties, start playback from that point)?",
"Issue 4 (pane locking view shifts): Is the fix just adding CSS transitions to smooth the shift, or should the editor pane NOT shift at all (e.g., overlay other panes)?"
],
"success_criteria": [
"Dragging a clip to an incompatible track type shows a red/warning visual indicator instead of silently rejecting",
"All three drag indicator systems (same-row move, cross-track, external drop) use consistent visual styling via shared CSS classes",
"ClipPanel only shows tabs relevant to the selected clip type, and activeTab is clamped when switching between clip types so the panel never shows an invisible tab",
"Double-clicking a media clip with a generation source in the preview overlay opens a lightbox; clips without a generation source gracefully do nothing",
"External drops below all tracks trigger new-track creation (matching internal cross-track behavior), with the existing 'Drop to create matching track' affordance visible during drag",
"Locking/unlocking adjacent panes while the editor pane is open results in smooth CSS transitions on left/right (no content jump)",
"The Render button is disabled with a 'Coming Soon' tooltip \u2014 no toast, no broken interaction",
"All existing drag-drop functionality (gallery to timeline, asset panel to timeline, cross-track) continues to work without regression"
],
"assumptions": [
"The 'broken Remotion render' refers to the startRender stub in useTimelineData.ts:603-606 \u2014 fix is option C (disable button) since no backend render contract exists",
"The 'double-click lightbox' means adding lightbox support for media clips in the preview overlay (OverlayEditor), with graceful no-op for assets without generationId",
"Type mismatch indicators apply to both internal cross-track drag AND external asset/generation drops onto the timeline",
"The 'text option filtering' means conditionally showing/hiding ClipPanel tabs AND clamping activeTab when switching between clip types",
"Pane locking view shift fix is a CSS transition smoothing fix, not a fundamental layout change",
"The 'internal/external drag consistency' covers all three indicator systems (same-row, cross-track, external drop), not just two",
"External drops below all tracks should create a new track (matching internal cross-track behavior), which requires unclamping rowIndex in getDropPosition"
],
"structure_warnings": [],
"delta_from_previous_percent": 67.92
}
code
Plan structure warnings from validator:
[]
Existing flags:
[
{
"id": "external-asset-kind-dragover-inference-wrong",
"concern": "Step 5's asset-panel dragover inference is incorrect: checking dataTransfer.types or hasDataTransferType('asset-kind') only tells you that an asset-kind entry exists, not whether the dragged asset is audio or visual.",
"status": "open",
"severity": "significant"
}
]
code
Requirements:
- Consider whether the plan is at the right level of abstraction.
- Reuse existing flag IDs when the same concern is still open.
- `verified_flag_ids` should list previously addressed flags that now appear resolved.
- Focus on concrete issues that would cause real problems.
- Robustness level: standard. Use balanced judgment. Flag significant risks, but do not spend flags on minor polish or executor-obvious boilerplate.
- Verify that the plan remains aligned with the user's original intent.
- Verify that the plan follows the expected structure: one H1 title, `## Overview`, numbered step sections (`### Step N:` under `## Phase` headers, or flat `## Step N:`) with file references and numbered substeps, plus `## Execution Order` or `## Validation Order`.
- Missing required sections or step coverage (for example: no H1, no `## Overview`, or no step sections at all) should be flagged as category `completeness` with severity_hint `likely-significant`.
- Structural formatting within steps (for example: prose instead of numbered substeps, or a missing file reference inside an otherwise actionable step) should usually be category `completeness` with severity_hint `likely-minor` because the executor can still follow the instructions.
- Ask whether the plan is the simplest approach that solves the stated problem, whether it could use fewer steps or less machinery, and whether it introduces unnecessary complexity.
- Over-engineering concerns should use category `maintainability`, should usually prefix the concern with "Over-engineering:", and should scale severity_hint to the practical impact.
- Flag scope creep explicitly when the plan grows beyond the original idea or recorded user notes. Use the phrase "Scope creep:" in the concern.
- Assign severity_hint carefully. Implementation details the executor will naturally resolve should usually be `likely-minor`.
{"flags":[{"id":"external-asset-kind-dragover-inference-wrong","concern":"Step 5's asset-panel dragover inference is still incorrect: checking dataTransfer.types or hasDataTransferType('asset-kind') only tells you that an asset-kind entry exists, not whether the dragged asset is audio or visual.","category":"correctness","severity_hint":"likely-significant","evidence":"/Users/user_c042661f/Documents/reigh-workspace/reigh-app/src/tools/video-editor/components/PropertiesPanel/AssetPanel.tsx:280-283 sets dataTransfer.setData('asset-key', assetKey) and dataTransfer.setData('asset-kind', kind). During dragover, the types list contains the key name asset-kind, not its stored value. The current timeline code at /Users/user_c042661f/Documents/reigh-workspace/reigh-app/src/tools/video-editor/hooks/useTimelineEditing.ts:557-560 already uses types only as a presence check."},{"id":"pane-shift-pattern-does-not-match-layoutmaincontent","concern":"Step 6 still does not follow the exact existing LayoutMainContent pattern the user called out: it keeps the editor pane on left/right positioning with transition-[left,right] instead of switching to the repo's marginLeft/marginRight plus transition-[margin,padding] approach.","category":"correctness","severity_hint":"likely-significant","evidence":"/Users/user_c042661f/Documents/reigh-workspace/reigh-app/src/app/components/LayoutMainContent.tsx:37-50 computes marginLeft, marginRight, paddingTop, and paddingBottom, and :63-68 applies transition-[margin,padding] duration-300 ease-smooth. EditorPaneTab still uses inline left and right at /Users/user_c042661f/Documents/reigh-workspace/reigh-app/src/features/editor/components/EditorPaneTab.tsx:124-127, and the plan text explicitly says to add transition-[left,right] rather than adopt the margin-based pattern."},{"id":"render-metadata-still-contradicts-plan-body","concern":"The plan body and plan metadata disagree on the render decision, which makes Step 7 ambiguous for execution and validation.","category":"correctness","severity_hint":"likely-significant","evidence":"The body of Step 7 now says to implement client-side rendering with @remotion/webcodecs, and Validation 7 says clicking Render should show progress and download a file. But the included metadata still says Step 8 → Step 7, scoped down ... option C: disable button, the success criteria still include The Render button is disabled with a 'Coming Soon' tooltip, and the assumptions still say the render fix is option C (disable button)."}],"verified_flag_ids":[],"disputed_flag_ids":[]}
You are an independent reviewer. Critique the plan against the actual repository.
Video editor tool fixes: 8 issues covering drag-drop unification (type mismatch indicators, internal/external drag consistency, drop zones), pane locking view shifts, broken Remotion render, text option filtering for non-text assets, and double-click lightbox
User notes and answers:
USER DECISION: T7 (render) must NOT just disable the button. Instead, implement actual client-side rendering using @remotion/webcodecs (browser-based WebCodecs API). The announcement-video repo uses @remotion/renderer via CLI (npx remotion render) but that's Node.js only. For browser, use @remotion/webcodecs which renders Remotion compositions in-browser. The existing startRender stub, renderStatus, renderProgress state in useTimelineData.ts is already wired. Implementation: install @remotion/webcodecs, implement startRender to call renderMedia equivalent, show progress, produce blob, trigger download. T6 (pane shift): must follow the EXACT existing pattern from LayoutMainContent.tsx which uses marginLeft/marginRight with transition-[margin,padding] duration-300 ease-smooth based on isShotsPaneLocked/isTasksPaneLocked and their widths from PanesContext.
See the add-note override for full details on both decisions.
The video editor (src/tools/video-editor/) has 8 issues across drag-drop UX, pane layout, rendering, property panel filtering, and lightbox interaction. The editor uses two distinct drag systems (pointer events for internal clip movement, HTML5 drag-drop for external assets), a Remotion-based preview, and integrates as both a standalone page and a compact sliding pane.
Key constraints:
Shared drag-drop utilities in src/shared/lib/dnd/dragDrop.ts must not break gallery/shot targets.
The @xzdarcy/react-timeline-editor library controls much of the internal clip movement UX; some drag-drop unification is limited by its API.
Render infrastructure is already partially wired: renderStatus, renderProgress, renderLog, renderDirty, setRenderStatus, setRenderProgress all exist in useTimelineData.ts:81-84,173-176 — startRender is the only stub.
Settled decisions:
Render (Step 7): Implement client-side rendering using @remotion/webcodecs (WebCodecs API in browser). The existing render state machinery is already wired through context.
Pane shift (Step 6): Follow the exact LayoutMainContent.tsx pattern — marginLeft/marginRight with transition-[margin,padding] duration-300 ease-smooth.
External drop rejection: Show reject indicator (red row highlight) on incompatible tracks, matching internal drag behavior.
Two drag systems stay: Unify visual indicators only; keep pointer-based internal and HTML5 external mechanisms.
Asset-kind dragover inference: Encode kind into dataTransfer type key (e.g., setData('asset-kind:audio', '')) so types array is readable during dragover without needing getData().
Phase 1: Low-Risk UI/UX Fixes (no data flow changes)
Step 1: Add type mismatch indicator to cross-track drag (useCrossTrackDrag.ts, timeline-overrides.css)
Scope: Small
InspectuseCrossTrackDrag.ts:180-183 — when targetTrack.kind !== session.sourceKind, the drop target is silently cleared with no visual feedback.
Implement a "reject" visual indicator in updateDropTarget(): when resolveDropTarget() (from coordinate-utils.ts:118-132) returns { kind: 'reject' }, show the highlight row with a red-tinted background (rgb(250 137 137 / 0.12) and border: 1px solid rgb(250 137 137 / 0.3)) and set cursor: not-allowed on the ghost element.
Add CSS class .cross-track-drop-reject to timeline-overrides.css for the reject indicator styling.
Ensuresession.targetRowId remains null and session.createTrackOnDrop remains false when rejected, so the drop handler still does nothing on incompatible tracks.
Step 2: Filter ClipPanel tabs and clamp activeTab on clip type change (ClipPanel.tsx, PropertiesPanel.tsx)
Scope: Small
InspectClipPanel.tsx:94-101 — all 5 tabs rendered regardless of clip.clipType. PropertiesPanel.tsx:28-33 auto-switches to text tab for text clips but never resets for non-text clips.
Compute visible tabs based on clip type and track kind:
clipType === 'text': show Effects, Timing, Position, Text (hide Audio).
track?.kind === 'audio': show Effects, Timing, Audio (hide Position, Text).
Otherwise (visual media): show Effects, Timing, Position, Audio (hide Text).
Clamp activeTab: In PropertiesPanel.tsx, expand the useEffect at :28-33 to also reset activeTab when switching to a non-text clip. If the current activeTab is not in the visible set for the new clip type, reset to 'effects'.
UpdateTabsList in ClipPanel.tsx to use grid-cols-{N} dynamically based on the visible tab count. Pass the visible tabs array as a prop or compute inside ClipPanel.
Step 3: Add double-click lightbox for media clips in preview (OverlayEditor.tsx, PreviewPanel.tsx)
Scope: Medium
Data dependency:MediaLightbox requires a GenerationRow object. The OverlayEditor currently receives registry: ResolvedTimelineConfig['registry'] (which maps asset keys to ResolvedAssetRegistryEntry containing generationId), but not the loaded GenerationRow data that the lightbox needs.
Reuse AssetPanel's generation query infrastructure: The loadGenerationForLightbox function and useQueries pattern in AssetPanel.tsx:49-97,167-183 already loads GenerationRow by generationId.
Implementation approach — lift lightbox state to context:
Add lightboxAssetKey: string | null and setLightboxAssetKey to the TimelineEditorContext (or add a simple useState in VideoEditorShell/PreviewPanel).
In OverlayEditor.tsx:389-390, change double-click handler:
tsx
onDoubleClick={() => {
if (clipMeta?.clipType === 'text') {
beginTextEdit(overlay.actionId);
} else if (clipMeta?.asset) {
onDoubleClickAsset?.(clipMeta.asset);
}
}}
Add onDoubleClickAsset?: (assetKey: string) => void to OverlayEditorProps.
Wire from PreviewPanel.tsx → OverlayEditor the callback that sets lightboxAssetKey.
Lightbox rendering: Render the MediaLightbox in PreviewPanel.tsx (or VideoEditorShell), using loadGenerationForLightbox for the selected asset's generationId. Only enable when registry[assetKey]?.generationId exists and the query succeeds.
Graceful fallback: If an asset has no generationId (external upload without generation record), double-click does nothing (no lightbox button, no error). This matches AssetPanel's existing behavior where the source button is hidden for non-generation assets.
Phase 2: Drag-Drop Unification
Step 4: Unify all three drag indicator systems (TimelineEditor.tsx, useCrossTrackDrag.ts, useTimelineEditing.ts, timeline-overrides.css)
Scope: Medium
Audit the three indicator systems:
Same-row move indicator (internal): TimelineEditor.tsx:45-50,146-185,216-245 renders a dragIndicator React state overlay with CSS classes .drop-position-ghost, .drop-position-line, .drop-position-label (styled in timeline-overrides.css:32-63).
Cross-track indicator (internal pointer): useCrossTrackDrag.ts:186-198 creates DOM elements (.cross-track-drop-highlight, .cross-track-ghost) with inline styles using rgb(137 180 250 / 0.12).
External drop indicator (HTML5 drag): useTimelineEditing.ts:153-217 creates DOM elements with inline styles using rgba(137,180,250,0.08) for row highlight, #89b4fa for line, etc.
Unify styling by defining shared CSS classes in timeline-overrides.css:
Reject variant: .drop-indicator-row--reject (red tint from Step 1).
Refactor the external drop indicator (useTimelineEditing.ts:153-217) to use the same CSS classes as the same-row indicator from timeline-overrides.css:32-63. Replace inline styles with class assignments.
Refactor the cross-track indicator (useCrossTrackDrag.ts:186-198) to use the same CSS classes. Replace inline style.background = 'rgb(137 180 250 / 0.12)' with the shared .drop-indicator-row class.
Result: All three systems produce visually identical indicators — same colors, same border radius, same label format.
Step 5: Add drop rejection feedback and new-track support for external drops (useTimelineEditing.ts, AssetPanel.tsx)
Scope: Medium
Fix row index clamping in getDropPosition() (useTimelineEditing.ts:243): currently Math.min(raw, rowCount - 1) prevents external drops from targeting "below all tracks." Change to allow rowIndex >= rowCount when raw >= rowCount, matching useCrossTrackDrag.ts:174 behavior.
Add new-track creation for external drops in onTimelineDrop (useTimelineEditing.ts:626+): when rowIndex >= rowCount, instead of resolving to an existing track, create a new track of the appropriate kind and drop the clip there. Mirror the createTrackAndMoveClip pattern from cross-track drag.
Fix asset-kind dragover inference — the DataTransfer API does not expose getData() values during dragover, only the type key names in the types list. Current code at AssetPanel.tsx:280-283 sets setData('asset-kind', kind) but during dragover only 'asset-kind' appears in types, not the value 'audio' or 'visual'.
Fix in AssetPanel.tsx:280-283: encode the kind into the type key itself:
tsx
onDragStart={(event) => {
event.dataTransfer.setData('asset-key', assetKey);
event.dataTransfer.setData(`asset-kind:${kind}`, ''); // kind readable from types list
}}
Read during dragover in onTimelineDragOver (useTimelineEditing.ts:556-619): scan dataTransfer.types for entries matching asset-kind:audio or asset-kind:visual to determine the dragged asset's kind without calling getData().
For generation drags: always visual.
For file drags: dataTransfer.items[i].type MIME prefix is available during dragover — audio/* → audio, else visual.
When hovered track is incompatible with inferred kind: tint the row indicator red using the reject style from Step 4.
Follow the exact pattern from LayoutMainContent.tsx:37-50,63-68: The main content uses marginLeft/marginRight (not left/right) with transition-[margin,padding] duration-300 ease-smooth.
RefactorEditorPaneTab.tsx:124-133 — replace the inline left/right positioning with marginLeft/marginRight:
Key changes: add left-0 right-0 to className (baseline positioning), move pane offsets to marginLeft/marginRight in style, replace transition-transform with transition-[margin,padding].
Remove the horizontalOffset computation at EditorPaneTab.tsx:71-73 and the PaneControlTabposition.horizontalOffset prop at :92 — these become unnecessary since the pane itself now handles margin-based offsets. (Verify PaneControlTab still positions its tab correctly; it may need its own margin adjustment or can use the pane's bounding rect.)
Verify the Remotion Player (width: '100%' in RemotionPreview.tsx:109) resizes smoothly when the container margins animate.
Scope: Large
Context: The existing render state machinery is already wired: renderStatus ('idle' | 'rendering' | 'done' | 'error'), renderProgress ({ current, total, percent, phase }), renderLog, renderDirty are all defined in useTimelineData.ts:81-84,173-176 and exposed through context. Only startRender (useTimelineData.ts:603-606) is a stub.
Accept: setRenderStatus, setRenderProgress, setRenderLog state setters (already in UseTimelineDataResult).
Implement startRender():
a. Guard: check typeof VideoEncoder !== 'undefined'. If not supported, toast.error('WebCodecs not supported in this browser') and return.
b. Set renderStatus to 'rendering', clear renderProgress.
c. Call WebCodecs render with the TimelineRenderer component and resolved config as inputProps.
d. Report progress via onProgress → update renderProgress with { current, total, percent, phase }.
e. On completion: produce Blob, create URL.createObjectURL, trigger browser download via a temporary <a> element.
f. Set renderStatus to 'done'.
g. On error: set renderStatus to 'error', append to renderLog.
Wire into useTimelineData.ts:603-606: replace the toast stub in startRender with a call to the useClientRender hook's render function. The hook should be called inside useTimelineData or composed alongside it.
UpdateVideoEditorShell.tsx:135-139 Render button:
Disable during render (renderStatus === 'rendering').
Show progress (e.g., renderProgress?.percent as a mini progress bar or percentage label).
On completion, offer download link.
Note: The existing TimelineRenderer.tsx already checks getRemotionEnvironment().isRendering to switch <Video> → <OffthreadVideo> — this should work correctly with WebCodecs rendering.
Execution Order
Steps 1–3 (Phase 1): independent UI fixes, no side effects, safe to parallelize.
Step 7 (Phase 3): render implementation depends on no other steps but is the largest piece of work.
Validation Order
Manual: drag an audio clip vertically to a visual track → see red reject indicator (Step 1).
Manual: select a text clip → only Effects/Timing/Position/Text tabs visible; select media clip → no Text tab; select audio clip → no Position/Text tab. Switch between clip types — active tab should never be invisible (Step 2).
Manual: double-click a media clip in preview overlay → lightbox opens if it has a generation source; double-click an external-upload clip → nothing happens (no error) (Step 3).
Visual comparison: same-row drag, cross-track drag, and external drop all produce visually identical indicators (same colors, borders, labels) (Step 4).
Manual: drag an audio file over a visual track → red indicator. Drag below all tracks → "Drop to create matching track" affordance appears. Drop creates new track (Step 5).
Manual: lock/unlock shots pane while editor pane is open → smooth margin transition, no jump. Matches LayoutMainContent behavior (Step 6).
Manual: click Render → progress indicator shown → video file downloads on completion. Test on browser without WebCodecs → graceful error toast (Step 7).
Regression: drag generation from gallery to timeline → still works. Drag asset from panel to timeline → still works (verify new asset-kind:visual format doesn't break drop handler). Cross-track drag → still works.
code
Plan metadata:
{
"version": 3,
"timestamp": "2026-03-25T15:11:47Z",
"hash": "sha256:c66248272eaa4d8c9bfae05e8ca6c7e4e060de4a1134af8dff5f39817183c149",
"changes_summary": "Revision summary (v2 \u2192 v3):\n\n1. Step 5 rewritten for asset-kind dragover (flag: external-asset-kind-dragover-inference-wrong): Specified the exact DataTransfer API workaround \u2014 encode kind into the type key itself (setData('asset-kind:audio', '') in AssetPanel.tsx:280-283) so types array exposes the kind during dragover without needing getData(). Updated both the drag source and the dragover reader. Added note to also update the onDrop handler to read the new format.\n\n2. Step 6 rewritten for margin pattern (flag: pane-shift-pattern-does-not-match-layoutmaincontent): Now explicitly follows the LayoutMainContent.tsx:37-50,63-68 pattern: uses marginLeft/marginRight (not left/right) with transition-[margin,padding] duration-300 ease-smooth. Includes exact code showing the refactored style/className. Notes removal of now-unnecessary horizontalOffset computation.\n\n3. Metadata aligned with plan body (flag: render-metadata-still-contradicts-plan-body): Updated all success criteria, assumptions, and settled decisions to reflect @remotion/webcodecs client-side rendering (not option C disable button). Removed all "Coming Soon" / "disable button" language from metadata fields.",
"flags_addressed": [
"external-asset-kind-dragover-inference-wrong",
"pane-shift-pattern-does-not-match-layoutmaincontent",
"render-metadata-still-contradicts-plan-body"
],
"questions": [],
"success_criteria": [
"Dragging a clip to an incompatible track type shows a red/warning visual indicator instead of silently rejecting",
"All three drag indicator systems (same-row move, cross-track, external drop) use consistent visual styling via shared CSS classes",
"ClipPanel only shows tabs relevant to the selected clip type, and activeTab is clamped when switching between clip types so the panel never shows an invisible tab",
"Double-clicking a media clip with a generation source in the preview overlay opens a lightbox; clips without a generation source gracefully do nothing",
"External drops below all tracks trigger new-track creation (matching internal cross-track behavior), with the existing 'Drop to create matching track' affordance visible during drag",
"Locking/unlocking adjacent panes while the editor pane is open results in smooth margin transitions matching the LayoutMainContent pattern (marginLeft/marginRight with transition-[margin,padding] duration-300 ease-smooth)",
"Clicking Render triggers client-side WebCodecs rendering with progress display and browser download on completion; browsers without WebCodecs support get a graceful error toast",
"All existing drag-drop functionality (gallery to timeline, asset panel to timeline, cross-track) continues to work without regression"
],
"assumptions": [
"The 'broken Remotion render' is fixed by implementing client-side rendering via @remotion/webcodecs \u2014 the existing render state machinery (renderStatus, renderProgress, etc.) in useTimelineData.ts is already wired and just needs startRender implemented",
"The 'double-click lightbox' means adding lightbox support for media clips in the preview overlay (OverlayEditor), with graceful no-op for assets without generationId",
"Type mismatch indicators apply to both internal cross-track drag AND external asset/generation drops onto the timeline",
"The 'text option filtering' means conditionally showing/hiding ClipPanel tabs AND clamping activeTab when switching between clip types",
"Pane locking view shift follows the exact LayoutMainContent.tsx pattern: marginLeft/marginRight with transition-[margin,padding] duration-300 ease-smooth",
"The 'internal/external drag consistency' covers all three indicator systems (same-row, cross-track, external drop), not just two",
"External drops below all tracks should create a new track (matching internal cross-track behavior), which requires unclamping rowIndex in getDropPosition",
"Asset-kind during dragover is solved by encoding kind into the dataTransfer type key (e.g., 'asset-kind:audio') since getData() is not available during dragover events"
],
"structure_warnings": [],
"delta_from_previous_percent": 26.02
}
code
Plan structure warnings from validator:
[]
Existing flags:
[
{
"id": "external-asset-kind-dragover-inference-wrong",
"concern": "Step 5's asset-panel dragover inference is still incorrect: checking dataTransfer.types or hasDataTransferType('asset-kind') only tells you that an asset-kind entry exists, not whether the dragged asset is audio or visual.",
"status": "addressed",
"severity": "significant"
},
{
"id": "pane-shift-pattern-does-not-match-layoutmaincontent",
"concern": "Step 6 still does not follow the exact existing LayoutMainContent pattern the user called out: it keeps the editor pane on left/right positioning with transition-[left,right] instead of switching to the repo's marginLeft/marginRight plus transition-[margin,padding] approach.",
"status": "addressed",
"severity": "significant"
},
{
"id": "render-metadata-still-contradicts-plan-body",
"concern": "The plan body and plan metadata disagree on the render decision, which makes Step 7 ambiguous for execution and validation.",
"status": "addressed",
"severity": "significant"
}
]
code
Requirements:
- Consider whether the plan is at the right level of abstraction.
- Reuse existing flag IDs when the same concern is still open.
- `verified_flag_ids` should list previously addressed flags that now appear resolved.
- Focus on concrete issues that would cause real problems.
- Robustness level: standard. Use balanced judgment. Flag significant risks, but do not spend flags on minor polish or executor-obvious boilerplate.
- Verify that the plan remains aligned with the user's original intent.
- Verify that the plan follows the expected structure: one H1 title, `## Overview`, numbered step sections (`### Step N:` under `## Phase` headers, or flat `## Step N:`) with file references and numbered substeps, plus `## Execution Order` or `## Validation Order`.
- Missing required sections or step coverage (for example: no H1, no `## Overview`, or no step sections at all) should be flagged as category `completeness` with severity_hint `likely-significant`.
- Structural formatting within steps (for example: prose instead of numbered substeps, or a missing file reference inside an otherwise actionable step) should usually be category `completeness` with severity_hint `likely-minor` because the executor can still follow the instructions.
- Ask whether the plan is the simplest approach that solves the stated problem, whether it could use fewer steps or less machinery, and whether it introduces unnecessary complexity.
- Over-engineering concerns should use category `maintainability`, should usually prefix the concern with "Over-engineering:", and should scale severity_hint to the practical impact.
- Flag scope creep explicitly when the plan grows beyond the original idea or recorded user notes. Use the phrase "Scope creep:" in the concern.
- Assign severity_hint carefully. Implementation details the executor will naturally resolve should usually be `likely-minor`.
Not yet included in a published release.
When rowIndex >= rowCount: show the drop-target-new-track class on the edit area (already styled in timeline-overrides.css:69-83).
Update drop handlers at useTimelineEditing.ts:643-646 (file drops) and :734-738 (asset drops) to handle the new-track case when rowIndex >= rowCount. Also update the onDrop asset-kind reading to match the new asset-kind:${kind} format.