Skip to content

feat(quota): display weekly reset countdown - #264

Open
dvd233 wants to merge 2 commits into
MiniMax-AI:mainfrom
dvd233:codex/feat/weekly-quota-reset-248
Open

dvd233 wants to merge 2 commits into
MiniMax-AI:mainfrom
dvd233:codex/feat/weekly-quota-reset-248

Conversation

@dvd233

@dvd233 dvd233 commented Sep 21, 2026 •

Copy link
Copy Markdown

Summary

Fixes #248.

  • Show the weekly quota reset countdown in the quota table header, aligned with the existing reset column.
  • Reuse the API's weekly_start_time, weekly_end_time, and weekly_remains_time fields.
  • Render long weekly durations as days and hours while preserving existing per-model reset formatting.

Test Plan

  • bun test test/output/quota-table.test.ts — 11 passed
  • bun run typecheck — passed
  • bun run lint — 0 errors; one pre-existing warning in test/sdk/speech.test.ts
  • bun run build — passed
  • bun test — 563 passed, 12 existing Windows-environment failures involving permissions, symlinks, proxy state, and powershell.exe; the changed quota suite passes

Notes

PR #255 added seconds for sub-minute reset durations and explicitly stated that the weekly header proposed in #248 was not included. This PR implements that remaining UI request without changing API or JSON output.


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

@NianJiuZst NianJiuZst left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed head 3b1a83a. The focused quota-table suite (11/11) and typecheck pass locally, but I found two cases to address:

  1. weeklyModel = models[0] suppresses the new header countdown whenever the first model is "not in plan", even if a later model has a valid weekly quota. I reproduced this with an unavailable video model first and an available general model second: the table showed no 1w Reset. Please select a model with a usable weekly window before deciding whether to render the header countdown, and add a mixed-model regression test.

  2. Issue #248 specifies hours only below one day. With weekly_remains_time set to 23 hours, the new header renders 1w Reset 23h 0m. Please use the requested compact format for the weekly header.

The only reported GitHub check is skipped, so CI has not independently validated this head.

@dvd233

dvd233 commented Sep 25, 2026

Copy link
Copy Markdown
Author

Addressed both review points in commit 5f5e466: the weekly header now selects the first usable weekly-quota model (with a mixed unavailable/available regression test), and sub-day weekly countdowns use compact hours (23h, without a trailing 0m). Focused quota-table tests pass 11/11 and typecheck passes locally; the repository check remains skipped by its workflow.

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): display weekly window reset countdown in the quota header

2 participants