Skip to content

fix(tui): show plan usage as percent used to match web console - #192

Merged
liruifengv merged 2 commits into
mainfrom
fix/plan-usage-percent-used
May 29, 2026
Merged

fix(tui): show plan usage as percent used to match web console#192
liruifengv merged 2 commits into
mainfrom
fix/plan-usage-percent-used

Conversation

@liruifengv

Copy link
Copy Markdown
Collaborator

What

The /status and /usage Plan usage rows rendered the progress bar from the used ratio but labelled it X% left, so the bar and the number pointed in opposite directions (a nearly-empty bar next to 96% left reads as contradictory).

This aligns the TUI with the web console:

  • Show X% used instead of X% left, so the number matches the bar.
  • Move the reset hint to the right and drop the parentheses.
  • Pad the percentage column so reset hints line up across rows.

Scope is limited to the shared buildManagedUsageSection, so both /status and /usage update together. The Context window row is intentionally left unchanged.

Before / After

Before:  Weekly limit  █░░░░░░░░░░░░░░░░░░░  96% left (resets in 3d 2m)
After:   Weekly limit  █░░░░░░░░░░░░░░░░░░░  4% used  resets in 3d 2m

Testing

  • Updated usage-panel.test.ts and status-panel.test.ts assertions (test-first).
  • vitest run on the messages components: 104 passed.
  • oxlint --type-aware on changed files: 0 warnings / 0 errors.
  • tsc --noEmit: clean.

@changeset-bot

changeset-bot Bot commented May 29, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 55208c1

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@moonshot-ai/kimi-code Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@pkg-pr-new

pkg-pr-new Bot commented May 29, 2026

Copy link
Copy Markdown
pnpm dlx https://pkg.pr.new/@moonshot-ai/kimi-code@55208c1
npx https://pkg.pr.new/@moonshot-ai/kimi-code@55208c1

commit: 55208c1

The `/status` and `/usage` "Plan usage" rows previously rendered the
progress bar from the used ratio while labelling it "X% left", so the
bar direction and the number disagreed.

Display "X% used" instead, aligning the number with the bar, and move
the reset hint to the right without parentheses to mirror the web
console layout.
@liruifengv
liruifengv force-pushed the fix/plan-usage-percent-used branch from bd37d9d to ed40576 Compare May 29, 2026 05:45
@liruifengv
liruifengv merged commit 64964a0 into main May 29, 2026
6 checks passed
@liruifengv
liruifengv deleted the fix/plan-usage-percent-used branch May 29, 2026 05:48
@github-actions github-actions Bot mentioned this pull request May 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant