MAESTRO: Add unified tab system props to TabBar interface

- Add UnifiedTab discriminated union type to types/index.ts
- Add new props to TabBarProps: unifiedTabs, activeFileTabId,
  onFileTabSelect, onFileTabClose
- Props are optional for backwards compatibility during transition
- Phase 3 of file preview tabs implementation
This commit is contained in:
Pedram Amini
2026-02-02 03:40:14 -06:00
parent 3c6cf91ffa
commit c533e8826c
2 changed files with 25 additions and 1 deletions

View File

@@ -19,7 +19,7 @@ import {
ChevronsRight,
Loader2,
} from 'lucide-react';
import type { AITab, Theme } from '../types';
import type { AITab, Theme, FilePreviewTab, UnifiedTab } from '../types';
import { hasDraft } from '../utils/tabHelpers';
interface TabBarProps {
@@ -60,6 +60,16 @@ interface TabBarProps {
onCloseTabsLeft?: () => void;
/** Handler to close tabs to the right of active tab */
onCloseTabsRight?: () => void;
// === Unified Tab System Props (Phase 3) ===
/** Merged ordered list of AI and file preview tabs for unified rendering */
unifiedTabs?: UnifiedTab[];
/** Currently active file tab ID (null if an AI tab is active) */
activeFileTabId?: string | null;
/** Handler to select a file preview tab */
onFileTabSelect?: (tabId: string) => void;
/** Handler to close a file preview tab */
onFileTabClose?: (tabId: string) => void;
}
interface TabProps {
@@ -924,6 +934,11 @@ function TabBarInner({
onCloseOtherTabs,
onCloseTabsLeft,
onCloseTabsRight,
// Unified tab system props (Phase 3)
unifiedTabs: _unifiedTabs,
activeFileTabId: _activeFileTabId,
onFileTabSelect: _onFileTabSelect,
onFileTabClose: _onFileTabClose,
}: TabBarProps) {
const [draggingTabId, setDraggingTabId] = useState<string | null>(null);
const [dragOverTabId, setDragOverTabId] = useState<string | null>(null);

View File

@@ -465,6 +465,15 @@ export interface FilePreviewTab {
*/
export type UnifiedTabRef = { type: 'ai' | 'file'; id: string };
/**
* Unified tab entry for rendering in TabBar.
* Discriminated union that includes the full tab data for each type.
* Used by TabBar to render both AI and file tabs in a single list.
*/
export type UnifiedTab =
| { type: 'ai'; id: string; data: AITab }
| { type: 'file'; id: string; data: FilePreviewTab };
export interface Session {
id: string;
groupId?: string;