feat: add usageBarEnabled config option for quota display style (#85)

* feat: add usageBarEnabled config option for quota display style

Add configurable display style for usage limits:
- usageBarEnabled: true → visual bar (██░░ 25%)
- usageBarEnabled: false → text format (5h: 25%)

Changes:
- config.ts: Add usageBarEnabled option (default: true)
- colors.ts: Add quotaBar() and getQuotaColor() with blue color scheme
- usage.ts, session-line.ts: Conditional rendering based on config

Closes #84

* fix: add clamp guard to coloredBar for consistency

Apply the same safeWidth/safePercent guards from quotaBar to coloredBar
to prevent RangeError on malformed input values.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* chore: revert dist files to main

Remove build artifacts from PR diff. CI will rebuild dist/ after merge.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* test: add usageBarEnabled: false to baseContext

Ensures existing tests continue to check text format behavior.
The new bar format is opt-in via config.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

---------

Co-authored-by: Aster Kim <aster@spoonlabs.com>
Co-authored-by: Jarrod Watts <jarrod@cubelabs.xyz>
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Aster
2026-01-19 13:03:12 +09:00
committed by GitHub
parent eda85b4599
commit e0df6fdf90
9 changed files with 168 additions and 23 deletions

View File

@@ -33,7 +33,7 @@ function baseContext() {
showSeparators: false,
pathLevels: 1,
gitStatus: { enabled: true, showDirty: true, showAheadBehind: false, showFileStats: false },
display: { showModel: true, showContextBar: true, showConfigCounts: true, showDuration: true, showTokenBreakdown: true, showUsage: true, showTools: true, showAgents: true, showTodos: true, autocompactBuffer: 'enabled', usageThreshold: 0, environmentThreshold: 0 },
display: { showModel: true, showContextBar: true, showConfigCounts: true, showDuration: true, showTokenBreakdown: true, showUsage: true, usageBarEnabled: false, showTools: true, showAgents: true, showTodos: true, autocompactBuffer: 'enabled', usageThreshold: 0, environmentThreshold: 0 },
},
};
}