@@ -24,6 +24,8 @@ export const StudioApp = () => {
2424 const timelineMinHeight = 200 ;
2525 const [ previewViewport , setPreviewViewport ] = useState < { width : number ; height : number } > ( { width : 0 , height : 0 } ) ;
2626 const hasPreviewViewport = previewViewport . width > 0 && previewViewport . height > 0 ;
27+ const [ mountUiPanels , setMountUiPanels ] = useState ( false ) ;
28+ const [ mountProjectPreview , setMountProjectPreview ] = useState ( false ) ;
2729
2830 const clamp = ( value : number , min : number , max : number ) => Math . min ( max , Math . max ( min , value ) ) ;
2931
@@ -74,6 +76,21 @@ export const StudioApp = () => {
7476 window . addEventListener ( "pointerup" , up ) ;
7577 } , [ onHorizontalDrag ] ) ;
7678
79+ useEffect ( ( ) => {
80+ let raf1 : number | null = null ;
81+ let raf2 : number | null = null ;
82+ raf1 = requestAnimationFrame ( ( ) => {
83+ setMountUiPanels ( true ) ;
84+ raf2 = requestAnimationFrame ( ( ) => {
85+ setMountProjectPreview ( true ) ;
86+ } ) ;
87+ } ) ;
88+ return ( ) => {
89+ if ( raf1 != null ) cancelAnimationFrame ( raf1 ) ;
90+ if ( raf2 != null ) cancelAnimationFrame ( raf2 ) ;
91+ } ;
92+ } , [ ] ) ;
93+
7794 useEffect ( ( ) => {
7895 const target = previewRef . current ;
7996 if ( ! target ) return ;
@@ -161,8 +178,12 @@ export const StudioApp = () => {
161178 minWidth : 0 ,
162179 } }
163180 >
164- < div style = { { flexBasis : `${ horizontalRatio * 100 } %` , minWidth : 220 } } >
165- < ClipVisibilityPanel />
181+ < div style = { { flexBasis : `${ horizontalRatio * 100 } %` , minWidth : 220 , minHeight : 0 } } >
182+ { mountUiPanels ? (
183+ < ClipVisibilityPanel />
184+ ) : (
185+ < div style = { { width : "100%" , height : "100%" , borderRadius : 8 , background : "#0f172a" , border : "1px solid #1f2937" } } />
186+ ) }
166187 </ div >
167188 < div
168189 onPointerDown = { startHorizontalDrag }
@@ -208,7 +229,23 @@ export const StudioApp = () => {
208229 transformOrigin : "top left" ,
209230 } }
210231 >
211- < PROJECT />
232+ { mountProjectPreview ? (
233+ < PROJECT />
234+ ) : (
235+ < div
236+ style = { {
237+ width : "100%" ,
238+ height : "100%" ,
239+ display : "grid" ,
240+ placeItems : "center" ,
241+ color : "#94a3b8" ,
242+ fontSize : 13 ,
243+ fontFamily : "ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace" ,
244+ } }
245+ >
246+ Loading preview...
247+ </ div >
248+ ) }
212249 </ div >
213250 </ div >
214251 </ div >
@@ -228,7 +265,11 @@ export const StudioApp = () => {
228265
229266 < div style = { { flex : 1 , minHeight : 160 , display : "flex" , minWidth : 0 } } >
230267 < div style = { { flex : 1 , minHeight : 0 } } >
231- < TimelineUI />
268+ { mountUiPanels ? (
269+ < TimelineUI />
270+ ) : (
271+ < div style = { { width : "100%" , height : "100%" , borderRadius : 8 , background : "#0f172a" , border : "1px solid #1f2937" } } />
272+ ) }
232273 </ div >
233274 </ div >
234275 </ div >
0 commit comments