MAESTRO: audit Tab and queue components - remove dead code

- TabBar.tsx: removed unused props onTabRename and onCloseOthers
  (onTabRename is handled by RenameTabModal, onCloseOthers was never implemented)
- MainPanel.tsx: removed corresponding dead props and usages
- App.tsx: removed dead callback implementations (44 lines)
- ExecutionQueueIndicator.tsx: removed unused React and QueuedItem imports
This commit is contained in:
Pedram Amini
2025-12-21 04:33:41 -06:00
parent 070cc385ec
commit 74c91945b0
4 changed files with 3 additions and 45 deletions

View File

@@ -6583,30 +6583,6 @@ export default function MaestroConsole() {
return result.session;
}));
}}
onTabRename={(tabId: string, newName: string) => {
if (!activeSession) return;
// Update tab state
setSessions(prev => prev.map(s => {
if (s.id !== activeSession.id) return s;
// Find the tab to get its agentSessionId for persistence
const tab = s.aiTabs.find(t => t.id === tabId);
if (tab?.agentSessionId) {
// Persist name to agent session metadata (async, fire and forget)
// Use projectRoot (not cwd) for consistent session storage access
window.maestro.agentSessions.updateSessionName(
s.projectRoot,
tab.agentSessionId,
newName || ''
).catch(err => console.error('Failed to persist tab name:', err));
}
return {
...s,
aiTabs: s.aiTabs.map(t =>
t.id === tabId ? { ...t, name: newName || null } : t
)
};
}));
}}
onRequestTabRename={(tabId: string) => {
if (!activeSession) return;
const tab = activeSession.aiTabs?.find(t => t.id === tabId);
@@ -6627,16 +6603,6 @@ export default function MaestroConsole() {
return { ...s, aiTabs: tabs };
}));
}}
onCloseOtherTabs={(tabId: string) => {
if (!activeSession) return;
// Use functional setState to compute from fresh state (avoids stale closure issues)
setSessions(prev => prev.map(s => {
if (s.id !== activeSession.id || !s.aiTabs) return s;
const tabToKeep = s.aiTabs.find(t => t.id === tabId);
if (!tabToKeep) return s;
return { ...s, aiTabs: [tabToKeep], activeTabId: tabId };
}));
}}
onUpdateTabByClaudeSessionId={(agentSessionId: string, updates: { name?: string | null; starred?: boolean }) => {
// Update the AITab that matches this Claude session ID
// This is called when a session is renamed or starred in the AgentSessionsBrowser

View File

@@ -1,6 +1,6 @@
import React, { useRef, useState, useEffect, useCallback } from 'react';
import { useRef, useState, useEffect, useCallback } from 'react';
import { ListOrdered, Command, MessageSquare } from 'lucide-react';
import type { Session, Theme, QueuedItem } from '../types';
import type { Session, Theme } from '../types';
interface ExecutionQueueIndicatorProps {
session: Session;

View File

@@ -141,10 +141,8 @@ interface MainPanelProps {
onTabSelect?: (tabId: string) => void;
onTabClose?: (tabId: string) => void;
onNewTab?: () => void;
onTabRename?: (tabId: string, newName: string) => void;
onRequestTabRename?: (tabId: string) => void;
onTabReorder?: (fromIndex: number, toIndex: number) => void;
onCloseOtherTabs?: (tabId: string) => void;
onTabStar?: (tabId: string, starred: boolean) => void;
onTabMarkUnread?: (tabId: string) => void;
onUpdateTabByClaudeSessionId?: (agentSessionId: string, updates: { name?: string | null; starred?: boolean }) => void;
@@ -222,7 +220,7 @@ export const MainPanel = forwardRef<MainPanelHandle, MainPanelProps>(function Ma
const [configuredContextWindow, setConfiguredContextWindow] = useState(0);
// Extract tab handlers from props
const { onTabSelect, onTabClose, onNewTab, onTabRename, onRequestTabRename, onTabReorder, onCloseOtherTabs, onTabStar, onTabMarkUnread, showUnreadOnly, onToggleUnreadFilter, onOpenTabSearch } = props;
const { onTabSelect, onTabClose, onNewTab, onRequestTabRename, onTabReorder, onTabStar, onTabMarkUnread, showUnreadOnly, onToggleUnreadFilter, onOpenTabSearch } = props;
// Get the active tab for header display
// The header should show the active tab's data (UUID, name, cost, context), not session-level data
@@ -782,10 +780,8 @@ export const MainPanel = forwardRef<MainPanelHandle, MainPanelProps>(function Ma
onTabSelect={onTabSelect}
onTabClose={onTabClose}
onNewTab={onNewTab}
onTabRename={onTabRename}
onRequestRename={onRequestTabRename}
onTabReorder={onTabReorder}
onCloseOthers={onCloseOtherTabs}
onTabStar={onTabStar}
onTabMarkUnread={onTabMarkUnread}
showUnreadOnly={showUnreadOnly}

View File

@@ -11,10 +11,8 @@ interface TabBarProps {
onTabSelect: (tabId: string) => void;
onTabClose: (tabId: string) => void;
onNewTab: () => void;
onTabRename?: (tabId: string, newName: string) => void;
onRequestRename?: (tabId: string) => void;
onTabReorder?: (fromIndex: number, toIndex: number) => void;
onCloseOthers?: (tabId: string) => void;
onTabStar?: (tabId: string, starred: boolean) => void;
onTabMarkUnread?: (tabId: string) => void;
showUnreadOnly?: boolean;
@@ -403,10 +401,8 @@ export function TabBar({
onTabSelect,
onTabClose,
onNewTab,
onTabRename,
onRequestRename,
onTabReorder,
onCloseOthers,
onTabStar,
onTabMarkUnread,
showUnreadOnly: showUnreadOnlyProp,