I need to thoroughly investigate a prop-drilling chain across three components:…
- User
I need to thoroughly investigate a prop-drilling chain across three components: ShotImagesEditor → Timeline → TimelineContainer. The concern is that there are 72 + 57 + 48 props with ~15 structure video/audio/shot management props repeated verbatim at all 3 levels.
Please:
-
Find and read the full source of all three components:
- ShotImagesEditor (likely in src/tools/ somewhere)
- Timeline
- TimelineContainer
-
For each component, extract the COMPLETE list of props from its interface/type definition.
-
Identify which props are passed through verbatim (prop-drilled) from one level to the next.
-
Categorize the drilled props into logical groups (e.g., structure video props, audio strip props, shot management props, etc.)
-
Look at how Timeline and TimelineContainer actually USE these props — are they just passing them through, or do they consume some of them?
-
Check if there are any existing context providers or shared interfaces that could be relevant.
-
Look for any other components that consume similar prop sets — this might indicate a broader pattern.
Be extremely thorough — read every file completely, don't skip any props.
-
Assistant
I'll conduct a thorough investigation of the prop-drilling chain across these three components. Let me start by finding and reading all three files.
Assistant
Now let me read all three files completely:
Assistant
Excellent. Now let me check the types file for TimelineContainer to see the complete interface:
Assistant
Now let me check for any context providers or shared interfaces that might be relevant:
Assistant
Now let me analyze the prop usage in each component by searching for how props are actually consumed:
Assistant
Now let me look at how TimelineContainer actually uses its props:
Assistant
Let me check how these props are used in the orchestrator hook which is the core of TimelineContainer:
Assistant
Assistant
Now let me verify how many of these props are actually used versus passed through at each level by checking the prop consumption more precisely:
Assistant
- User
I need to verify several specific things for a refactoring plan:
-
Dead props in TimelineContainer: In
src/tools/travel-between-images/components/Timeline/TimelineContainer/TimelineContainer.tsx, check whetheruni3cEndPercent,onUni3cEndPercentChange, andonSelectedOutputChangeare actually destructured and used in the component body (not just defined in the types file). These might be dead props that exist in the interface but aren't consumed. -
Existing narrow context patterns: Search for any small/narrow React contexts in the codebase (not ShotSettingsContext) that follow a pattern of "parent provides, grandchild consumes" to skip prop drilling. Look in
src/shared/andsrc/tools/travel-between-images/. I want to see if there's an established pattern for this. -
Where
structureVideoTypeis hardcoded to 'uni3c': Check in and TimelineContainer — it seems is always 'uni3c' now. If so, passing it as a prop at all may be unnecessary. Verify by checking all consumers that actually read in the Timeline chain.
-
Assistant
I'll systematically verify each of these points. Let me start by examining the relevant files.
Assistant
Let me retry those calls individually:
Assistant
Now let me check the types file to see what's defined there:
- User
I'm planning a refactoring of the prop-drilling chain: ShotImagesEditor → Timeline → TimelineContainer.
I need to understand exactly which structure video and audio props ShotImagesEditor itself consumes vs passes through:
-
In
src/tools/travel-between-images/components/ShotImagesEditor.tsx, trace each of these props:structureVideoPath,structureVideoMetadata,structureVideoTreatment,structureVideoMotionStrength,structureVideoTypeonStructureVideoChange,uni3cEndPercent,onUni3cEndPercentChangestructureVideos,onAddStructureVideo,onUpdateStructureVideo,onRemoveStructureVideo,onSetStructureVideosaudioUrl,audioMetadata,onAudioChange
For each: does ShotImagesEditor USE it directly (in its own logic/render), or does it ONLY pass it to Timeline/BatchModeContent?
-
Also check: does ShotImagesEditor pass
onSetStructureVideosto Timeline? Or is that only used in ShotImagesEditor's own pruning logic + useSegmentSlotMode?
-
Assistant
Now let me check
useStructureVideo.tsto see ifstructureVideoTypeis hardcoded or passed through:Assistant
I'll trace the prop consumption in ShotImagesEditor and related code systematically. Let me start by reading the main component and the hook.
Assistant
Now let me search for any narrow context patterns and check where
structureVideoTypeis actually read:Assistant
Now let me check TimelineContainer to see what it passes through and what it consumes:
Assistant
Let me search more broadly:
Assistant
Let me find the TimelineContainer file:
Assistant
Now let me check GuidanceVideoControls to see if it uses structureVideoType:
Assistant
Let me continue reading TimelineContainer:
Assistant
Let me check where
structureVideoTypeis used in context and look at ShotSettingsContext:Assistant
Now let me check the BatchModeContent component to see which structure video and audio props it uses:
Assistant
Now let me check the legacy single-video usage more carefully in TimelineContainer:
Assistant
Let me also check where uni3c props are used:
Assistant
Now let me verify what
onSetStructureVideosis passed to (and how it's used). Let me check the types file too:Assistant
Let me check TimelineSection where these are actually used:
Assistant
Perfect! Now let me check where
onSelectedOutputChangeis actually used in the SharedGenerationView:Assistant
Let me check the full TimelineSection file to see the full picture:
Assistant
Now let me check ShotImagesEditor to see if it actually uses these props:
Assistant
Let me check if these props are used inside TimelineContainer as well:
Assistant
Perfect! Now let me check a context example to understand the narrow context pattern. Let me look at VideoEditContext:
Assistant
Perfect! Now let me also verify ShotsContext to understand a larger context pattern:
Assistant
Assistant