11import type { ReactNode } from "react" ;
2- import type { Locale , Translator } from "../../i18n" ;
3- import {
4- WorkspaceBranchIcon ,
5- WorkspaceChangesIcon ,
6- WorkspaceCodeIcon ,
7- WorkspaceFolderIcon ,
8- WorkspaceTerminalIcon
9- } from "../icons" ;
2+ import type { Translator } from "../../i18n" ;
3+ import type { WorkspaceShellSummaryItem } from "../../features/workspace/workspace-shell-summary" ;
4+ import { WorkspaceCodeIcon , WorkspaceTerminalIcon } from "../icons" ;
105
116type WorkspaceShellProps = {
12- locale : Locale ;
137 isFocusMode : boolean ;
148 isCodeExpanded : boolean ;
159 showAgentPanel : boolean ;
1610 showCodePanel : boolean ;
1711 showTerminalPanel : boolean ;
1812 rightSplit : number ;
19- workspaceFolderName : string ;
20- branchName : string ;
21- changeCount : number ;
13+ statusItems : WorkspaceShellSummaryItem [ ] ;
14+ runtimeHint : string ;
2215 statusBanner ?: ReactNode ;
2316 agentPanel : ReactNode ;
2417 codePanel : ReactNode ;
@@ -28,16 +21,14 @@ type WorkspaceShellProps = {
2821} ;
2922
3023export const WorkspaceShell = ( {
31- locale,
3224 isFocusMode,
3325 isCodeExpanded,
3426 showAgentPanel,
3527 showCodePanel,
3628 showTerminalPanel,
3729 rightSplit,
38- workspaceFolderName,
39- branchName,
40- changeCount,
30+ statusItems,
31+ runtimeHint,
4132 statusBanner,
4233 agentPanel,
4334 codePanel,
@@ -46,47 +37,37 @@ export const WorkspaceShell = ({
4637 t
4738} : WorkspaceShellProps ) => (
4839 < main className = "workspace-shell" >
49- < div className = "workspace-main-header workspace-shell-header" >
50- < div className = "workspace-main-header-copy" >
51- < div className = "workspace-main-meta" >
52- < span className = "workspace-main-chip" >
53- < WorkspaceFolderIcon />
54- < span > { workspaceFolderName } </ span >
55- </ span >
56- < span className = "workspace-main-chip" >
57- < WorkspaceBranchIcon />
58- < span > { branchName || "—" } </ span >
59- </ span >
60- < span className = "workspace-main-chip" >
61- < WorkspaceChangesIcon />
62- < span > { t ( "changesCount" , { count : changeCount } ) } </ span >
63- </ span >
64- </ div >
40+ < div className = "workspace-status-strip" data-testid = "workspace-status-strip" >
41+ < div className = "workspace-status-strip-items" >
42+ { statusItems . map ( ( item ) => (
43+ < div key = { item . key } className = { `workspace-status-item tone-${ item . tone ?? "neutral" } ` } >
44+ < span className = "workspace-status-label" > { item . label } </ span >
45+ < strong className = "workspace-status-value" > { item . value } </ strong >
46+ </ div >
47+ ) ) }
6548 </ div >
66- < div className = "workspace-main -actions" >
49+ < div className = "workspace-status-strip -actions" >
6750 < button
6851 type = "button"
69- className = { `workspace-panel-toggle ${ showCodePanel ? "active" : "" } ` }
52+ className = { `workspace-panel-toggle icon-only ${ showCodePanel ? "active" : "" } ` }
7053 onClick = { ( ) => onToggleRightPane ( "code" ) }
7154 title = { t ( "codePanel" ) }
7255 aria-pressed = { showCodePanel }
56+ aria-label = { t ( "codePanel" ) }
7357 >
7458 < WorkspaceCodeIcon />
75- < span > { t ( "codePanel" ) } </ span >
7659 </ button >
7760 < button
7861 type = "button"
79- className = { `workspace-panel-toggle ${ showTerminalPanel ? "active" : "" } ` }
62+ className = { `workspace-panel-toggle icon-only ${ showTerminalPanel ? "active" : "" } ` }
8063 onClick = { ( ) => onToggleRightPane ( "terminal" ) }
8164 title = { t ( "terminalPanel" ) }
8265 aria-pressed = { showTerminalPanel }
66+ aria-label = { t ( "terminalPanel" ) }
8367 >
8468 < WorkspaceTerminalIcon />
85- < span > { t ( "terminalPanel" ) } </ span >
8669 </ button >
87- < span className = "workspace-shortcut-hint" >
88- { locale === "zh" ? "⌘/Ctrl+K 快速操作" : "⌘/Ctrl+K actions" }
89- </ span >
70+ < span className = "workspace-shortcut-hint" > { runtimeHint } </ span >
9071 </ div >
9172 </ div >
9273
0 commit comments