Skip to content

feat(quota): visually separate reset countdown and show window interval - #243

Merged
SaladDay merged 1 commit into
mainfrom
feat/quota-reset-column
Aug 28, 2026
Merged

feat(quota): visually separate reset countdown and show window interval#243
SaladDay merged 1 commit into
mainfrom
feat/quota-reset-column

Conversation

@SaladDay

@SaladDay SaladDay commented Aug 28, 2026

Copy link
Copy Markdown
Collaborator

Summary

Implements the mmx quota layout proposed by @airvzxf in #240: the reset countdown now lives in its own boxed column, prefixed with the quota window duration (5h / 1d / 1w) so it is clear which window the countdown applies to.

Closes #240

Before

╭───────────────────────────────────────────────────────────────────────────╮
│ MINIMAX  TokenPlan Quota                    Week: 2026-08-24 — 2026-08-31 │
├───────────────────────────────────────────────────────────────────────────┤
│ general  Left             94%   Wk left             34%    Reset 2h 33m   │
├───────────────────────────────────────────────────────────────────────────┤
│ video    Left            3 / 3  Wk left            3 / 21  Reset 6h 33m   │
╰───────────────────────────────────────────────────────────────────────────╯

After

╭─────────────────────────────────────────────────────────────────────────────╮
│ MINIMAX  TokenPlan Quota                      Week: 2026-08-24 — 2026-08-31 │
├───────────────────────────────────────────────────────────┬─────────────────┤
│ general  Left             94%   Wk left             34%   │ 5h Reset 2h 33m │
├───────────────────────────────────────────────────────────┼─────────────────┤
│ video    Left            3 / 3  Wk left            3 / 21 │ 1d Reset 6h 33m │
╰───────────────────────────────────────────────────────────┴─────────────────╯

(Bars are rendered as colored blocks in a real terminal; they are stripped in the text mockups above.)

Changes

  • formatWindow() derives the window tag from end_time - start_time — no API changes needed.
  • boxLine() takes an optional divider offset and draws / / junctions (+ in --no-color ASCII mode).
  • In color mode the 5h Reset label is dimmed so the countdown stays the visual focus; not in plan rows render Reset — without a window tag.
  • The Left / Wk left labels are kept (rather than relying on color alone, as floated later in the issue) so the table stays readable in --no-color mode and for color-blind users.
  • The per-model reset column is kept per row instead of a shared footer row, since reset times differ between models.

Testing

  • New test asserting the window tags and the boxed reset column.
  • bun test — quota-table suite 8/8; full suite has 2 pre-existing failures (test/sdk/file.test.ts, test/commands/auth/refresh.test.ts) that also fail on main.
  • tsc --noEmit and eslint clean.
  • Alignment verified line-by-line for: color EN, CN region (CJK double-width labels), unlimited + not in plan edge rows, and --no-color ASCII mode.

View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

Box the reset countdown into its own table column and prefix it with the
quota window duration (5h / 1d / 1w), computed from the interval start
and end times. Implements the layout proposed in #240.
@SaladDay
SaladDay merged commit 077f4c3 into main Aug 28, 2026
4 of 5 checks passed
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.

feat(quota): visually separate and clarify reset window intervals in quota output

1 participant