Polish and integrate video editor into Reigh: full-screen editor page (hide GlobalHeader, use all vertical space), suppress EditorPane on editor route, drag from GenerationsPane into timeline/assets (variant-level), assets panel collapsed by default, generation variant click-through, aesthetic polish
User notes and answers:
CRITICAL FORMAT: Use FLAT ## Step N: headings at h2 level. NO ## Phase headers pushing steps to h3.
DETAILED CONTEXT:
FULL-SCREEN EDITOR PAGE:
Currently VideoEditorPage renders inside Layout which has GlobalHeader (~60px), plus padding from panes
Layout is at src/app/Layout.tsx, GlobalHeader at src/shared/components/GlobalHeader/
LayoutMainContent at src/app/components/LayoutMainContent.tsx handles margins/padding from locked panes
The editor page should hide GlobalHeader and use 100vh. Add a minimal back bar (e.g. small "← Back" link + timeline name)
Check useLocation().pathname in Layout to conditionally hide GlobalHeader on /tools/video-editor
The VideoEditorShell.tsx currently renders a CSS grid layout - it needs to fill all available space
EDITOR PANE SUPPRESSION:
EditorPaneTab.tsx is at src/features/editor/components/EditorPaneTab.tsx
It has EditorPaneControlTab (the floating dots/buttons) and EditorPaneSurface (the slide-down pane)
The plan said to check useLocation().pathname === '/tools/video-editor' and return null
This was supposedly implemented but the dots still show - need to verify and fix
The control tab dots are at the top center of the page
DRAG FROM GENERATIONS PANE:
The app uses @dnd-kit for drag and drop
GenerationsPane is at src/features/gallery/components/GenerationsPane/
Look at how shot timeline drag works - items are dragged from gallery into shots
ShotImageManager components handle drag targets for the shots timeline
The drag data should include: variant location URL, variant type (image/video), variant ID, generation ID
On drop into timeline: upload/register the asset in the timeline's asset_registry, then create a clip
On drop into assets panel: just register the asset without creating a clip
Must work at VARIANT level - use generation_variants table, not generations
Assistant
User
Assistant
Re-checking the revised plan against the repo now. I’m verifying which of the earlier concerns are actually resolved and whether the remaining gaps are concrete enough to matter.
Assistant
I’ve narrowed this to one remaining implementation risk and one residual format issue. The revised plan fixed most of the earlier repository mismatches.
Assistant
{"flags":[{"id":"generations-pane-not-variant-level","concern":"The plan still does not identify a concrete repository-backed source for the primary variant ID/URL at drag time. In the current GenerationsPane data flow, gallery items are generation records, and the fields needed to drag the primary generation_variants row are not actually present on image today.","category":"correctness","severity_hint":"likely-significant","evidence":"src/shared/hooks/projects/useProjectGenerations.ts:287-304 selects generation fields from generations but does not select primary_variant_id or join generation_variants. src/shared/lib/generationTransformers.ts:146-169 defines without , and transforms generations without adding any top-level . also has no primary-variant field on . The revised Step 4 says to read or similar, but this repository path does not currently provide that data."},{"id":"step-file-references-missing","concern":"Some step sections still do not include a file reference in backticks, so the plan does not fully satisfy the per-step file-reference requirement.","category":"completeness","severity_hint":"likely-minor","evidence":"The validator warning remains: Steps such as , , and are validation-only sections and do not cite any file paths."}],"verified_flag_ids":["flat-step-format-missing","route-gating-hides-timeline-list","fullscreen-layout-still-constrained","drag-plan-targets-wrong-source","asset-registry-registration-not-persisted"],"disputed_flag_ids":[]}
AssetPanel is at src/tools/video-editor/components/PropertiesPanel/AssetPanel.tsx
It likely has a collapsible section - just change default open state to false
Similar to how other collapsible panels work in the app
GENERATION VARIANT CLICK-THROUGH:
When an asset in the editor came from a generation variant, store the variant_id and generation_id in the asset registry entry
On click, open the MediaLightbox or navigate to the gallery with that variant selected
MediaLightbox is at src/shared/components/MediaLightbox/
AESTHETIC POLISH:
Use bg-background, text-foreground, border-border etc instead of hardcoded zinc colors
Ensure the editor matches Reigh's dark theme with warm accents
The editor should feel like a native Reigh tool, not a foreign embed
code
Plan:
# Implementation Plan: Video Editor Full-Screen Integration & Polish
Overview
The video editor (/tools/video-editor) currently renders inside the standard Layout with GlobalHeader (~60px), EditorPane dots, and pane-margin padding — wasting vertical space and creating visual clutter. This plan makes the editor page full-screen with a minimal back bar, suppresses redundant chrome, enables drag from GenerationsPane into the timeline at variant level, collapses the assets panel by default, adds generation click-through from assets, and applies aesthetic polish.
Key architectural facts from audit:
LayoutMainContent.tsx renders GlobalHeader (line 52) and applies paddingTop for editor pane (line 38)
EditorPaneTab.tsx:66-68 already returns null on /tools/video-editor but the control dots may render separately
Timeline drop uses HTML5 dataTransfer (not @dnd-kit) — onTimelineDrop in useTimelineEditing.ts:530-626 checks for asset-key type
DraggableImage.tsx has drag disabled (draggable={false}) — the wrapper blocks all gallery drag
AssetRegistryEntry type has only file, type, duration, resolution, fps — no generation/variant fields
Assets panel defaults to useState(true) at PropertiesPanel.tsx:25
MediaLightbox is a controlled component opened via props, not routes
Add a route check in LayoutMainContent.tsx using useLocation().pathname to detect /tools/video-editor.
Conditionally hideGlobalHeader (line 52) when on the editor route — return null or skip render.
Zero out padding/margins from pane offsets (paddingTop at line 38, side margins at lines 58-68) when on editor route.
VerifyEditorPaneTab.tsx:66-68 null return is working. If EditorPaneControlTab (the dots at top-center) renders through a separate path outside EditorPaneComponent, trace and suppress that too. Check if EditorPane is the component at Layout.tsx:123 — if so the null return should already handle it. If dots come from a different component, find and suppress.
Step 2: Make VideoEditorShell fill viewport (src/tools/video-editor/components/VideoEditorShell.tsx, src/tools/video-editor/pages/VideoEditorPage.tsx)
Scope: Small
UpdateVideoEditorPage.tsx to render the shell in a h-screen w-screen container with no extra padding.
UpdateFullEditorLayout in VideoEditorShell.tsx (lines 100-167) to use h-full or flex-1 so the CSS grid fills the parent. Currently the grid has fixed heights — ensure it stretches.
Add a minimal back bar at top: a small fixed-height row (~32-40px) with ← Back to [tool] link (navigates to previous page or /) and the timeline name from context. Style with bg-background border-b border-border text-foreground.
Step 3: Validate full-screen layout
Scope: Small
Run the app and confirm: no GlobalHeader, no editor dots, full viewport usage, back bar renders with timeline name.
Check that navigating away from /tools/video-editor restores normal layout (GlobalHeader, pane margins, editor dots).
Phase 2: Drag from GenerationsPane into Timeline
Step 4: Extend AssetRegistryEntry type (src/tools/video-editor/types/index.ts)
Scope: Small
Add optional fields to AssetRegistryEntry (line 105-111):
typescript
generationId?: string;
variantId?: string;
These fields enable click-through to the source generation later (Step 8).
Step 5: Re-enable and extend DraggableImage for video editor drag (src/features/gallery/components/)
Scope: Medium
FindDraggableImage.tsx (currently has draggable={false}). Re-enable drag by setting draggable={true}.
Update the onDragStart handler to set HTML5 dataTransfer data compatible with the timeline's drop handler:
variant-url: the resolved variant image/video URL
variant-type: 'image' or 'video'
variant-id: the variant's ID from generation_variants
generation-id: the parent generation's ID
asset-kind: inferred from file type ('image' or 'video') — needed for existing timeline drop logic
Ensure drag operates at variant level: the gallery already renders per-variant items through MediaGalleryItem. Each item should encode its specific variant data, not just the generation.
Set a drag preview image using createDragPreview() (the existing function referenced at line 273 of MediaGalleryItem).
Step 6: Handle generation variant drops in timeline (src/tools/video-editor/hooks/useTimelineEditing.ts)
Scope: Medium
ExtendonTimelineDragOver (line 461) to also accept variant-url as a recognized dataTransfer type (alongside existing asset-key and Files checks).
ExtendonTimelineDrop (line 530) with a third case for generation variant drops:
Read variant-url, variant-type, variant-id, generation-id from dataTransfer.
Register the variant as an asset: create an AssetRegistryEntry with file pointing to the variant URL, type from variant-type, plus generationId and variantId fields.
Add entry to the registry (similar to how uploadAsset does at SupabaseDataProvider.ts:112-125).
Call existing handleAssetDrop (line 378) with the new asset key.
For drops on the assets panel: extend AssetPanel.tsx drop handler (or add one) so dragging a variant onto the assets panel registers the asset without creating a clip.
Step 7: Validate drag-and-drop flow
Scope: Small
Test dragging a generation variant from GenerationsPane onto the timeline — should create a clip.
Test dragging onto the assets panel — should register asset without creating a clip.
Test that existing asset-key drags and file upload drags still work unchanged.
Test with both image and video variants.
Phase 3: Assets Panel, Click-Through, and Polish
Step 8: Collapse assets panel by default (src/tools/video-editor/components/PropertiesPanel/PropertiesPanel.tsx)
Scope: Small
ChangeuseState(true) to useState(false) at line 25 for assetsExpanded.
Step 9: Generation variant click-through from asset panel (src/tools/video-editor/components/PropertiesPanel/AssetPanel.tsx)
Scope: Medium
For assets with generationId/variantId: add a click handler (or info icon) on the asset row in AssetPanel.tsx.
On click: open MediaLightbox with the source generation, passing initialVariantId to highlight the specific variant.
Implementation: add local state for lightbox visibility + selected generation in the AssetPanel or parent PropertiesPanel. Fetch the generation row by ID using existing React Query patterns, then render MediaLightbox conditionally.
Fallback: if the generation no longer exists (deleted), show a toast or disable the click-through button.
Step 10: Aesthetic polish across video editor (src/tools/video-editor/components/)
Scope: Medium
Audit all video editor components for hardcoded colors (zinc-, gray-, slate-*, etc.). Replace with theme tokens:
Verify against dark theme — the editor should feel native, not foreign.
Step 11: Final integration validation
Scope: Small
Full flow test: navigate to video editor → full-screen (no header, no dots) → drag variant from gallery → drops onto timeline → asset appears in collapsed panel → click asset to see source generation in lightbox → navigate back → normal layout restored.
Check compact mode in EditorPane still works on non-editor routes.
Check no regressions in GenerationsPane drag for other features (shots timeline drag if it exists).
Runnpm run build to catch type errors.
Execution Order
Steps 1-3 (layout) first — cheapest, most visible, zero dependencies on other steps.
Steps 4-7 (drag) next — requires type change first, then DnD wiring.
Steps 8-10 (polish) last — cosmetic, low risk, can be done incrementally.
Step 11 validates everything together.
Validation Order
Visual check after Step 3 (layout works).
Interactive test after Step 7 (drag works end-to-end).
Build check after Step 10 (no type errors from all changes).
Full flow test at Step 11.
code
Plan metadata:
{
"version": 1,
"timestamp": "2026-03-25T03:54:20Z",
"hash": "sha256:6d4909933bc6b58736b53efb56f575ddad9af6802f44a5f3266b6cfe19b3f03b",
"questions": [
"DraggableImage.tsx currently disables ALL gallery drag \u2014 was drag disabled for a reason (e.g., conflicting with @dnd-kit sort in ShotImageManager)? Re-enabling it globally could break shot image sorting. Should we gate drag-enable to only when GenerationsPane is over the video editor, or is re-enabling globally safe?",
"For variant drops: should the asset file reference be the variant's Supabase storage URL directly, or should we copy/re-upload the file into the timeline-assets bucket? Direct reference is simpler but couples the asset to the generation's storage lifecycle (if generation is deleted, asset breaks). Re-upload is safer but duplicates storage.",
"The back bar \u2014 should it show just timeline name + back button, or also include playback controls / render button / save status? The current FullEditorLayout has these in the preview panel area already, so minimal back bar seems right, but want to confirm.",
"For the assets panel drop target (Step 6): the current AssetPanel has drag-out support but no drop-in handler. Adding a drop zone changes its interaction model. Should the entire panel be a drop target, or should there be an explicit 'drop here' zone?"
],
"success_criteria": [
"Video editor page uses full viewport height \u2014 no GlobalHeader visible, no EditorPane dots, no pane-margin padding",
"Navigating away from /tools/video-editor restores normal layout (GlobalHeader, panes, margins)",
"A minimal back bar (~32-40px) shows at top of editor with navigation link and timeline name",
"Generation variants can be dragged from GenerationsPane and dropped onto the timeline to create clips",
"Generation variants can be dragged onto the assets panel to register without creating a clip",
"Dropped variant assets include generationId and variantId in their AssetRegistryEntry",
"Existing drag flows (asset-key from panel, file upload) continue working unchanged",
"Assets panel in PropertiesPanel is collapsed by default",
"Assets with generationId/variantId show a click-through action that opens MediaLightbox to the source generation+variant",
"No hardcoded color classes (zinc-, gray-, slate-*) remain in video editor components \u2014 all use theme tokens",
"Editor visually matches Reigh's dark theme and feels like a native tool",
"Compact mode in EditorPane still works on non-editor routes",
"npm run build passes with no type errors"
],
"assumptions": [
"Re-enabling drag on DraggableImage is safe if we scope it properly (e.g., only set generation-specific dataTransfer types that the shot timeline ignores)",
"Variant assets will reference the original storage URL directly (no re-upload) for simplicity \u2014 if the generation is deleted, the asset will show a broken state, which is acceptable for v1",
"The back bar is minimal: just a back link + timeline name. Save/render status stays in the existing preview/chrome areas",
"The entire AssetPanel surface becomes a drop target (with visual drop indicator), since it's a natural target and avoids adding a separate zone",
"MediaLightbox can be rendered from within the video editor component tree without conflicting with other lightbox instances",
"The timeline list view (no timeline selected) does not need full-screen treatment \u2014 only the active editor shell does"
],
"structure_warnings": [
"Each step section should reference at least one file in backticks."
]
}
code
Plan structure warnings from validator:
[
"Each step section should reference at least one file in backticks."
]
code
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 structure should be flagged as category `completeness` with severity_hint `likely-significant`.
- 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":"flat-step-format-missing","concern":"The plan violates the required flat step structure. It uses phase headers with nested step headings instead of flat ## Step N: sections.","category":"completeness","severity_hint":"likely-significant","evidence":"The user explicitly required flat h2 headings (## Step N:) with no phase headers pushing steps to h3. The submitted plan uses ## Phase 1/2/3 and ### Step 1/2/...."},{"id":"route-gating-hides-timeline-list","concern":"Pathname-only full-screen gating would also hide chrome for the timeline list view on /tools/video-editor, which conflicts with the plan's own assumption that only the active editor shell should get the full-screen treatment.","category":"correctness","severity_hint":"likely-significant","evidence":"src/tools/video-editor/pages/VideoEditorPage.tsx:206-223 serves both states from the same pathname: without ?timeline=... it renders TimelineList, and with ?timeline=... it renders VideoEditorShell. A pathname === '/tools/video-editor' check in layout code cannot distinguish those two states."},{"id":"fullscreen-layout-still-constrained","concern":"The full-screen layout steps miss repo-level wrappers that still constrain the editor: the route outlet sits inside a centered container mx-auto shell, and the global social footer still renders below the page. Hiding the header and pane padding alone will not produce a true full-screen editor.","category":"correctness","severity_hint":"likely-significant","evidence":"src/app/components/LayoutMainContent.tsx:64-67 wraps all routed pages in <main className=\"container mx-auto ...\">. src/app/Layout.tsx:128-134 always renders SocialIcons, and src/app/components/SocialIcons.tsx:9-31 adds vertical footer space. The plan does not account for either wrapper."},{"id":"drag-plan-targets-wrong-source","concern":"The drag plan targets the wrong source component and introduces a parallel drag protocol. Gallery drag starts in MediaGalleryItem, not DraggableImage, and existing gallery-to-shot drops already use the shared generation drag helpers.","category":"correctness","severity_hint":"likely-significant","evidence":"src/shared/components/MediaGalleryItem.tsx:324-326 attaches draggable and onDragStart, and src/shared/components/MediaGalleryItem.tsx:267-273 calls setGenerationDragData(...). src/shared/components/DraggableImage.tsx:10-15 is only a non-draggable wrapper around children. The shared drag contract lives in src/shared/lib/dnd/dragDrop.ts:123-158, and shot drop targets consume it in src/shared/components/ShotImageManager/components/BatchDropZone.tsx:315-324."},{"id":"generations-pane-not-variant-level","concern":"The plan assumes GenerationsPane items already operate at generation-variant level, but the current pane is backed by project generations, not generation_variants. Variant-level drag needs a data-model/query change first, not just extra dataTransfer fields.","category":"correctness","severity_hint":"likely-significant","evidence":"src/features/gallery/hooks/useGalleryPageState.ts:67-109 calls useProjectGenerations(...) with the normal generations path. In src/shared/hooks/projects/useProjectGenerations.ts:249-257, the generation_variants query is only used when filters.variantsOnly is set. The default generation transform is transformGeneration in src/shared/lib/generationTransformers.ts:263-375; variant rows are only produced by transformVariant in src/shared/lib/generationTransformers.ts:438-475."},{"id":"asset-registry-registration-not-persisted","concern":"The proposed 'register asset' drop flow is not compatible with the current persistence model. patchRegistry only mutates local editor state; it does not persist asset_registry, and saveTimeline writes only timeline config.","category":"correctness","severity_hint":"likely-significant","evidence":"src/tools/video-editor/hooks/useTimelineData.ts:339-390 shows patchRegistry(...) updating local state and calling commitData(..., { save: false }). src/tools/video-editor/data/SupabaseDataProvider.ts:36-52 saves only the config column, while src/tools/video-editor/data/SupabaseDataProvider.ts:87-131 is the existing code path that persists asset_registry to Supabase."}],"verified_flag_ids":[],"disputed_flag_ids":[]}
You are an independent reviewer. Critique the plan against the actual repository.
Polish and integrate video editor into Reigh: full-screen editor page (hide GlobalHeader, use all vertical space), suppress EditorPane on editor route, drag from GenerationsPane into timeline/assets (variant-level), assets panel collapsed by default, generation variant click-through, aesthetic polish
User notes and answers:
CRITICAL FORMAT: Use FLAT ## Step N: headings at h2 level. NO ## Phase headers pushing steps to h3.
DETAILED CONTEXT:
FULL-SCREEN EDITOR PAGE:
Currently VideoEditorPage renders inside Layout which has GlobalHeader (~60px), plus padding from panes
Layout is at src/app/Layout.tsx, GlobalHeader at src/shared/components/GlobalHeader/
LayoutMainContent at src/app/components/LayoutMainContent.tsx handles margins/padding from locked panes
The editor page should hide GlobalHeader and use 100vh. Add a minimal back bar (e.g. small "← Back" link + timeline name)
Check useLocation().pathname in Layout to conditionally hide GlobalHeader on /tools/video-editor
The VideoEditorShell.tsx currently renders a CSS grid layout - it needs to fill all available space
EDITOR PANE SUPPRESSION:
EditorPaneTab.tsx is at src/features/editor/components/EditorPaneTab.tsx
It has EditorPaneControlTab (the floating dots/buttons) and EditorPaneSurface (the slide-down pane)
The plan said to check useLocation().pathname === '/tools/video-editor' and return null
This was supposedly implemented but the dots still show - need to verify and fix
The control tab dots are at the top center of the page
DRAG FROM GENERATIONS PANE:
The app uses @dnd-kit for drag and drop
GenerationsPane is at src/features/gallery/components/GenerationsPane/
Look at how shot timeline drag works - items are dragged from gallery into shots
ShotImageManager components handle drag targets for the shots timeline
The drag data should include: variant location URL, variant type (image/video), variant ID, generation ID
On drop into timeline: upload/register the asset in the timeline's asset_registry, then create a clip
On drop into assets panel: just register the asset without creating a clip
Must work at VARIANT level - use generation_variants table, not generations
AssetPanel is at src/tools/video-editor/components/PropertiesPanel/AssetPanel.tsx
It likely has a collapsible section - just change default open state to false
Similar to how other collapsible panels work in the app
GENERATION VARIANT CLICK-THROUGH:
When an asset in the editor came from a generation variant, store the variant_id and generation_id in the asset registry entry
On click, open the MediaLightbox or navigate to the gallery with that variant selected
MediaLightbox is at src/shared/components/MediaLightbox/
AESTHETIC POLISH:
Use bg-background, text-foreground, border-border etc instead of hardcoded zinc colors
Ensure the editor matches Reigh's dark theme with warm accents
The editor should feel like a native Reigh tool, not a foreign embed
REVISION GUIDANCE FOR ALL 6 FLAGS:
flat-step-format-missing: Use FLAT ## Step N: headings. NO phase headers.
route-gating-hides-timeline-list: The full-screen treatment should only apply when ?timeline= is present in the URL (i.e. the editor shell is active). The timeline list view should keep normal layout with GlobalHeader.
fullscreen-layout-still-constrained: Check Layout.tsx and LayoutMainContent.tsx for ALL wrappers that constrain the editor:
The Outlet may be in a container/max-width wrapper
Social footer may still render
Pane margins (left/right/top/bottom) from locked panes
All of these should be suppressed when the video editor shell is active. Use a context or route check.
drag-plan-targets-wrong-source: Research the actual drag source. Look at MediaGalleryItem, the existing generation drag helpers, and how shots drag works. The drag should start from MediaGalleryItem (which renders in GenerationsPane), not a fictional DraggableImage component. Use the same drag protocol that shots already uses.
generations-pane-not-variant-level: The GenerationsPane shows generations which have variants. When dragging, we should drag the PRIMARY variant of a generation (the one with is_primary=true). The variant's location URL, type, and IDs should be in the drag data. We don't need to change the pane's query to be variant-level - just extract the primary variant data when starting a drag.
asset-registry-registration-not-persisted: The SupabaseDataProvider.saveTimeline writes config JSONB. The asset_registry is a SEPARATE JSONB column on the timelines table. We need to ensure the asset registry changes are also persisted. Check if SupabaseDataProvider has a method to update asset_registry, and if not, add one. The drop handler should call this to persist new assets.
code
Plan:
# Implementation Plan: Video Editor Full-Screen Integration & Polish
Overview
The video editor (/tools/video-editor) currently renders inside the standard Layout with GlobalHeader (~60px), EditorPane dots, container mx-auto wrapper, SocialIcons footer, and pane-margin padding — wasting vertical space. This plan makes the active editor shell full-screen (gated on ?timeline= param, not just pathname), suppresses all redundant chrome, enables drag from GenerationsPane into the timeline using the existing application/x-generation drag protocol with variant-level data, persists dropped assets to the asset_registry column via a new DataProvider.registerAsset method, collapses the assets panel by default, adds generation click-through, and applies theme polish.
Key architectural facts from audit:
LayoutMainContent.tsx:64 wraps Outlet in <main className="container mx-auto"> — constrains width
MediaGalleryItem.tsx:324-326 already has draggable={!isMobile} and calls setGenerationDragData() at line 267 — drag IS enabled on desktop
DraggableImage.tsx is a separate wrapper used in a different render path (line 489) — it's NOT the primary drag source
The shared drag contract uses application/x-generation MIME type via dragDrop.ts:14,123-132
GenerationDropData has { generationId, imageUrl, thumbUrl, metadata } — no variantId yet
Timeline drop handler (useTimelineEditing.ts:461-626) only checks for asset-key and Files — does NOT handle application/x-generation
patchRegistry() (useTimelineData.ts:339-390) only updates local state with save: false — does NOT persist to DB
SupabaseDataProvider.uploadAsset() (lines 87-131) persists asset_registry column — but requires a file upload
SupabaseDataProvider.saveTimeline() (lines 36-52) only writes config column, NOT asset_registry
Step 1: Gate full-screen mode on timeline param, not just pathname (src/app/Layout.tsx, src/app/components/LayoutMainContent.tsx)
Scope: Medium
Add a route check using both useLocation().pathname and useSearchParams() — full-screen mode activates ONLY when pathname === '/tools/video-editor' AND searchParams.has('timeline'). The timeline list view (no ?timeline=) keeps normal layout.
In LayoutMainContent.tsx: when full-screen mode is active:
Skip rendering GlobalHeader (line 52)
Remove container mx-auto and containerPadding/containerSpacing from the <main> wrapper (line 64) — replace with a bare <main className="h-full"> or similar
Zero out all pane offsets in contentStyle (lines 35-48): marginRight, marginLeft, paddingTop, paddingBottom all '0px'
The background gradient div (line 112) can stay (it's pointer-events-none)
VerifyEditorPaneTab.tsx:66-68 null-return logic covers the EditorPaneControlTab (dots). Read the component to confirm the dots are part of the same component tree that returns null. If the dots render through a separate path, suppress them too.
Step 2: Make VideoEditorShell fill viewport (src/tools/video-editor/components/VideoEditorShell.tsx, src/tools/video-editor/pages/VideoEditorPage.tsx)
Scope: Small
UpdateVideoEditorPage.tsx — when in full editor mode (has ?timeline=), render the provider+shell in an h-screen w-screen overflow-hidden container.
UpdateFullEditorLayout in VideoEditorShell.tsx (lines 100-167) — ensure the CSS grid uses h-full so it fills the parent. The grid template rows should sum to 100% of the container.
Add a minimal back bar (~32-40px) at the top of FullEditorLayout: a flex row with ← Back link (calls navigate(-1) or navigates to /tools/video-editor without ?timeline=) and the timeline name from useTimelineChromeContext(). Style: bg-background border-b border-border text-sm text-muted-foreground.
Step 3: Validate full-screen layout
Scope: Small
Navigate to /tools/video-editor (no ?timeline=) — should show normal layout with GlobalHeader, footer, pane margins.
Navigate to /tools/video-editor?timeline=<id> — should show full-screen: no GlobalHeader, no footer, no container constraint, no pane margins, editor fills viewport.
Navigate away — normal layout restored.
Check EditorPane dots are gone on the editor route.
Step 4: Extend drag protocol with variant data (src/shared/lib/dnd/dragDrop.ts, src/shared/components/MediaGalleryItem.tsx)
Scope: Small
ExtendGenerationDropData in dragDrop.ts:83-88 with optional variant fields:
UpdatehandleDragStart in MediaGalleryItem.tsx:261-277 to include the primary variant data. The image prop (type GalleryImage) already has the generation data. Extract the primary variant info from image.metadata or from a sibling query. The generation's image.url is the variant location; image.id is the generation ID. Add variantId from image.metadata?.variant_id (or the generation's primary variant ID if available in the data) and variantType inferred from the URL extension or metadata.
No changes to the drag-start trigger — MediaGalleryItem.tsx:324 already has draggable={!isMobile} working correctly.
Step 5: Extend AssetRegistryEntry and add registerAsset to DataProvider (src/tools/video-editor/types/index.ts, src/tools/video-editor/data/DataProvider.ts, src/tools/video-editor/data/SupabaseDataProvider.ts)
Scope: Medium
Add optional fields to AssetRegistryEntry (types/index.ts:105-111):
typescript
export type AssetRegistryEntry = {
file: string;
type?: string;
duration?: number;
resolution?: string;
fps?: number;
generationId?: string; // NEW
variantId?: string; // NEW
};
AddregisterAsset method to DataProvider interface (DataProvider.ts:19-30):
ImplementregisterAsset in SupabaseDataProvider.ts — extract the persist-to-DB logic from uploadAsset (lines 110-125) into this new method. It loads the current registry, merges the new entry, and updates the asset_registry column. Then refactor uploadAsset to call registerAsset internally after the file upload.
Step 6: Handle generation drops in timeline (src/tools/video-editor/hooks/useTimelineEditing.ts)
Scope: Medium
ExtendonTimelineDragOver (line 461-463) to also accept application/x-generation as a recognized type. Import hasDataTransferType or check types.includes(GENERATION_MIME_TYPE). Use the constant from dragDrop.ts or duplicate the string.
ExtendonTimelineDrop (line 530) with a new case BEFORE the existing asset-key case:
Import getGenerationDropData from dragDrop.ts
Call getGenerationDropData(event) — if it returns data:
Create an AssetRegistryEntry with file: data.imageUrl (the variant's public URL), type inferred from URL, generationId: data.generationId, variantId: data.variantId
Generate assetId = crypto.randomUUID()
Call patchRegistry(assetId, entry, data.imageUrl) to update local state
Call dataProvider.registerAsset(timelineId, assetId, entry) to persist to DB (fire-and-forget with error logging)
Call handleAssetDrop(assetId, compatibleTrackId, time) to create the clip
ExposeregisterAsset from the data provider through the hook chain: useTimelineEditing needs access to the data provider (via useVideoEditorRuntime() or passed as a dependency).
Step 7: Add drop-to-assets-panel support (src/tools/video-editor/components/PropertiesPanel/AssetPanel.tsx)
Scope: Small
AddonDragOver and onDrop handlers to the AssetPanel container div.
In onDragOver: check for application/x-generation type (same check as timeline). If present, preventDefault() and show a visual drop indicator (e.g., border highlight).
In onDrop: same registration logic as Step 6 (create entry, patchRegistry, registerAsset) but WITHOUT calling handleAssetDrop — the asset is registered but no clip is created.
Pass the necessary registration functions as props from PropertiesPanel or via context.
Step 8: Validate drag-and-drop flow
Scope: Small
Test dragging a generation from GenerationsPane onto the timeline — should create a clip with the generation's image/video.
Test dragging onto the assets panel — should register asset (visible in panel) without creating a clip.
Test existing flows still work: drag asset-key from panel to timeline, file upload drop.
Verify persistence: reload the page — dropped generation assets should still be in the registry.
Test with both image and video generations.
Step 9: Collapse assets panel by default (src/tools/video-editor/components/PropertiesPanel/PropertiesPanel.tsx)
Scope: Small
ChangeuseState(true) to useState(false) at PropertiesPanel.tsx:25 for assetsExpanded.
Step 10: Generation variant click-through from asset panel (src/tools/video-editor/components/PropertiesPanel/AssetPanel.tsx)
Scope: Medium
For asset rows with generationId/variantId: add a small link/button icon (e.g., ExternalLink from lucide) on the asset row.
On click: open MediaLightbox with the source generation. Fetch the generation row by generationId using existing React Query patterns (useQuery with generation key), then render MediaLightbox with initialVariantId.
Add local state in AssetPanel or parent for lightbox open/selected asset.
Fallback: if generation fetch returns null (deleted), disable the click-through icon.
Step 11: Aesthetic polish across video editor (src/tools/video-editor/components/)
Scope: Medium
Audit all video editor components for hardcoded color classes. Replace with theme tokens:
Verify dark theme consistency — editor should feel like a native Reigh tool.
Step 12: Final integration validation
Scope: Small
Full flow: navigate to editor → full-screen → drag variant from gallery → clip on timeline → asset in panel → click-through to lightbox → navigate back → normal layout.
Compact mode in EditorPane still works on non-editor routes.
No regressions in GenerationsPane drag to shots (the application/x-generation protocol is unchanged; shots targets still read generationId/imageUrl).
Runnpm run build — no type errors.
Execution Order
Steps 1-3 (layout) — cheapest, most visible, no dependencies.
Steps 4-5 (types/protocol/persistence) — foundation for drag.
Steps 6-8 (drag wiring + validation) — depends on 4-5.
Steps 9-10 (panel UX) — independent of drag, can parallel with 6-8.
Step 11 (polish) — cosmetic, last.
Step 12 (final validation) — after everything.
Validation Order
Visual check after Step 3 (full-screen layout works, timeline list keeps header).
Type check after Step 5 (npm run build — verify types compile).
Interactive test after Step 8 (drag end-to-end, persistence survives reload).
Build check after Step 11 (no type errors from all changes).
Full flow at Step 12.
code
Plan metadata:
{
"version": 2,
"timestamp": "2026-03-25T04:02:19Z",
"hash": "sha256:e073593c65dd86418d32c4f2a4f4d39902fd9ae7da9b46f7dd709db44c1c37e5",
"changes_summary": "Addressed all 6 flags: (1) Flat ## Step N: format throughout \u2014 no phase headers. (2) Full-screen gating now checks searchParams.has('timeline') in addition to pathname, so timeline list view keeps normal layout. (3) Identified and suppressed ALL layout constraints: container mx-auto wrapper in LayoutMainContent.tsx:64, SocialIcons footer in Layout.tsx:128-134, pane margins, GlobalProcessingWarning, containerPadding/containerSpacing. (4) Corrected drag source \u2014 MediaGalleryItem.tsx:324 already has draggable={!isMobile} with handleDragStart calling setGenerationDragData() at line 267. Extended the existing GenerationDropData protocol instead of inventing a new one. (5) Variant data extracted from the generation's primary variant at drag time via existing image prop data, adding variantId and variantType to GenerationDropData. No query-level changes needed. (6) Added registerAsset method to DataProvider/SupabaseDataProvider that persists to the asset_registry column (extracted from existing uploadAsset logic). Drop handler calls both patchRegistry (local) and registerAsset (DB persist).",
"flags_addressed": [
"flat-step-format-missing",
"route-gating-hides-timeline-list",
"fullscreen-layout-still-constrained",
"drag-plan-targets-wrong-source",
"generations-pane-not-variant-level",
"asset-registry-registration-not-persisted"
],
"questions": [
"The image prop in MediaGalleryItem \u2014 does it reliably carry the variant_id for the displayed variant? If GenerationsPane shows generation-level items (not variants), we need to confirm where to get the primary variant ID at drag time. It might be in image.metadata, or we may need to look it up from the generation_variants table via the query cache.",
"The back bar \u2014 should it also show the project name, or just timeline name + back link? And should 'back' go to the timeline list (/tools/video-editor) or to the previous page (navigate(-1))?"
],
"success_criteria": [
"Video editor with ?timeline= uses full viewport \u2014 no GlobalHeader, no SocialIcons footer, no container mx-auto constraint, no pane margins",
"Video editor WITHOUT ?timeline= (timeline list) keeps normal layout with GlobalHeader and footer",
"Navigating away from /tools/video-editor restores normal layout completely",
"A minimal back bar (~32-40px) shows at top of editor with back link and timeline name",
"EditorPane dots are suppressed on the editor route",
"Generation items can be dragged from GenerationsPane and dropped onto the timeline to create clips, using the existing drag protocol",
"Generation items can be dragged onto the assets panel to register without creating a clip",
"Dropped assets include generationId and variantId in their AssetRegistryEntry",
"Dropped assets are persisted to the DB column via registerAsset \u2014 survive page reload",
"Existing drag flows (asset-key from panel, file upload) continue working unchanged",
"Existing generation-to-shot drag is unaffected",
"Assets panel in PropertiesPanel is collapsed by default",
"Assets with generationId/variantId show a click-through action that opens MediaLightbox",
"No hardcoded color classes (zinc-, slate-*) remain in video editor components",
"Compact mode in EditorPane still works on non-editor routes",
"npm run build passes with no type errors"
],
"assumptions": [
"The prop in MediaGalleryItem contains enough data to extract the primary variant ID \u2014 likely via or similar field. If not available directly, we may need to look up the variant from the generation data already in the query cache.",
"Variant assets reference the original generation storage URL directly (no re-upload) \u2014 if the generation is deleted, the asset shows a broken state, acceptable for v1.",
"The back bar is minimal: just back link + timeline name. Save/render status stays in existing preview/chrome areas.",
"The entire AssetPanel surface becomes a drop target with visual highlight indicator.",
"MediaLightbox can be rendered from within the video editor component tree without z-index or portal conflicts.",
" can be safely hidden on the editor route without missing critical alerts \u2014 the editor has its own render/save status indicators."
],
"structure_warnings": [
"Each step section should reference at least one file in backticks."
],
"delta_from_previous_percent": 81.82
}
code
Plan structure warnings from validator:
[
"Each step section should reference at least one file in backticks."
]
code
Existing flags:
[
{
"id": "flat-step-format-missing",
"concern": "The plan violates the required flat step structure. It uses phase headers with nested step headings instead of flat ## Step N: sections.",
"status": "addressed",
"severity": "significant"
},
{
"id": "route-gating-hides-timeline-list",
"concern": "Pathname-only full-screen gating would also hide chrome for the timeline list view on /tools/video-editor, which conflicts with the plan's own assumption that only the active editor shell should get the full-screen treatment.",
"status": "addressed",
"severity": "significant"
},
{
"id": "fullscreen-layout-still-constrained",
"concern": "The full-screen layout steps miss repo-level wrappers that still constrain the editor: the route outlet sits inside a centered container mx-auto shell, and the global social footer still renders below the page. Hiding the header and pane padding alone will not produce a true full-screen editor.",
"status": "addressed",
"severity": "significant"
},
{
"id": "drag-plan-targets-wrong-source",
"concern": "The drag plan targets the wrong source component and introduces a parallel drag protocol. Gallery drag starts in MediaGalleryItem, not DraggableImage, and existing gallery-to-shot drops already use the shared generation drag helpers.",
"status": "addressed",
"severity": "significant"
},
{
"id": "generations-pane-not-variant-level",
"concern": "The plan assumes GenerationsPane items already operate at generation-variant level, but the current pane is backed by project generations, not generation_variants. Variant-level drag needs a data-model/query change first, not just extra dataTransfer fields.",
"status": "addressed",
"severity": "significant"
},
{
"id": "asset-registry-registration-not-persisted",
"concern": "The proposed 'register asset' drop flow is not compatible with the current persistence model. patchRegistry only mutates local editor state; it does not persist asset_registry, and saveTimeline writes only timeline config.",
"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 structure should be flagged as category `completeness` with severity_hint `likely-significant`.
- 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`.
RawGeneration
primary_variant_id
src/shared/lib/generationTransformers.ts:263-375
variantId
src/shared/components/MediaGallery/types.ts:18-62
GeneratedImageWithMetadata
image.metadata?.variant_id
Each step section should reference at least one file in backticks.