# Plan: TCP Resizable Width + Instrument Search Dropdown + Section Save Fix ## Task 1: User-Resizable TCP Width **Files:** `app/static/js/app.jsx` ### Root Cause TCP containers are hardcoded `w-[320px]` (lines 14253, 14809). Components like Synth button, FX button, volume/pan sliders, input select overflow when content is wide. ### Implementation Steps **1a — Add TCP width state** Add near line 6394 (near existing `rightSidebarWidth` state): ```javascript const [tcpWidth, setTcpWidth] = useState(320); ``` **1b — Add TCP resize handler** Add near line 6365 (near `startColResize`): ```javascript const startTcpResize = e => { e.preventDefault(); const startX = e.clientX; const startW = tcpWidth; const onMove = ev => { const deltaX = ev.clientX - startX; const newWidth = Math.max(280, Math.min(600, startW + deltaX)); setTcpWidth(newWidth); }; const onUp = () => { document.removeEventListener('mousemove', onMove); document.removeEventListener('mouseup', onUp); }; document.addEventListener('mousemove', onMove); document.addEventListener('mouseup', onUp); }; ``` **1c — Replace `w-[320px]` with dynamic width in main TCP container (line 14253)** Change `className: "w-[320px] shrink-0 ..."` to `style: { width: tcpWidth + 'px', ... }`. **1d — Replace `w-[320px]` with dynamic width in sub-tab TCP container (line 14809)** Same pattern as 1c. **1e — Add resize handle (right edge of TCP)** Add a vertical resize handle bar on the right edge of both TCP containers. Pattern: ```jsx React.createElement("div", { onMouseDown: startTcpResize, className: "absolute right-0 top-0 bottom-0 w-1 cursor-col-resize z-40 hover:bg-cyan-500/50 transition-colors", style: { right: 0 } }) ``` **1f — Ensure the main layout accommodates variable TCP width** The main timeline area should use `flex-1` so it fills remaining space. Verify existing layout handles this. ### Verification - Drag TCP right edge → width changes between 280px and 600px - Components fit properly at various widths - Timeline area fills remaining space - Works in section-tab view too --- ## Task 2: Instrument Search Dropdown in TCP **Files:** `app/static/js/app.jsx` ### Root Cause Current instrument selector is a modal overlay (lines 15661-15726) with no search/filter. Requires clicking Synth button → modal → scroll to find instrument. ### Implementation Steps **2a — Add per-track dropdown open/close state** Add state: ```javascript const [instrumentDropdownTrackId, setInstrumentDropdownTrackId] = useState(null); ``` This tracks which track's dropdown is open (null = all closed). **2b — Add search query state** ```javascript const [instrumentSearchQuery, setInstrumentSearchQuery] = useState(''); ``` **2c — Replace Synth button (top toolbar, line 14444-14448) with dropdown toggle** Convert the icon-only `