@@ -573,12 +573,13 @@ export function MemoryStrip({
573573 color : string ;
574574 icon : string ;
575575 entities : MemoryEntity [ ] ;
576+ count : number ;
576577 promoteLabel : string | null ;
577578 viewLayer : LayerView ;
578579 } > = [
579- { key : 'wm' , label : 'Working Memory' , color : '#64748b' , icon : '◇' , entities : layerEntities . wm , promoteLabel : 'Promote All → Shared' , viewLayer : 'wm' } ,
580- { key : 'swm' , label : 'Shared Working Memory' , color : '#f59e0b' , icon : '◈' , entities : layerEntities . swm , promoteLabel : 'Publish to Verified Memory' , viewLayer : 'swm' } ,
581- { key : 'vm' , label : 'Verified Memory' , color : '#22c55e' , icon : '◉' , entities : layerEntities . vm , promoteLabel : null , viewLayer : 'vm' } ,
580+ { key : 'wm' , label : 'Working Memory' , color : '#64748b' , icon : '◇' , entities : layerEntities . wm , count : memory . counts . wm , promoteLabel : 'Promote All → Shared' , viewLayer : 'wm' } ,
581+ { key : 'swm' , label : 'Shared Working Memory' , color : '#f59e0b' , icon : '◈' , entities : layerEntities . swm , count : memory . counts . swm , promoteLabel : 'Publish to Verified Memory' , viewLayer : 'swm' } ,
582+ { key : 'vm' , label : 'Verified Memory' , color : '#22c55e' , icon : '◉' , entities : layerEntities . vm , count : memory . counts . vm , promoteLabel : null , viewLayer : 'vm' } ,
582583 ] ;
583584
584585 return (
@@ -594,7 +595,7 @@ export function MemoryStrip({
594595 >
595596 < div className = "v10-layer-label" style = { { color : layer . color } } >
596597 < span className = "v10-layer-abbr" > { layer . label } </ span >
597- < span className = "v10-layer-count" > { layer . entities . length } </ span >
598+ < span className = "v10-layer-count" > { layer . count } </ span >
598599 </ div >
599600 < div className = "v10-layer-items" >
600601 < span className = "v10-layer-chevron" > ▸</ span >
@@ -754,8 +755,9 @@ export function TypeBreakdownWidget({ entities }: { entities: MemoryEntity[] })
754755 ) ;
755756}
756757
757- export function LayerStatsWidget ( { entities, triples, layer } : {
758+ export function LayerStatsWidget ( { entities, entityCount , triples, layer } : {
758759 entities : MemoryEntity [ ] ;
760+ entityCount : number ;
759761 triples : number ;
760762 layer : 'wm' | 'swm' | 'vm' ;
761763} ) {
@@ -779,7 +781,7 @@ export function LayerStatsWidget({ entities, triples, layer }: {
779781 < div className = "v10-layer-summary" >
780782 < div className = "v10-layer-summary-stat" >
781783 < span className = "v10-layer-summary-label" > Knowledge Assets</ span >
782- < span className = "v10-layer-summary-value" > { entities . length } </ span >
784+ < span className = "v10-layer-summary-value" > { entityCount } </ span >
783785 </ div >
784786 < div className = "v10-layer-summary-stat" >
785787 < span className = "v10-layer-summary-label" > Triples</ span >
@@ -872,14 +874,15 @@ export function LayerActionsWidget({ layer, count, contextGraphId, onComplete }:
872874
873875// ─── Horizontal widget strip (stats + types + CTA) for the Entities tab ──
874876
875- export function LayerWidgetStrip ( { layer, entities, tripleCount, contextGraphId, onComplete } : {
877+ export function LayerWidgetStrip ( { layer, entities, entityCount , tripleCount, contextGraphId, onComplete } : {
876878 layer : 'wm' | 'swm' | 'vm' ;
877879 entities : MemoryEntity [ ] ;
880+ entityCount : number ;
878881 tripleCount : number ;
879882 contextGraphId ?: string ;
880883 onComplete ?: ( ) => void ;
881884} ) {
882- if ( entities . length === 0 ) {
885+ if ( entityCount === 0 ) {
883886 return (
884887 < div className = "v10-layer-widgets-strip empty" >
885888 < div className = "v10-canvas-empty" >
@@ -894,12 +897,12 @@ export function LayerWidgetStrip({ layer, entities, tripleCount, contextGraphId,
894897 return (
895898 < div className = "v10-layer-widgets-strip" >
896899 < div className = "v10-layer-widgets-strip-stats" >
897- < LayerStatsWidget entities = { entities } triples = { tripleCount } layer = { layer } />
900+ < LayerStatsWidget entities = { entities } entityCount = { entityCount } triples = { tripleCount } layer = { layer } />
898901 < TypeBreakdownWidget entities = { entities } />
899902 </ div >
900903 { ( layer === 'wm' || layer === 'swm' ) && (
901904 < div className = "v10-layer-widgets-strip-action" >
902- < LayerActionsWidget layer = { layer } count = { entities . length } contextGraphId = { contextGraphId } onComplete = { onComplete } />
905+ < LayerActionsWidget layer = { layer } count = { entityCount } contextGraphId = { contextGraphId } onComplete = { onComplete } />
903906 </ div >
904907 ) }
905908 </ div >
@@ -1051,6 +1054,7 @@ export function LayerContent({
10511054 const isInitialVerifiedMemoryLoad = layer === 'vm' && vmLayerStatus === 'loading' && entities . length === 0 ;
10521055 const isVerifiedMemoryUnavailable = layer === 'vm' && vmLayerStatus === 'error' && entities . length === 0 ;
10531056 const isEmptyVerifiedMemory = layer === 'vm' && vmLayerStatus === 'ok' && entities . length === 0 ;
1057+ const entityCount = memory . counts [ layer ] ;
10541058
10551059 const handleTab = ( tab : LayerContentTab ) => ( e : React . MouseEvent ) => {
10561060 e . stopPropagation ( ) ;
@@ -1112,6 +1116,7 @@ export function LayerContent({
11121116 < LayerWidgetStrip
11131117 layer = { layer }
11141118 entities = { entities }
1119+ entityCount = { entityCount }
11151120 tripleCount = { tripleCount }
11161121 contextGraphId = { contextGraphId }
11171122 onComplete = { memory . refresh }
0 commit comments