@@ -59,32 +59,27 @@ export function formatProgressBar(
5959 return `│${ bar } │`
6060}
6161
62- export function formatCompressBar (
63- sessionContext : number ,
64- compressedAmount : number ,
65- width : number = 20 ,
62+ export function formatSessionMap (
63+ messageIds : string [ ] ,
64+ prunedMessages : Map < string , number > ,
65+ width : number = 50 ,
6666) : string {
67- if ( sessionContext <= 0 ) return `│${ "░" . repeat ( width ) } │ 0%`
68-
69- // sessionContext already includes compressedAmount (it's the full session total)
70- const remainingRatio = ( sessionContext - compressedAmount ) / sessionContext
71- const remainingWidth = Math . round ( remainingRatio * width )
72- const compressedWidth = width - remainingWidth
73- const reductionPercent = - Math . round ( ( compressedAmount / sessionContext ) * 100 )
74-
75- clog . info ( C . COMPRESS , `formatCompressBar` , {
76- sessionContext,
77- compressedAmount,
78- remainingRatio : remainingRatio . toFixed ( 4 ) ,
79- remainingWidth,
80- compressedWidth,
81- reductionPercent,
82- } )
83-
84- const remainingBar = "█" . repeat ( Math . max ( 0 , remainingWidth ) )
85- const compressedBar = "░" . repeat ( Math . max ( 0 , compressedWidth ) )
86-
87- return `│${ remainingBar } ${ compressedBar } │`
67+ const total = messageIds . length
68+ if ( total === 0 ) return `│${ "░" . repeat ( width ) } │`
69+
70+ const bar = new Array ( width ) . fill ( "█" )
71+
72+ for ( let m = 0 ; m < total ; m ++ ) {
73+ if ( prunedMessages . has ( messageIds [ m ] ) ) {
74+ const start = Math . floor ( ( m / total ) * width )
75+ const end = Math . floor ( ( ( m + 1 ) / total ) * width )
76+ for ( let i = start ; i < end ; i ++ ) {
77+ bar [ i ] = "░"
78+ }
79+ }
80+ }
81+
82+ return `│${ bar . join ( "" ) } │`
8883}
8984
9085export function shortenPath ( input : string , workingDirectory ?: string ) : string {
0 commit comments