fix: normalize tabs in usage notes rendering

Address P2 review: sanitizeText preserves \t which can create visual
holes in rendered output. Add .replace(/\t/g, '  ') to provider-wide
and per-limit notes in usage-report.ts and usage-cli.ts, matching the
TUI path which already uses replaceTabs().
This commit is contained in:
oldschoola
2026-06-23 15:49:18 -07:00
parent 04c3199511
commit cbbdfda2ce
2 changed files with 7 additions and 3 deletions
+2 -1
View File
@@ -452,7 +452,8 @@ export function formatUsageBreakdown(
);
// Provider-wide disclaimers render once per provider, not per limit.
const providerNotes = [...new Set(providerReports.flatMap(report => report.notes ?? []))];
for (const note of providerNotes) lines.push(` ${chalk.dim(sanitizeText(note.replace(/[\r\n]+/g, " ")))}`);
for (const note of providerNotes)
lines.push(` ${chalk.dim(sanitizeText(note.replace(/[\r\n]+/g, " ").replace(/\t/g, " ")))}`);
const labelWidth = providerReports
.flatMap(report => report.limits)