From db9a6766801e19bdd0064b2f2f5ba7781edd0892 Mon Sep 17 00:00:00 2001 From: Paul Holstein <44263169+holstein13@users.noreply.github.com> Date: Mon, 23 Feb 2026 12:25:45 -0500 Subject: [PATCH] feat: add parent-only disclaimer and report link to session cost MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The Visible Context panel's Session Cost only reflects the parent session. Add "(parent only · view full cost)" label that links to the Session Report where parent + subagent costs are shown. Co-Authored-By: Claude Opus 4.6 --- src/renderer/components/chat/ChatHistory.tsx | 3 +++ .../components/SessionContextHeader.tsx | 18 ++++++++++++++++++ .../chat/SessionContextPanel/index.tsx | 2 ++ .../chat/SessionContextPanel/types.ts | 2 ++ 4 files changed, 25 insertions(+) diff --git a/src/renderer/components/chat/ChatHistory.tsx b/src/renderer/components/chat/ChatHistory.tsx index 25d5555a..45929946 100644 --- a/src/renderer/components/chat/ChatHistory.tsx +++ b/src/renderer/components/chat/ChatHistory.tsx @@ -64,6 +64,7 @@ export const ChatHistory = ({ tabId }: ChatHistoryProps): JSX.Element => { syncSearchMatchesWithRendered, selectSearchMatch, setTabVisibleAIGroup, + openSessionReport, } = useStore( useShallow((s) => ({ searchQuery: s.searchQuery, @@ -76,6 +77,7 @@ export const ChatHistory = ({ tabId }: ChatHistoryProps): JSX.Element => { syncSearchMatchesWithRendered: s.syncSearchMatchesWithRendered, selectSearchMatch: s.selectSearchMatch, setTabVisibleAIGroup: s.setTabVisibleAIGroup, + openSessionReport: s.openSessionReport, })) ); @@ -872,6 +874,7 @@ export const ChatHistory = ({ tabId }: ChatHistoryProps): JSX.Element => { onNavigateToUserGroup={handleNavigateToUserGroup} totalSessionTokens={lastAiGroupTotalTokens} sessionMetrics={sessionDetail?.metrics} + onViewReport={effectiveTabId ? () => openSessionReport(effectiveTabId) : undefined} phaseInfo={sessionPhaseInfo ?? undefined} selectedPhase={selectedContextPhase} onPhaseChange={setSelectedContextPhase} diff --git a/src/renderer/components/chat/SessionContextPanel/components/SessionContextHeader.tsx b/src/renderer/components/chat/SessionContextPanel/components/SessionContextHeader.tsx index f3a8ca00..ef69d539 100644 --- a/src/renderer/components/chat/SessionContextPanel/components/SessionContextHeader.tsx +++ b/src/renderer/components/chat/SessionContextPanel/components/SessionContextHeader.tsx @@ -29,6 +29,7 @@ interface SessionContextHeaderProps { totalSessionTokens?: number; sessionMetrics?: SessionMetrics; onClose?: () => void; + onViewReport?: () => void; phaseInfo?: ContextPhaseInfo; selectedPhase: number | null; onPhaseChange: (phase: number | null) => void; @@ -42,6 +43,7 @@ export const SessionContextHeader = ({ totalSessionTokens, sessionMetrics, onClose, + onViewReport, phaseInfo, selectedPhase, onPhaseChange, @@ -132,6 +134,22 @@ export const SessionContextHeader = ({ {formatCostUsd(sessionMetrics.costUsd)} + (parent only + {onViewReport ? ( + + · + + ) + + ) : ( + ) + )} )} diff --git a/src/renderer/components/chat/SessionContextPanel/index.tsx b/src/renderer/components/chat/SessionContextPanel/index.tsx index 73274c31..68a200db 100644 --- a/src/renderer/components/chat/SessionContextPanel/index.tsx +++ b/src/renderer/components/chat/SessionContextPanel/index.tsx @@ -49,6 +49,7 @@ export const SessionContextPanel = ({ onNavigateToUserGroup, totalSessionTokens, sessionMetrics, + onViewReport, phaseInfo, selectedPhase, onPhaseChange, @@ -193,6 +194,7 @@ export const SessionContextPanel = ({ totalSessionTokens={totalSessionTokens} sessionMetrics={sessionMetrics} onClose={onClose} + onViewReport={onViewReport} phaseInfo={phaseInfo} selectedPhase={selectedPhase} onPhaseChange={onPhaseChange} diff --git a/src/renderer/components/chat/SessionContextPanel/types.ts b/src/renderer/components/chat/SessionContextPanel/types.ts index 009629e1..df4b7f88 100644 --- a/src/renderer/components/chat/SessionContextPanel/types.ts +++ b/src/renderer/components/chat/SessionContextPanel/types.ts @@ -27,6 +27,8 @@ export interface SessionContextPanelProps { totalSessionTokens?: number; /** Full session metrics (input, output, cache tokens, cost) */ sessionMetrics?: SessionMetrics; + /** Open the Session Report to see full cost breakdown */ + onViewReport?: () => void; /** Phase information for phase selector */ phaseInfo?: ContextPhaseInfo; /** Currently selected phase (null = current/latest) */