@@ -10,8 +10,8 @@ import RunEventsPanel from "./RunEventsPanel";
1010import JsonHighlight from "../shared/JsonHighlight" ;
1111import DebugControls from "../debug/DebugControls" ;
1212
13- type SidebarTab = "primary" | "io" | "logs" ;
14- type MobileTab = "traces" | "primary" | "io" | "logs" ;
13+ type SidebarTab = "primary" | "events" | " io" | "logs" ;
14+ type MobileTab = "traces" | "primary" | "events" | " io" | "logs" ;
1515
1616interface Props {
1717 run : RunSummary ;
@@ -131,6 +131,9 @@ export default function RunDetailsPanel({ run, ws, isMobile }: Props) {
131131 const primaryLabel = isChatMode ? "Chat" : "Events" ;
132132 const primaryColor = isChatMode ? "var(--accent)" : "var(--success)" ;
133133
134+ const tabColor = ( id : string ) =>
135+ id === "primary" ? primaryColor : id === "events" ? "var(--success)" : "var(--accent)" ;
136+
134137 const interrupt = useRunStore ( ( s ) => s . activeInterrupt [ run . id ] ?? null ) ;
135138
136139 // Status indicator for the tab bar
@@ -162,6 +165,7 @@ export default function RunDetailsPanel({ run, ws, isMobile }: Props) {
162165 const mobileTabs : { id : MobileTab ; label : string ; count ?: number } [ ] = [
163166 { id : "traces" , label : "Traces" , count : traces . length } ,
164167 { id : "primary" , label : primaryLabel } ,
168+ ...( isChatMode ? [ { id : "events" as const , label : "Events" , count : stateEvents . length } ] : [ ] ) ,
165169 { id : "io" , label : "I/O" } ,
166170 { id : "logs" , label : "Logs" , count : logs . length } ,
167171 ] ;
@@ -189,13 +193,11 @@ export default function RunDetailsPanel({ run, ws, isMobile }: Props) {
189193 style = { {
190194 color :
191195 mobileTab === tab . id
192- ? tab . id === "primary"
193- ? primaryColor
194- : "var(--accent)"
196+ ? tabColor ( tab . id )
195197 : "var(--text-muted)" ,
196198 background :
197199 mobileTab === tab . id
198- ? `color-mix(in srgb, ${ tab . id === "primary" ? primaryColor : "var(--accent)" } 10%, transparent)`
200+ ? `color-mix(in srgb, ${ tabColor ( tab . id ) } 10%, transparent)`
199201 : "transparent" ,
200202 } }
201203 >
@@ -228,6 +230,9 @@ export default function RunDetailsPanel({ run, ws, isMobile }: Props) {
228230 < RunEventsPanel events = { stateEvents } runStatus = { run . status } />
229231 )
230232 ) }
233+ { mobileTab === "events" && (
234+ < RunEventsPanel events = { stateEvents } runStatus = { run . status } />
235+ ) }
231236 { mobileTab === "io" && (
232237 < IOView run = { run } />
233238 ) }
@@ -242,6 +247,7 @@ export default function RunDetailsPanel({ run, ws, isMobile }: Props) {
242247 // Desktop layout (unchanged)
243248 const sidebarTabs : { id : SidebarTab ; label : string ; count ?: number } [ ] = [
244249 { id : "primary" , label : primaryLabel } ,
250+ ...( isChatMode ? [ { id : "events" as const , label : "Events" , count : stateEvents . length } ] : [ ] ) ,
245251 { id : "io" , label : "I/O" } ,
246252 { id : "logs" , label : "Logs" , count : logs . length } ,
247253 ] ;
@@ -299,13 +305,11 @@ export default function RunDetailsPanel({ run, ws, isMobile }: Props) {
299305 style = { {
300306 color :
301307 sidebarTab === tab . id
302- ? tab . id === "primary"
303- ? primaryColor
304- : "var(--accent)"
308+ ? tabColor ( tab . id )
305309 : "var(--text-muted)" ,
306310 background :
307311 sidebarTab === tab . id
308- ? `color-mix(in srgb, ${ tab . id === "primary" ? primaryColor : "var(--accent)" } 10%, transparent)`
312+ ? `color-mix(in srgb, ${ tabColor ( tab . id ) } 10%, transparent)`
309313 : "transparent" ,
310314 } }
311315 onMouseEnter = { ( e ) => {
@@ -342,6 +346,9 @@ export default function RunDetailsPanel({ run, ws, isMobile }: Props) {
342346 < RunEventsPanel events = { stateEvents } runStatus = { run . status } />
343347 )
344348 ) }
349+ { sidebarTab === "events" && (
350+ < RunEventsPanel events = { stateEvents } runStatus = { run . status } />
351+ ) }
345352 { sidebarTab === "io" && (
346353 < IOView run = { run } />
347354 ) }
0 commit comments