feat(quota): show reset credit expiry details - #56
Merged
Cmochance merged 4 commits intoJul 26, 2026
Conversation
…tail failure - Add vitest as a devDependency with a standalone vitest.config.ts (the Vite root points at the per-platform front-end, so an inherited root would never scan the shared tests), a test:front script, and a CI step so the new front-end tests actually run in CI. - Move the reset-credit card styles from win/front/styles.css into shared/front/base.css and mirror the flex-to-grid quota-stack adaptation into the macOS layer: the markup is rendered by the shared front-end on both platforms, but only Windows had the styles, leaving macOS cards unstyled inside the old flex row. - Backfill previously confirmed reset-credit details from stored metadata when the detail endpoint fails: every API write-back path persists the snapshot wholesale, so a transient failure used to wipe the cards this feature intends to preserve. - Align the docs/CHANGELOG additions with the repo's English convention.
Owner
|
@Baker4real 感谢贡献!为加速合并,maintainer 侧直接在分支上补了一个 commit(b842e50),说明如下:
本地验证: |
This was referenced Jul 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
背景
当前账号额度接口只返回重置卡数量,用户无法确认每张卡的发放时间和到期时间,也无法在多个账号之间判断哪张卡仍然有效。
改动
/wham/usage后,使用同一轮请求最终采用的 access token 和chatgpt-account-id请求/wham/rate-limit-reset-credits。granted_at/expires_at,只持久化时间字段,不持久化卡片 ID。Asia/Shanghai显示。profile.json增加默认兼容,并补充后端解析、前端展示、时区和持久化回归测试。安全边界
验证
npm run test:rust:windows:135 passedcargo fmt --manifest-path src-tauri/Cargo.toml -- --checknpx tsc --noEmitnpx vitest run --root .:3 passednpm run build:成功来源分支:
Baker4real/Codex_Account_Switch:codex/pr-reset-credit-expiry