Execute the approved plan in the repository. Project directory:…
Private research annotation
Sign in to add a private research label or note.
- User
Execute the approved plan in the repository.
codeProject directory: /Users/user_c042661f/Documents/announcement-video Idea:Two features for the timeline editor:
FEATURE 1 - TRACK SETTINGS POPOVER: Each track label on the left side of the timeline should have a gear/settings button that opens a popover or inline panel for setting default properties for that track. For visual tracks: scale, fit (cover/contain/manual), opacity, blend mode. For audio tracks: volume, opacity. These are the DEFAULT settings - any clip on the track inherits them unless the clip has its own override. The TrackPanel component already exists in viewer/src/TrackPanel.tsx but it's in the right sidebar which is disconnected from the track labels. Instead, the settings should be accessible directly from the track label - either as a popover that opens when you click a gear icon, or as an expandable section below the track label. The track label currently just shows ID + name at 56px height matching ROW_HEIGHT. Need to keep the height aligned with timeline rows while still providing access to settings.
FEATURE 2 - VISUAL CLIP POSITIONING ON CANVAS: Users should be able to drag and resize how a clip appears on the video preview canvas. Like in Premiere/After Effects - click a clip, then drag it on the preview to reposition, or drag corners to resize/zoom. This should work for clips on any visual track. The OverlayEditor.tsx already has some of this for overlay clips but it needs to work for ALL visual clips. When a clip is selected in the timeline, the preview should show handles/bounds that let you: drag to reposition (updates clip x/y), drag corners to resize (updates clip width/height), optionally crop by holding a modifier key. The positioning is in content coordinates (1280x720) and gets stored as x/y/width/height on the clip in timeline.json. If a clip has no position set, it uses the track's fit setting (cover/contain). Once you manually position it, it overrides the track default.
CONSTRAINTS: Keep the track label height at ROW_HEIGHT (56px) to stay aligned with timeline rows. Settings popover should appear on click, not permanently expand. Canvas positioning must work with the Remotion Player (overlay div on top of it, convert mouse coords to content coords accounting for scale). All changes persist to timeline.json.
codeExecution tracking source of truth (`finalize.json`): {"tasks": [ { "id": "T1", "description": "Extract track settings into a reusable TrackSettingsBody component. In viewer/src/TrackPanel.tsx, extract the settings fields (scale, fit, blend mode, opacity \u2014 lines ~56-114) into a new exported component
TrackSettingsBodywith props{ track: TrackDefinition; onChange: (patch: Partial<TrackDefinition>) => void }. The existing TrackPanel component should wrap TrackSettingsBody so the right sidebar continues working unchanged. Audio tracks should show only opacity (no volume \u2014 deliberately descoped). Visual tracks show scale, fit, blend mode, opacity.", "depends_on": [], "status": "pending", "executor_notes": "", "reviewer_verdict": "" }, { "id": "T2", "description": "Create TrackSettingsPopover component with portaled rendering and gear icon trigger. New file: viewer/src/TrackSettingsPopover.tsx. Key requirements: (1) Renders via ReactDOM.createPortal(\u2026, document.body) to escape .track-labels overflow:hidden (App.css:241). (2) Positions using anchorRef.current.getBoundingClientRect() \u2014 appears to the right of the gear icon. (3) Contains TrackSettingsBody from T1. (4) Closes on click-outside (mousedown on document) and Escape key. (5) Gear button toggles open/closed state internally. Props: { track, onChange: (trackId, patch) => void, anchorRef }. CSS: .track-settings-popover with fixed position, dark bg (var(--bg-surface)), border, box-shadow, ~220px wide, z-index: 1000. Reuse existing .track-panel-field and .track-panel-slider-row styles.", "depends_on": [ "T1" ], "status": "pending", "executor_notes": "", "reviewer_verdict": "" }, { "id": "T3", "description": "Wire popover into track labels in App.tsx and add trackId-parameterized onChange handler. In App.tsx: (1) Add handleTrackPopoverChange callback that takes explicit (trackId, patch) \u2014 do NOT rely on selectedTrackId. Use applyResolvedConfigEdit to persist. (2) Update track label render loop (~lines 1231-1241): wrap inner content in flex row \u2014 left: ID+name stacked, right: TrackSettingsPopover component (renders its own gear button). Keep outer div at height: ROW_HEIGHT (56px). The portal renders outside DOM hierarchy so no height change. (3) Add CSS: .track-label-row (flex row), .track-label-gear (small icon, visible on hover or when popover open, opacity transition). Pass track and handleTrackPopoverChange to each popover instance.", "depends_on": [ "T2" ], "status": "pending", "executor_notes": "", "reviewer_verdict": "" }, { "id": "T4", "description": "Update VisualClip.tsx renderer to support clip-level position overrides on any track fit mode. In shared/compositions/VisualClip.tsx (lines 15-35), modify getClipBoxStyle(): if clip has ANY explicit position fields (x, y, width, or height defined), use absolute positioning with those values (defaulting x:0, y:0, width:320, height:240 for missing fields). Otherwise fall back to track fit mode (cover/contain). This is the 'clip overrides track default' behavior \u2014 no track.fit change needed, just clip-level fields trigger manual positioning.", "depends_on": [], "status": "pending", "executor_notes": "", "reviewer_verdict": "" }, { "id": "T5", "description": "Extend OverlayEditor to show drag/resize handles for all selected visual clips, with letterbox-aware coordinate math. In viewer/src/OverlayEditor.tsx: (1) Add props: selectedClipId, onSelectClip. (2) Modify activeOverlays computation (~line 60-96): if a clip matches selectedClipId, is on a visual track, and is active at current time, include it even without x/y \u2014 use default bounds {x:0, y:0, width:1280, height:720}. (3) Handle first-drag initialization: when starting drag on a clip with no x/y, immediately patch clip with full-frame bounds via onOverlayChange, writing x/y/width/height to timeline.json. (4) Fix coordinate projection for letterboxing: replace computeLayout() container measurement with letterbox-aware math that computes actual video rect from container aspect ratio vs composition aspect ratio (1280/720). Scale factors = videoW/compositionWidth and videoH/compositionHeight. The Remotion Player renders internally at full resolution and scales down, so clip data stays in 1280\u00d7720 content coords \u2014 the overlay editor just needs screen\u2194content conversion that accounts for where the video actually renders within the container. (5) Wire in App.tsx: pass selectedClipId and onSelectClip={setSelectedClipId} to OverlayEditor.", "depends_on": [ "T4" ], "status": "pending", "executor_notes": "", "reviewer_verdict": "" }, { "id": "T6", "description": "Move track reorder/remove buttons into popover and remove TrackPanel from sidebar. (1) Add reorder (\u2191/\u2193) and remove (\u00d7) buttons to popover header in TrackSettingsPopover.tsx \u2014 pass onReorder and onRemove callbacks from App. (2) Include the track label/name input in the popover so rename capability is preserved (currently at TrackPanel.tsx:46). (3) Remove TrackPanel from right sidebar in App.tsx (~lines 1217-1225). Right sidebar keeps only AssetPanel and ClipPanel. IMPORTANT: verify the track label rename input is accessible in the popover before removing the sidebar panel.", "depends_on": [ "T3" ], "status": "pending", "executor_notes": "", "reviewer_verdict": "" } ], "watch_items": [ "OVERFLOW CLIPPING: .track-labels has overflow:hidden (App.css:241). The popover MUST use ReactDOM.createPortal to document.body \u2014 absolute positioning within the track-labels div will be clipped.", "TRACK TARGETING: handleTrackPropertyChange (App.tsx:883) uses selectedTrackId. The popover must use its own trackId-parameterized handler, not the existing one, or it will edit the wrong track.", "ROW HEIGHT ALIGNMENT: Track labels must stay exactly at ROW_HEIGHT (56px). The gear icon and popover trigger must fit within this height. The portal renders outside the DOM so it won't affect height.", "RENDERER GATE: VisualClip.tsx getClipBoxStyle() (lines 15-35) currently ignores clip x/y/width/height unless track.fit === 'manual'. T4 must land before T5 or canvas positioning won't render.", "COORDINATE SPACES: Clip data is in 1280\u00d7720 content coords. The Remotion Player renders at PREVIEW_SCALE (0.5\u00d7) and may letterbox. The overlay editor must compute the actual video rect within the container (not just use container bounds) and convert mouse coords accordingly.", "LETTERBOX MATH: Use aspect-ratio calculation (containerAR vs videoAR) to find video rect, not DOM queries like [data-remotion-canvas] which may be fragile across Remotion versions.", "FIRST-DRAG INITIALIZATION: When a clip has no position and user drags it on canvas, write full-frame defaults (0,0,1280,720) immediately on mousedown, before computing drag delta. Otherwise the first drag will have no baseline.", "TRACK LABEL RENAME REGRESSION: TrackPanel.tsx:46 has a label input. If T6 removes the sidebar TrackPanel, this rename capability must be preserved in the popover.", "AUDIO VOLUME DESCOPED: The original idea requested volume for audio tracks. This plan deliberately omits it because it requires changes to serialize.ts (TRACK_DEFINITION_FIELDS), validateSerializedConfig, and AudioTrack.tsx runtime. Audio tracks get only opacity in the popover. This is a known gap for follow-up.", "SCOPE CREEP: T6 (sidebar removal) goes beyond the two requested features. It's low-risk cleanup but should be skipped if it introduces instability.", "EXISTING OVERLAY CLIPS: OverlayEditor already handles text/positioned clips. T5 must not break that existing behavior while adding support for all visual clips." ], "sense_checks": [ { "id": "SC1", "task_id": "T1", "question": "Does the right sidebar TrackPanel still render and function identically after the extraction? Are all controls (scale, fit, blend mode, opacity) present and working?", "verdict": "" }, { "id": "SC2", "task_id": "T2", "question": "Does the popover render via portal to document.body (check DOM inspector \u2014 it should be a direct child of body, not inside .track-labels)? Is it positioned correctly relative to the gear icon and not clipped?", "verdict": "" }, { "id": "SC3", "task_id": "T3", "question": "Click gear on track V2 while track V1 is selected \u2014 does the popover edit V2's properties (not V1's)? Do track labels remain exactly 56px tall with no layout shift when the popover opens?", "verdict": "" }, { "id": "SC4", "task_id": "T4", "question": "Manually add {"x":100,"y":50,"width":640,"height":360} to a clip on a 'contain' track in timeline.json \u2014 does Remotion preview show it at that position? Remove the fields \u2014 does it revert to contain behavior?", "verdict": "" }, { "id": "SC5", "task_id": "T5", "question": "Select a full-frame video clip on a contain track in the timeline. Does a bounding box appear on the preview canvas? Drag to reposition \u2014 do x/y appear on the clip in timeline.json? Drag a corner \u2014 do width/height update? Resize the browser window \u2014 do handles still align with the video (not offset by letterbox bars)?", "verdict": "" }, { "id": "SC6", "task_id": "T6", "question": "Can you still rename a track after the sidebar TrackPanel is removed? Is the label input accessible in the popover? Do reorder and remove buttons work from the popover?", "verdict": "" } ], "meta_commentary": "EXECUTION ORDER: T1 \u2192 T2 \u2192 T3 delivers Feature 1 (track settings popover). T4 \u2192 T5 delivers Feature 2 (canvas positioning). T4 has no dependencies on T1-T3, so it can run in parallel with the popover work. T6 is cleanup that depends on T3 being stable.\n\nKEY JUDGMENT CALLS:\n- Audio track volume is deliberately omitted. It needs serialize.ts field registration, validation schema updates, and AudioTrack.tsx runtime changes \u2014 a separate feature. The executor should note this for follow-up.\n- The coordinate math flag ("overlay-coordinate-math-under-scoped") is overstated in the critique. The Remotion Player internally renders at full 1280\u00d7720 and CSS-scales down. Clip data stays in content coords. The overlay editor just needs screen\u2194content conversion that accounts for letterboxing, which the plan's aspect-ratio calculation handles. The 0.5\u00d7 PREVIEW_SCALE is a CSS transform, not a coordinate-space issue.\n- Step 5/T6 (sidebar removal) is scope creep but low risk. Skip it if the popover is working well and the sidebar isn't causing issues. The critical thing is to NOT lose the track rename input if you do proceed.\n\nGOTCHAS:\n- The popover close-on-click-outside handler must use mousedown (not click) to avoid the popover closing when you mousedown on a slider and mouseup outside it.\n- When computing letterbox rect, both pillarbox (wider container) and letterbox (taller container) cases must be handled.\n- First-drag initialization must write to timeline.json synchronously before computing drag offsets, or the drag will jump on the second move event.\n- The existing OverlayEditor filters at lines 77-79 skip non-positioned clips. T5 must relax this filter for the selectedClipId while keeping it for non-selected clips (you don't want handles on every visible clip, just the selected one).\n\nFILES TO READ BEFORE STARTING: viewer/src/TrackPanel.tsx, viewer/src/OverlayEditor.tsx, viewer/src/App.tsx (track label render ~1230-1242, handleTrackPropertyChange ~883, onOverlayChange ~672), viewer/src/App.css (~234-277 track label styles), shared/compositions/VisualClip.tsx (getClipBoxStyle ~15-35), viewer/src/RemotionPreview.tsx (~42-43 for PREVIEW_SCALE), shared/types.ts (~72-75 for clip position fields)." } - Assistant