feat(report): wire up toolbar button and report tab routing

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Paul Holstein 2026-02-21 16:55:04 -05:00
parent d54e36f6fa
commit 644d66eae1
2 changed files with 23 additions and 1 deletions

View file

@ -7,6 +7,7 @@ import { TabUIProvider } from '@renderer/contexts/TabUIContext';
import { DashboardView } from '../dashboard/DashboardView';
import { NotificationsView } from '../notifications/NotificationsView';
import { SessionReportTab } from '../report/SessionReportTab';
import { SettingsView } from '../settings/SettingsView';
import { SessionTabContent } from './SessionTabContent';
@ -47,6 +48,7 @@ export const PaneContent = ({ pane }: PaneContentProps): React.JSX.Element => {
<SessionTabContent tab={tab} isActive={isActive} />
</TabUIProvider>
)}
{tab.type === 'report' && <SessionReportTab tab={tab} />}
</div>
);
})}

View file

@ -14,7 +14,7 @@ import { horizontalListSortingStrategy, SortableContext } from '@dnd-kit/sortabl
import { isElectronMode } from '@renderer/api';
import { HEADER_ROW1_HEIGHT } from '@renderer/constants/layout';
import { useStore } from '@renderer/store';
import { Bell, PanelLeft, Plus, RefreshCw, Search, Settings } from 'lucide-react';
import { Activity, Bell, PanelLeft, Plus, RefreshCw, Search, Settings } from 'lucide-react';
import { useShallow } from 'zustand/react/shallow';
import { ExportDropdown } from '../common/ExportDropdown';
@ -45,6 +45,7 @@ export const TabBar = ({ paneId }: TabBarProps): React.JSX.Element => {
unreadCount,
openNotificationsTab,
openSettingsTab,
openSessionReport,
sidebarCollapsed,
toggleSidebar,
splitPane,
@ -72,6 +73,7 @@ export const TabBar = ({ paneId }: TabBarProps): React.JSX.Element => {
unreadCount: s.unreadCount,
openNotificationsTab: s.openNotificationsTab,
openSettingsTab: s.openSettingsTab,
openSessionReport: s.openSessionReport,
sidebarCollapsed: s.sidebarCollapsed,
toggleSidebar: s.toggleSidebar,
splitPane: s.splitPane,
@ -105,6 +107,7 @@ export const TabBar = ({ paneId }: TabBarProps): React.JSX.Element => {
const [searchHover, setSearchHover] = useState(false);
const [notificationsHover, setNotificationsHover] = useState(false);
const [settingsHover, setSettingsHover] = useState(false);
const [analyzeHover, setAnalyzeHover] = useState(false);
// Context menu state
const [contextMenu, setContextMenu] = useState<{ x: number; y: number; tabId: string } | null>(
@ -386,6 +389,23 @@ export const TabBar = ({ paneId }: TabBarProps): React.JSX.Element => {
<ExportDropdown sessionDetail={activeTabSessionDetail} />
)}
{/* Analyze button - show only for session tabs with loaded data */}
{activeTab?.type === 'session' && activeTabSessionDetail && activeTabId && (
<button
onClick={() => openSessionReport(activeTabId)}
onMouseEnter={() => setAnalyzeHover(true)}
onMouseLeave={() => setAnalyzeHover(false)}
className="rounded-md p-2 transition-colors"
style={{
color: analyzeHover ? 'var(--color-text)' : 'var(--color-text-muted)',
backgroundColor: analyzeHover ? 'var(--color-surface-raised)' : 'transparent',
}}
title="Analyze Session"
>
<Activity className="size-4" />
</button>
)}
{/* Notifications bell icon */}
<button
onClick={openNotificationsTab}