@@ -129,14 +129,15 @@ test('formatStatusBarText: loaded state includes PromptFuel prefix', () => {
129129 assert . ok ( t . startsWith ( 'PromptFuel:' ) , `expected "PromptFuel:" prefix in "${ t } "` ) ;
130130} ) ;
131131
132- test ( 'formatStatusBarText: loaded includes Claude label and compact tokens ' , ( ) => {
132+ test ( 'formatStatusBarText: loaded shows compact aggregate with local suffix ' , ( ) => {
133133 const status = applyRefreshResults (
134134 createInitialStatus ( [ 'claude' ] ) ,
135135 [ { providerId : 'claude' , status : 'ok' , totalTokens : 5000 , totalAssistantMessages : 2 , filesFound : 1 } ] ,
136136 ) ;
137137 const t = formatStatusBarText ( status ) ;
138- assert . ok ( t . includes ( 'Claude' ) , `expected "Claude" in "${ t } "` ) ;
139138 assert . ok ( t . includes ( '5.0K' ) , `expected "5.0K" in "${ t } "` ) ;
139+ assert . ok ( t . includes ( 'local' ) , `expected "local" suffix in "${ t } "` ) ;
140+ assert . ok ( ! t . includes ( ' | ' ) , `should not include per-provider pipe separator in "${ t } "` ) ;
140141} ) ;
141142
142143test ( 'formatStatusBarText: error/unknown returns refresh failed' , ( ) => {
@@ -148,7 +149,7 @@ test('formatStatusBarText: error/unknown returns refresh failed', () => {
148149 assert . strictEqual ( t , 'PromptFuel: refresh failed' ) ;
149150} ) ;
150151
151- test ( 'formatStatusBarText: mixed providers joined with pipe ' , ( ) => {
152+ test ( 'formatStatusBarText: mixed providers shows single aggregate ' , ( ) => {
152153 const status = applyRefreshResults (
153154 createInitialStatus ( [ 'claude' , 'codex' ] ) ,
154155 [
@@ -158,12 +159,14 @@ test('formatStatusBarText: mixed providers joined with pipe', () => {
158159 ) ;
159160 const t = formatStatusBarText ( status ) ;
160161 assert . ok ( t . startsWith ( 'PromptFuel:' ) , `expected "PromptFuel:" prefix in "${ t } "` ) ;
161- assert . ok ( t . includes ( ' | ' ) , `expected " | " separator in "${ t } "` ) ;
162+ assert . ok ( t . includes ( '5.0K' ) , `expected aggregate "5.0K" in "${ t } "` ) ;
163+ assert . ok ( t . includes ( 'local' ) , `expected "local" suffix in "${ t } "` ) ;
164+ assert . ok ( ! t . includes ( ' | ' ) , `should not include per-provider pipe separator in "${ t } "` ) ;
162165} ) ;
163166
164167// === Status bar text: both loaded ===
165168
166- test ( 'formatStatusBarText: both loaded shows compact summary ' , ( ) => {
169+ test ( 'formatStatusBarText: both loaded shows single aggregate total ' , ( ) => {
167170 const status = applyRefreshResults (
168171 createInitialStatus ( [ 'claude' , 'codex' ] ) ,
169172 [
@@ -172,10 +175,9 @@ test('formatStatusBarText: both loaded shows compact summary', () => {
172175 ] ,
173176 ) ;
174177 const t = formatStatusBarText ( status ) ;
175- assert . ok ( t . includes ( 'Claude' ) , `expected "Claude" in "${ t } "` ) ;
176- assert . ok ( t . includes ( '12.4K' ) , `expected "12.4K" in "${ t } "` ) ;
177- assert . ok ( t . includes ( 'Codex' ) , `expected "Codex" in "${ t } "` ) ;
178- assert . ok ( t . includes ( '3.1K' ) , `expected "3.1K" in "${ t } "` ) ;
178+ assert . ok ( t . includes ( '15.5K' ) , `expected aggregate "15.5K" in "${ t } "` ) ;
179+ assert . ok ( t . includes ( 'local' ) , `expected "local" suffix in "${ t } "` ) ;
180+ assert . ok ( ! t . includes ( ' | ' ) , `should not include per-provider pipe separator in "${ t } "` ) ;
179181} ) ;
180182
181183// === Status bar text: large token formatting ===
@@ -187,6 +189,7 @@ test('formatStatusBarText: large token counts use M suffix', () => {
187189 ) ;
188190 const t = formatStatusBarText ( status ) ;
189191 assert . ok ( t . includes ( '2.5M' ) , `expected "2.5M" in "${ t } "` ) ;
192+ assert . ok ( t . includes ( 'local' ) , `expected "local" suffix in "${ t } "` ) ;
190193} ) ;
191194
192195test ( 'formatStatusBarText: small token counts show raw number' , ( ) => {
@@ -196,6 +199,7 @@ test('formatStatusBarText: small token counts show raw number', () => {
196199 ) ;
197200 const t = formatStatusBarText ( status ) ;
198201 assert . ok ( t . includes ( '500' ) , `expected "500" in "${ t } "` ) ;
202+ assert . ok ( t . includes ( 'local' ) , `expected "local" suffix in "${ t } "` ) ;
199203} ) ;
200204
201205// === Disabled provider omitted ===
@@ -236,11 +240,48 @@ test('formatTooltip: total tokens and messages shown for loaded providers', () =
236240 ] ,
237241 ) ;
238242 const tooltip = formatTooltip ( status ) ;
239- assert . ok ( tooltip . includes ( 'Total:' ) , `expected "Total:" in tooltip` ) ;
243+ assert . ok ( tooltip . includes ( 'Total local history :' ) , `expected "Total local history :" in tooltip` ) ;
240244 assert . ok ( tooltip . includes ( '15.0K' ) , `expected "15.0K" total in tooltip` ) ;
241245 assert . ok ( tooltip . includes ( '5 messages' ) , `expected "5 messages" total in tooltip` ) ;
242246} ) ;
243247
248+ // === Tooltip: local history disclaimers ===
249+
250+ test ( 'formatTooltip: includes Local history only disclaimer' , ( ) => {
251+ const status = createInitialStatus ( [ 'claude' ] ) ;
252+ const tooltip = formatTooltip ( status ) ;
253+ assert . ok ( tooltip . includes ( 'Local history only' ) , `expected "Local history only" in tooltip` ) ;
254+ } ) ;
255+
256+ test ( 'formatTooltip: includes Live quota not enabled disclaimer' , ( ) => {
257+ const status = createInitialStatus ( [ 'claude' ] ) ;
258+ const tooltip = formatTooltip ( status ) ;
259+ assert . ok ( tooltip . includes ( 'Live quota not enabled yet' ) , `expected "Live quota not enabled yet" in tooltip` ) ;
260+ } ) ;
261+
262+ test ( 'formatTooltip: includes Snapshots not included disclaimer' , ( ) => {
263+ const status = createInitialStatus ( [ 'claude' ] ) ;
264+ const tooltip = formatTooltip ( status ) ;
265+ assert . ok ( tooltip . includes ( 'Snapshots not included' ) , `expected "Snapshots not included" in tooltip` ) ;
266+ } ) ;
267+
268+ // === Tooltip: provider splits still exist ===
269+
270+ test ( 'formatTooltip: provider token splits still present' , ( ) => {
271+ const status = applyRefreshResults (
272+ createInitialStatus ( [ 'claude' , 'codex' ] ) ,
273+ [
274+ { providerId : 'claude' , status : 'ok' , totalTokens : 10000 , totalAssistantMessages : 3 , filesFound : 2 } ,
275+ { providerId : 'codex' , status : 'ok' , totalTokens : 5000 , totalAssistantMessages : 2 , filesFound : 1 } ,
276+ ] ,
277+ ) ;
278+ const tooltip = formatTooltip ( status ) ;
279+ assert . ok ( tooltip . includes ( 'Claude' ) , `expected "Claude" provider line in tooltip` ) ;
280+ assert . ok ( tooltip . includes ( 'Codex' ) , `expected "Codex" provider line in tooltip` ) ;
281+ assert . ok ( tooltip . includes ( '10.0K' ) , `expected "10.0K" for Claude in tooltip` ) ;
282+ assert . ok ( tooltip . includes ( '5.0K' ) , `expected "5.0K" for Codex in tooltip` ) ;
283+ } ) ;
284+
244285// === formatTokenCount ===
245286
246287test ( 'formatTokenCount: M suffix for >= 1M' , ( ) => {
@@ -273,9 +314,9 @@ test('formatRefreshSummary: ok includes messages and tokens, no file paths', ()
273314 assert . ok ( ! s . includes ( '/' ) , `should not include slashes in "${ s } "` ) ;
274315} ) ;
275316
276- test ( 'formatRefreshSummary: no-data shows no local usage' , ( ) => {
317+ test ( 'formatRefreshSummary: no-data shows no local usage history ' , ( ) => {
277318 const s = formatRefreshSummary ( [ { providerId : 'codex' , status : 'no-data' } ] ) ;
278- assert . ok ( s . includes ( 'no local usage' ) , `expected "no local usage" in "${ s } "` ) ;
319+ assert . ok ( s . includes ( 'no local usage history ' ) , `expected "no local usage history " in "${ s } "` ) ;
279320} ) ;
280321
281322test ( 'formatRefreshSummary: parse errors shown in summary' , ( ) => {
@@ -432,9 +473,27 @@ test('dashboard: uses local history wording, not subscription', () => {
432473 const mockWebview = { cspSource : 'http://example.com' } ;
433474 const html = buildDashboardHtml ( mockWebview , model ) ;
434475 assert . ok ( html . includes ( 'Local usage history' ) , `expected "Local usage history" subtitle` ) ;
476+ assert . ok ( html . includes ( 'Local history tokens' ) , `expected "Local history tokens" overview label` ) ;
477+ assert . ok ( html . includes ( 'Local history messages' ) , `expected "Local history messages" overview label` ) ;
435478 assert . ok ( ! html . includes ( 'subscription' ) , `should not include "subscription"` ) ;
436479} ) ;
437480
481+ test ( 'dashboard: includes local history disclaimer banner' , ( ) => {
482+ const { buildDashboardHtml } = require ( path . join ( OUT , 'panel/dashboardHtml' ) ) ;
483+ const status = applyRefreshResults (
484+ createInitialStatus ( [ 'claude' ] ) ,
485+ [
486+ { providerId : 'claude' , status : 'ok' , totalTokens : 5000 , totalAssistantMessages : 2 , filesFound : 1 } ,
487+ ] ,
488+ ) ;
489+ const model = buildDashboardModel ( status ) ;
490+ const mockWebview = { cspSource : 'http://example.com' } ;
491+ const html = buildDashboardHtml ( mockWebview , model ) ;
492+ assert . ok ( html . includes ( 'Local history only' ) , `expected "Local history only" disclaimer in HTML` ) ;
493+ assert . ok ( html . includes ( 'live quota' ) , `expected "live quota" disclaimer in HTML` ) ;
494+ assert . ok ( html . includes ( 'snapshots' ) , `expected "snapshots" disclaimer in HTML` ) ;
495+ } ) ;
496+
438497test ( 'dashboard: no file paths or .jsonl in HTML' , ( ) => {
439498 const { buildDashboardHtml } = require ( path . join ( OUT , 'panel/dashboardHtml' ) ) ;
440499 const status = applyRefreshResults (
0 commit comments