@@ -76,6 +76,8 @@ import { TimelineProvider } from "../../stores/timeline/TimelineInstance";
7676import { VideoLandingStrip } from "../setup/video/VideoLandingStrip" ;
7777import { useReattachSequenceJobs } from "../../hooks/timeline/useReattachSequenceJobs" ;
7878import { PreviewArea } from "./preview/PreviewArea" ;
79+ import { SelectFieldDensityContext } from "../ui_primitives" ;
80+ import { TimelineInstrumentsPanel } from "./TimelineInstrumentsPanel" ;
7981import { TimelineInspector } from "./Inspector/TimelineInspector" ;
8082import { SourceViewerPanel } from "./SourceViewerPanel" ;
8183import MovieFilterOutlinedIcon from "@mui/icons-material/MovieFilterOutlined" ;
@@ -125,7 +127,13 @@ const editorStyles = (theme: Theme) =>
125127 width : "100%" ,
126128 height : "100%" ,
127129 overflow : "hidden" ,
128- backgroundColor : theme . vars . palette . background . default
130+ backgroundColor : theme . vars . palette . background . default ,
131+ "&& .MuiOutlinedInput-root:not(.Mui-focused):not(.Mui-error)" : {
132+ "& .MuiOutlinedInput-notchedOutline" : { borderColor : "transparent" } ,
133+ "&:hover:not(.Mui-disabled) .MuiOutlinedInput-notchedOutline" : {
134+ borderColor : theme . vars . palette . divider
135+ }
136+ }
129137 } ) ;
130138
131139const middleAreaStyles = ( theme : Theme ) =>
@@ -157,7 +165,8 @@ const dragHandleStyles = (theme: Theme, tall: boolean) =>
157165 height : tall ? TOUCH_HANDLE_HEIGHT_PX : HANDLE_HEIGHT_PX ,
158166 cursor : "ns-resize" ,
159167 flexShrink : 0 ,
160- backgroundColor : theme . vars . palette . divider ,
168+ backgroundColor : theme . vars . palette . background . default ,
169+ boxShadow : `inset 0 1px ${ theme . vars . palette . divider } ` ,
161170 transition : MOTION . background ,
162171 outline : "none" ,
163172 // The handle is a drag target, not a scroll surface: without this a touch
@@ -299,10 +308,11 @@ const PreviewRegion: React.FC<{
299308} ) ;
300309PreviewRegion . displayName = "PreviewRegion" ;
301310
302- type InspectorTab = "inspector" | "source" | "agent" | "history" | "script" ;
311+ type InspectorTab = "inspector" | "source" | "instrument" | " agent" | "history" | "script" ;
303312
304313const INSPECTOR_TABS = [
305314 { value : "inspector" , label : "Inspector" , icon : < TuneOutlinedIcon /> } ,
315+ { value : "instrument" , label : "Instruments" , icon : < TuneOutlinedIcon /> } ,
306316 { value : "source" , label : "Source" , icon : < MovieFilterOutlinedIcon /> } ,
307317 { value : "agent" , label : "Assistant" , icon : < AutoAwesomeIcon /> } ,
308318 { value : "history" , label : "History" , icon : < HistoryOutlinedIcon /> }
@@ -317,7 +327,8 @@ const SCRIPT_TAB = {
317327const InspectorRegion : React . FC < { sequenceId : string | undefined } > = memo (
318328 ( { sequenceId } ) => {
319329 const theme = useTheme ( ) ;
320- const [ tab , setTab ] = useState < InspectorTab > ( "inspector" ) ;
330+ const tab = useTimelineUIStore ( s => s . panelTab ) ;
331+ const setTab = useTimelineUIStore ( s => s . setPanelTab ) ;
321332
322333 const tabs = INSPECTOR_TABS ;
323334
@@ -333,7 +344,6 @@ const InspectorRegion: React.FC<{ sequenceId: string | undefined }> = memo(
333344 value = { tab }
334345 onChange = { ( value ) => setTab ( value as InspectorTab ) }
335346 size = "small"
336- fullWidth
337347 sx = { {
338348 flexShrink : 0 ,
339349 borderBottom : `1px solid ${ theme . vars . palette . divider } `
@@ -342,6 +352,8 @@ const InspectorRegion: React.FC<{ sequenceId: string | undefined }> = memo(
342352 < FlexColumn fullWidth sx = { { flex : 1 , minHeight : 0 , overflow : "hidden" } } >
343353 { tab === "inspector" ? (
344354 < TimelineInspector />
355+ ) : tab === "instrument" ? (
356+ < TimelineInstrumentsPanel />
345357 ) : tab === "source" ? (
346358 < SourceViewerPanel />
347359 ) : tab === "agent" ? (
@@ -406,7 +418,6 @@ const MobilePanelSheet: React.FC<{
406418 value = { activeTab }
407419 onChange = { ( value ) => onTabChange ( value as InspectorTab ) }
408420 size = "small"
409- fullWidth
410421 />
411422 ) ;
412423
@@ -425,6 +436,10 @@ const MobilePanelSheet: React.FC<{
425436 < FlexColumn fullWidth sx = { { height : "52vh" , minHeight : 0 } } >
426437 { activeTab === "inspector" ? (
427438 < TimelineInspector />
439+ ) : activeTab === "instrument" ? (
440+ < TimelineInstrumentsPanel />
441+ ) : activeTab === "source" ? (
442+ < SourceViewerPanel />
428443 ) : activeTab === "agent" ? (
429444 < TimelineAgentPanel />
430445 ) : activeTab === "script" ? (
@@ -504,7 +519,9 @@ const TimelineEditorBody: React.FC<
504519
505520 // Phone panel sheet (Inspector / Assistant / History / Script).
506521 const [ panelSheetOpen , setPanelSheetOpen ] = useState ( false ) ;
507- const [ panelTab , setPanelTab ] = useState < InspectorTab > ( "inspector" ) ;
522+ const panelTab = useTimelineUIStore ( s => s . panelTab ) ;
523+ const setPanelTab = useTimelineUIStore ( s => s . setPanelTab ) ;
524+ useEffect ( ( ) => { if ( isMobile && panelTab === "instrument" ) setPanelSheetOpen ( true ) ; } , [ isMobile , panelTab ] ) ;
508525 const openPanelSheet = useCallback ( ( ) => setPanelSheetOpen ( true ) , [ ] ) ;
509526 const closePanelSheet = useCallback ( ( ) => setPanelSheetOpen ( false ) , [ ] ) ;
510527 const hasSelection = useTimelineUIStore ( ( s ) => s . selectedClipIds . size > 0 ) ;
@@ -608,6 +625,13 @@ const TimelineEditorBody: React.FC<
608625
609626 // Tracks resize ─────────────────────────────────────────────────────────
610627 const [ tracksHeight , setTracksHeight ] = useState ( DEFAULT_TRACKS_HEIGHT_PX ) ;
628+ const expandedInstrumentTrackId = useTimelineUIStore ( ( s ) => s . expandedInstrumentTrackId ) ;
629+ useEffect ( ( ) => {
630+ if ( expandedInstrumentTrackId && ! pianoRollOpen ) setTracksHeight ( ( height ) => Math . max ( height , 420 ) ) ;
631+ } , [ expandedInstrumentTrackId , pianoRollOpen ] ) ;
632+ useEffect ( ( ) => {
633+ if ( pianoRollOpen ) setTracksHeight ( ( height ) => Math . min ( height , DEFAULT_TRACKS_HEIGHT_PX ) ) ;
634+ } , [ pianoRollOpen ] ) ;
611635 const [ isDragging , setIsDragging ] = useState ( false ) ;
612636 const dragStartYRef = useRef ( 0 ) ;
613637 const dragStartHeightRef = useRef ( DEFAULT_TRACKS_HEIGHT_PX ) ;
@@ -801,6 +825,7 @@ const TimelineEditorBody: React.FC<
801825 ) ;
802826
803827 return (
828+ < SelectFieldDensityContext . Provider value = "compact" >
804829 < FlexColumn fullWidth fullHeight css = { editorStyles ( theme ) } >
805830 { /* ── Top bar ───────────────────────────────────────────────── */ }
806831 < TopBar
@@ -827,7 +852,9 @@ const TimelineEditorBody: React.FC<
827852 onSelectFolder = { ( folderId ) => void saveAsAsset ( folderId , sequence ?. name ) }
828853 />
829854
830- { /* ── Middle: assets + preview + inspector ──────────────────── */ }
855+ < FlexRow fullWidth sx = { { flex : 1 , minHeight : 0 , overflow : "hidden" } } >
856+ < FlexColumn sx = { { flex : 1 , minWidth : 0 , minHeight : 0 } } >
857+ { /* ── Middle: assets + preview ──────────────────────────────── */ }
831858 { /* Basis 0 (not `auto`): the middle row absorbs all leftover height via
832859 * flex-grow, but its *content* never contributes to the column's size.
833860 * With `auto`, a tall inspector (clip selected) inflated this row's
@@ -850,7 +877,6 @@ const TimelineEditorBody: React.FC<
850877 createSequenceErrorMessage = { createErrorMessage }
851878 fullWidth = { isMobile }
852879 />
853- { ! isMobile && < InspectorRegion sequenceId = { sequenceId } /> }
854880 </ FlexRow >
855881
856882 { /* ── Horizontal drag handle (pointer + keyboard resizable) ─── */ }
@@ -877,6 +903,9 @@ const TimelineEditorBody: React.FC<
877903
878904 { /* ── Clip editor (piano roll) ──────────────────────────────── */ }
879905 < PianoRollPanel fullHeight = { pianoRollFullScreen } />
906+ </ FlexColumn >
907+ { ! isMobile && < InspectorRegion sequenceId = { sequenceId } /> }
908+ </ FlexRow >
880909
881910 { /* ── Bottom status bar ─────────────────────────────────────── */ }
882911 < TimelineStatusBar
@@ -948,6 +977,7 @@ const TimelineEditorBody: React.FC<
948977 </ Dialog >
949978
950979 </ FlexColumn >
980+ </ SelectFieldDensityContext . Provider >
951981 ) ;
952982} ) ;
953983
0 commit comments