11import type { PointerEventHandler , ReactNode } from "react" ;
2- import type { Translator } from "../../i18n" ;
2+ import type { Locale , Translator } from "../../i18n" ;
33import type { AppTheme , TerminalCompatibilityMode } from "../../types/app" ;
44import type { Session , SessionPaneNode , Tab } from "../../state/workbench" ;
55import { AgentSendIcon , AgentSplitHorizontalIcon , AgentSplitVerticalIcon , HeaderCloseIcon } from "../../components/icons" ;
66import { AgentStreamTerminal , type XtermBaseHandle } from "../../components/terminal" ;
7- import { isHiddenDraftPlaceholder , sessionCompletionRatio , sessionTone } from "../../shared/utils/session" ;
7+ import { isHiddenDraftPlaceholder , sessionCompletionRatio , sessionHeaderTag , sessionTone } from "../../shared/utils/session" ;
88import { stripAnsi } from "../../shared/utils/ansi" ;
99
1010type AgentWorkspaceFeatureProps = {
1111 visible : boolean ;
12+ locale : Locale ;
1213 activeTab : Tab ;
1314 activePaneSession : Session ;
1415 viewedSession : Session ;
@@ -36,6 +37,7 @@ type AgentWorkspaceFeatureProps = {
3637
3738export const AgentWorkspaceFeature = ( {
3839 visible,
40+ locale,
3941 activeTab,
4042 activePaneSession,
4143 viewedSession,
@@ -63,6 +65,7 @@ export const AgentWorkspaceFeature = ({
6365 if ( ! visible ) return null ;
6466
6567 const viewedSessionPlainStream = stripAnsi ( viewedSession . stream ) ;
68+ const viewedHeaderTag = sessionHeaderTag ( viewedSession . status , locale ) ;
6669
6770 const renderAgentPane = ( node : SessionPaneNode ) : ReactNode => {
6871 if ( node . type === "split" ) {
@@ -90,6 +93,7 @@ export const AgentWorkspaceFeature = ({
9093 ? "queued"
9194 : "idle" ;
9295 const statusTone = sessionTone ( session . status ) ;
96+ const headerTag = sessionHeaderTag ( session . status , locale ) ;
9397 const showDraftPromptInput = isHiddenDraftPlaceholder ( session ) ;
9498
9599 return (
@@ -108,33 +112,36 @@ export const AgentWorkspaceFeature = ({
108112 < span className = { `session-top-dot ${ statusTone } ${ statusTone === "active" ? "pulse" : "" } ` } />
109113 < span className = "agent-pane-title" > { displaySessionTitle ( session . title ) } </ span >
110114 </ div >
111- < div className = "agent-pane-actions" >
112- < button
113- type = "button"
114- className = "pane-action split"
115- onClick = { ( ) => onSplitPane ( node . id , "vertical" ) }
116- title = { t ( "splitVertical" ) }
117- aria-label = { t ( "splitVertical" ) }
118- >
119- < AgentSplitHorizontalIcon />
120- </ button >
121- < button
122- type = "button"
123- className = "pane-action split"
124- onClick = { ( ) => onSplitPane ( node . id , "horizontal" ) }
125- title = { t ( "splitHorizontal" ) }
126- aria-label = { t ( "splitHorizontal" ) }
127- >
128- < AgentSplitVerticalIcon />
129- </ button >
130- < button
131- type = "button"
132- className = "pane-action close"
133- onClick = { ( ) => onCloseAgentPane ( node . id , session . id ) }
134- title = { t ( "close" ) }
135- >
136- < HeaderCloseIcon />
137- </ button >
115+ < div className = "agent-pane-meta" >
116+ < span className = { `agent-pane-state-tag ${ headerTag . tone } ` } > { headerTag . label } </ span >
117+ < div className = "agent-pane-actions" >
118+ < button
119+ type = "button"
120+ className = "pane-action split"
121+ onClick = { ( ) => onSplitPane ( node . id , "vertical" ) }
122+ title = { t ( "splitVertical" ) }
123+ aria-label = { t ( "splitVertical" ) }
124+ >
125+ < AgentSplitHorizontalIcon />
126+ </ button >
127+ < button
128+ type = "button"
129+ className = "pane-action split"
130+ onClick = { ( ) => onSplitPane ( node . id , "horizontal" ) }
131+ title = { t ( "splitHorizontal" ) }
132+ aria-label = { t ( "splitHorizontal" ) }
133+ >
134+ < AgentSplitVerticalIcon />
135+ </ button >
136+ < button
137+ type = "button"
138+ className = "pane-action close"
139+ onClick = { ( ) => onCloseAgentPane ( node . id , session . id ) }
140+ title = { t ( "close" ) }
141+ >
142+ < HeaderCloseIcon />
143+ </ button >
144+ </ div >
138145 </ div >
139146 </ div >
140147 < div className = "agent-pane-body" data-testid = { `agent-pane-${ node . id } ` } >
@@ -231,6 +238,9 @@ export const AgentWorkspaceFeature = ({
231238 < span className = { `session-top-dot ${ sessionTone ( viewedSession . status ) } ${ sessionTone ( viewedSession . status ) === "active" ? "pulse" : "" } ` } />
232239 < span className = "agent-pane-title" > { displaySessionTitle ( viewedSession . title ) } </ span >
233240 </ div >
241+ < div className = "agent-pane-meta" >
242+ < span className = { `agent-pane-state-tag ${ viewedHeaderTag . tone } ` } > { viewedHeaderTag . label } </ span >
243+ </ div >
234244 </ div >
235245 < div className = "agent-pane-body" >
236246 { viewedSessionPlainStream . trim ( ) ? (
0 commit comments