Skip to content

feat: add display mode setting for usage/remaining tokens#8

Merged
j4rviscmd merged 2 commits intomainfrom
feat/usage-display-displaymode
Mar 16, 2026
Merged

feat: add display mode setting for usage/remaining tokens#8
j4rviscmd merged 2 commits intomainfrom
feat/usage-display-displaymode

Conversation

@j4rviscmd
Copy link
Copy Markdown
Owner

Summary

Add zaiUsage.displayMode configuration option that allows users to choose between displaying token usage (e.g. 75.3%) or remaining tokens (e.g. 24.7%) in the status bar.

Changes

  • package.json: Added displayMode enum property with "usage" and "remaining" options
  • src/extension.ts:
    • Implemented display percentage calculation based on displayMode setting
    • Added displayMode to configuration change listeners for dynamic updates
    • Updated tooltip text to reflect current display mode

Configuration

New setting: zaiUsage.displayMode

  • Options: "usage" (default) | "remaining"
  • Usage: Displays token usage percentage
  • Remaining: Displays remaining token percentage (100 - usage)

Example

When displayMode is set to "remaining":

  • Status bar shows: 24.7% (2h30m) instead of 75.3% (2h30m)
  • Tooltip shows: z.ai token remaining: 24.7% — resets in 2h30m

Add zaiUsage.displayMode configuration option that allows users to choose
between displaying token usage (e.g. 75.3%) or remaining tokens (e.g. 24.7%)
in the status bar.

Changes:
- package.json: Add displayMode enum property with "usage" and "remaining" options
- src/extension.ts: Implement display percentage calculation based on displayMode setting
- Add displayMode to configuration change listeners for dynamic updates
- Update tooltip text to reflect current display mode
@j4rviscmd j4rviscmd added the enhancement New feature or request label Mar 16, 2026
Add documentation for the new zaiUsage.displayMode configuration option:
- Update Features section to mention remaining tokens display
- Add displayMode to Settings table
- Add remaining mode example to Status bar examples
- Add note about displayMode configuration
@j4rviscmd j4rviscmd self-assigned this Mar 16, 2026
@j4rviscmd j4rviscmd merged commit dad26d2 into main Mar 16, 2026
4 checks passed
@j4rviscmd j4rviscmd deleted the feat/usage-display-displaymode branch March 16, 2026 12:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant