@@ -5,6 +5,8 @@ import type { TimelineElement } from "../player";
55import { AudioWaveform } from "../player/components/AudioWaveform" ;
66import { ImageThumbnail } from "../player/components/ImageThumbnail" ;
77import { encodePreviewPath , resolveMediaPreviewUrl } from "../player/components/thumbnailUtils" ;
8+ import { usePlayerStore } from "../player/store/playerStore" ;
9+ import { effectiveThumbnailMode } from "../player/lib/thumbnailPolicy" ;
810
911export function normalizeCompositionSrc (
1012 compSrc : string ,
@@ -87,13 +89,22 @@ export function useRenderClipContent({
8789 activePreviewUrl,
8890 effectiveTimelineDuration,
8991} : UseRenderClipContentOptions ) {
92+ // Self-sourced so the adaptive policy gates thumbnail generation without App plumbing.
93+ const thumbnailMode = usePlayerStore ( ( s ) => s . thumbnailMode ) ;
94+ const effectiveMode = effectiveThumbnailMode ( thumbnailMode ) ;
9095 return useCallback (
9196 // Pre-existing clip-content dispatcher; reduced by extracting renderAudioClip.
9297 // fallow-ignore-next-line complexity
9398 ( el : TimelineElement , style : { clip : string ; label : string } ) : ReactNode => {
9499 const pid = projectIdRef . current ;
95100 if ( ! pid ) return null ;
96101
102+ // Thumbnail generation disabled (perf) -> plain clip bars. Audio still shows
103+ // its waveform (cheap, not a frame thumbnail). Toggle: timeline toolbar.
104+ if ( effectiveMode === "hidden" ) {
105+ return el . tag === "audio" ? renderAudioClip ( el , pid , style . label ) : null ;
106+ }
107+
97108 let compSrc = el . compositionSrc ;
98109 if ( compSrc ) {
99110 compSrc = normalizeCompositionSrc ( compSrc , pid , window . location . origin ) ;
@@ -182,6 +193,6 @@ export function useRenderClipContent({
182193
183194 return null ;
184195 } ,
185- [ projectIdRef , compIdToSrc , activePreviewUrl , effectiveTimelineDuration ] ,
196+ [ projectIdRef , compIdToSrc , activePreviewUrl , effectiveTimelineDuration , effectiveMode ] ,
186197 ) ;
187198}
0 commit comments