MAESTRO: Integrate unified tab system into MainPanel

Connect FilePreviewTab rendering to the unified tab system:
- Add unified tab props to MainPanel (unifiedTabs, activeFileTabId, etc.)
- Remove !previewFile condition so TabBar always renders in AI mode
- Update content area to prioritize activeFileTabId over legacy previewFile
- Add showCloseButton prop to FilePreview (false when rendered as tab)
- Add activeFileTab computation in App.tsx
- Connect handlers through useMainPanelProps hook
This commit is contained in:
Pedram Amini
2026-02-02 04:19:43 -06:00
parent e7960ad3b2
commit 93d041a7f0
4 changed files with 139 additions and 15 deletions

View File

@@ -4783,6 +4783,16 @@ You are taking over this conversation. Based on the context above, provide a bri
activeSession?.unifiedTabOrder,
]);
// Get the active file preview tab (if a file tab is active)
const activeFileTab = useMemo((): FilePreviewTab | null => {
if (!activeSession?.activeFileTabId) return null;
return (
activeSession.filePreviewTabs.find(
(tab) => tab.id === activeSession.activeFileTabId
) ?? null
);
}, [activeSession?.activeFileTabId, activeSession?.filePreviewTabs]);
const isResumingSession = !!activeTab?.agentSessionId;
const canAttachImages = useMemo(() => {
if (!activeSession || activeSession.inputMode !== 'ai') return false;
@@ -12835,6 +12845,14 @@ You are taking over this conversation. Based on the context above, provide a bri
handleCloseOtherTabs,
handleCloseTabsLeft,
handleCloseTabsRight,
// Unified tab system (Phase 4)
unifiedTabs,
activeFileTabId: activeSession?.activeFileTabId ?? null,
activeFileTab,
handleFileTabSelect: handleSelectFileTab,
handleFileTabClose: handleCloseFileTab,
handleScrollPositionChange,
handleAtBottomChange,
handleMainPanelInputBlur,