@@ -47,7 +47,6 @@ export default function CacheDiagnostics() {
4747 ) ;
4848 const [ harnessFilter , setHarnessFilter ] = createSignal < HarnessFilter > ( "all" ) ;
4949 const [ hideSubagents , setHideSubagents ] = createSignal ( true ) ;
50- const [ subagentIds , setSubagentIds ] = createSignal < Set < string > > ( new Set ( ) ) ;
5150 const [ expandedTurns , setExpandedTurns ] = createSignal < Set < string > > ( new Set ( ) ) ;
5251 // Window size = how many recent events to keep per session (the picker). Drives
5352 // both the per-session card stats and the selected session's chart/list.
@@ -121,14 +120,11 @@ export default function CacheDiagnostics() {
121120 const applySessionMeta = ( sessions : SessionRow [ ] ) => {
122121 cachedSessions = sessions ;
123122 const names : Record < string , string > = { } ;
124- const subs = new Set < string > ( ) ;
125123 for ( const s of sessions ) {
126124 const key = windowKey ( s . harness , s . session_id ) ;
127125 if ( s . title ) names [ key ] = s . title ;
128- if ( s . is_subagent ) subs . add ( key ) ;
129126 }
130127 setSessionNames ( names ) ;
131- setSubagentIds ( subs ) ;
132128 } ;
133129
134130 // The recent sessions we keep windows for: top-N by activity, non-subagent
@@ -285,9 +281,6 @@ export default function CacheDiagnostics() {
285281 }
286282 } ;
287283
288- const isSubagent = ( harness : Harness , sessionId : string ) =>
289- subagentIds ( ) . has ( `${ harness } :${ sessionId } ` ) ;
290-
291284 // Cards: per-session stats aggregated over each session's OWN window (never a
292285 // shared global pool), ordered by the session table's recency. Reading
293286 // windowsVersion() makes this re-run when any window changes.
@@ -329,24 +322,17 @@ export default function CacheDiagnostics() {
329322 return rows . slice ( 0 , visibleCardCount ( ) ) ;
330323 } ;
331324
332- // Chart/list events: the selected session's window, or — when nothing is
333- // selected ("Show all") — every recent window merged (filtered). Reading
334- // windowsVersion() ties the downstream memos to window mutations.
325+ // Chart/list events: the selected session's window. There is no combined /
326+ // merged "all sessions" view: a session is always selected (cards select,
327+ // never deselect), so an empty result only occurs in the brief pre-selection
328+ // window on cold start. Reading windowsVersion() ties the downstream memos to
329+ // window mutations.
335330 const filteredEvents = ( ) => {
336331 windowsVersion ( ) ;
337332 const selected = selectedSession ( ) ;
338- if ( selected ) {
339- const win = cachedWindows . get ( windowKey ( selected . harness , selected . sessionId ) ) ;
340- return win ? win . events : [ ] ;
341- }
342- const harness = harnessFilter ( ) ;
343- const all : DbCacheEvent [ ] = [ ] ;
344- for ( const win of cachedWindows . values ( ) ) {
345- if ( harness !== "all" && win . harness !== harness ) continue ;
346- if ( hideSubagents ( ) && isSubagent ( win . harness , win . sessionId ) ) continue ;
347- all . push ( ...win . events ) ;
348- }
349- return all ;
333+ if ( ! selected ) return [ ] ;
334+ const win = cachedWindows . get ( windowKey ( selected . harness , selected . sessionId ) ) ;
335+ return win ? win . events : [ ] ;
350336 } ;
351337
352338 // Ordering used for worst-severity promotion across multi-step turns.
@@ -493,10 +479,16 @@ export default function CacheDiagnostics() {
493479 < FilterSelect
494480 value = { harnessFilter ( ) }
495481 onChange = { ( value ) => {
496- setHarnessFilter ( value as HarnessFilter ) ;
497- // Clear the selection → Lane B switches to the global recent
498- // window (selectSession triggers the event refetch).
499- selectSession ( null ) ;
482+ const harness = value as HarnessFilter ;
483+ setHarnessFilter ( harness ) ;
484+ // Keep a session selected (no combined view): if the current
485+ // selection no longer matches the harness filter, re-select the
486+ // top card of the filtered set.
487+ const sel = selectedSession ( ) ;
488+ if ( sel && harness !== "all" && sel . harness !== harness ) {
489+ const top = filteredStats ( ) [ 0 ] ;
490+ selectSession ( top ? { harness : top . harness , sessionId : top . session_id } : null ) ;
491+ }
500492 } }
501493 placeholder = "Harness"
502494 options = { [
@@ -546,20 +538,6 @@ export default function CacheDiagnostics() {
546538 style = { { "font-size" : "11px" , color : "var(--text-secondary)" , "margin-bottom" : "8px" } }
547539 >
548540 Recent Sessions
549- < Show when = { selectedSession ( ) } >
550- < span > · </ span >
551- < button
552- type = "button"
553- class = "btn sm"
554- style = { { padding : "1px 6px" , "font-size" : "10px" , "margin-left" : "4px" } }
555- onClick = { ( ) => {
556- // Clear the selection → Lane B shows the global recent window.
557- selectSession ( null ) ;
558- } }
559- >
560- Show all
561- </ button >
562- </ Show >
563541 </ div >
564542 < div
565543 ref = { measureCardRow }
@@ -588,13 +566,12 @@ export default function CacheDiagnostics() {
588566 "text-align" : "left" ,
589567 } }
590568 onClick = { ( ) => {
591- // Toggle selection. selectSession refetches Lane B for the
592- // new scope (the selected session, or the global recent
593- // window when cleared) — no separate global-load path.
594- const next = isActive ( )
595- ? null
596- : { harness : stat . harness , sessionId : stat . session_id } ;
597- selectSession ( next ) ;
569+ // Select-only: clicking a card focuses that session's
570+ // window. Clicking the already-active card is a no-op
571+ // (there is no combined/merged view to toggle back to).
572+ if ( ! isActive ( ) ) {
573+ selectSession ( { harness : stat . harness , sessionId : stat . session_id } ) ;
574+ }
598575 } }
599576 >
600577 < div
0 commit comments