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:
parent
d54e36f6fa
commit
644d66eae1
2 changed files with 23 additions and 1 deletions
|
|
@ -7,6 +7,7 @@ import { TabUIProvider } from '@renderer/contexts/TabUIContext';
|
||||||
|
|
||||||
import { DashboardView } from '../dashboard/DashboardView';
|
import { DashboardView } from '../dashboard/DashboardView';
|
||||||
import { NotificationsView } from '../notifications/NotificationsView';
|
import { NotificationsView } from '../notifications/NotificationsView';
|
||||||
|
import { SessionReportTab } from '../report/SessionReportTab';
|
||||||
import { SettingsView } from '../settings/SettingsView';
|
import { SettingsView } from '../settings/SettingsView';
|
||||||
|
|
||||||
import { SessionTabContent } from './SessionTabContent';
|
import { SessionTabContent } from './SessionTabContent';
|
||||||
|
|
@ -47,6 +48,7 @@ export const PaneContent = ({ pane }: PaneContentProps): React.JSX.Element => {
|
||||||
<SessionTabContent tab={tab} isActive={isActive} />
|
<SessionTabContent tab={tab} isActive={isActive} />
|
||||||
</TabUIProvider>
|
</TabUIProvider>
|
||||||
)}
|
)}
|
||||||
|
{tab.type === 'report' && <SessionReportTab tab={tab} />}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
})}
|
})}
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@ import { horizontalListSortingStrategy, SortableContext } from '@dnd-kit/sortabl
|
||||||
import { isElectronMode } from '@renderer/api';
|
import { isElectronMode } from '@renderer/api';
|
||||||
import { HEADER_ROW1_HEIGHT } from '@renderer/constants/layout';
|
import { HEADER_ROW1_HEIGHT } from '@renderer/constants/layout';
|
||||||
import { useStore } from '@renderer/store';
|
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 { useShallow } from 'zustand/react/shallow';
|
||||||
|
|
||||||
import { ExportDropdown } from '../common/ExportDropdown';
|
import { ExportDropdown } from '../common/ExportDropdown';
|
||||||
|
|
@ -45,6 +45,7 @@ export const TabBar = ({ paneId }: TabBarProps): React.JSX.Element => {
|
||||||
unreadCount,
|
unreadCount,
|
||||||
openNotificationsTab,
|
openNotificationsTab,
|
||||||
openSettingsTab,
|
openSettingsTab,
|
||||||
|
openSessionReport,
|
||||||
sidebarCollapsed,
|
sidebarCollapsed,
|
||||||
toggleSidebar,
|
toggleSidebar,
|
||||||
splitPane,
|
splitPane,
|
||||||
|
|
@ -72,6 +73,7 @@ export const TabBar = ({ paneId }: TabBarProps): React.JSX.Element => {
|
||||||
unreadCount: s.unreadCount,
|
unreadCount: s.unreadCount,
|
||||||
openNotificationsTab: s.openNotificationsTab,
|
openNotificationsTab: s.openNotificationsTab,
|
||||||
openSettingsTab: s.openSettingsTab,
|
openSettingsTab: s.openSettingsTab,
|
||||||
|
openSessionReport: s.openSessionReport,
|
||||||
sidebarCollapsed: s.sidebarCollapsed,
|
sidebarCollapsed: s.sidebarCollapsed,
|
||||||
toggleSidebar: s.toggleSidebar,
|
toggleSidebar: s.toggleSidebar,
|
||||||
splitPane: s.splitPane,
|
splitPane: s.splitPane,
|
||||||
|
|
@ -105,6 +107,7 @@ export const TabBar = ({ paneId }: TabBarProps): React.JSX.Element => {
|
||||||
const [searchHover, setSearchHover] = useState(false);
|
const [searchHover, setSearchHover] = useState(false);
|
||||||
const [notificationsHover, setNotificationsHover] = useState(false);
|
const [notificationsHover, setNotificationsHover] = useState(false);
|
||||||
const [settingsHover, setSettingsHover] = useState(false);
|
const [settingsHover, setSettingsHover] = useState(false);
|
||||||
|
const [analyzeHover, setAnalyzeHover] = useState(false);
|
||||||
|
|
||||||
// Context menu state
|
// Context menu state
|
||||||
const [contextMenu, setContextMenu] = useState<{ x: number; y: number; tabId: string } | null>(
|
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} />
|
<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 */}
|
{/* Notifications bell icon */}
|
||||||
<button
|
<button
|
||||||
onClick={openNotificationsTab}
|
onClick={openNotificationsTab}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue