Skip to content

fix(gui): render subscription credit quota bars consistently - #3798

Merged
lidge-jun merged 4 commits into
devfrom
codex/t4-02-credit-bars-81a8
Sep 6, 2026
Merged

fix(gui): render subscription credit quota bars consistently#3798
lidge-jun merged 4 commits into
devfrom
codex/t4-02-credit-bars-81a8

Conversation

@lidge-jun

@lidge-jun lidge-jun commented Sep 6, 2026

Copy link
Copy Markdown
Owner

Summary

  • Carry feat(quota): show subscription credits in capacity bars #3728: show direct subscription credits, preserve canonical custom-window precedence and partial coverage, and keep narrow cards readable. Existing quota/accounting fields are unchanged.
  • Manual review chain, layer 2/5; base codex/t4-01-pool-status-81a8. No GitHub native stack registration. Each layer is independently scoped; this chain batches review and final verification.

Verification

Manual review chain (bottom-up): #3797#3798#3799#3800#3801

  • Local test suites, typecheck and builds were not run, per maintainer instruction. Source audits and git diff --check were performed.
  • Final combined Cross-platform CI (lane=all) passed all 25 jobs on d1915c470bdcc95bbb3f7c716152ed013622634f. Lower test runs are deferred per the maintainer-directed combined-evidence strategy; skipped/cancelled runs are not passing evidence.
  • Independent Astra high source/security reviews and actual Aside fixture rendering are recorded where applicable. All scoped source/security reviews passed. Repaired-source remote diagnostics passed; the final full cross-platform matrix passed all 25 jobs.
  • Maintainer integration policy: the owner explicitly authorized final-combined-CI-first validation and eventual bottom-up admin merge. Exact combined CI is green; fresh per-PR head/base/actor and maintainer-objection checks precede each admin merge. Repository auto-delete is enabled, so the next owned child is retargeted to dev immediately before its parent lands.

Actual component/page with synthetic fixture data

  • Exact-source diagnostic gates, d1915c470bdcc95bbb3f7c716152ed013622634f: lint, typecheck, 27 focused config/picker tests, 1,706 GUI tests, privacy scan, GUI build and 425-page documentation build all passed. No deployment.

Checklist

  • Scope stays focused and avoids unrelated cleanup.
  • Docs or release notes were updated when needed.
  • Security-sensitive changes were reviewed for secrets, auth, and unsafe defaults.

Co-authored-by: Yumi automation@sbyoon.com
Co-authored-by: SB Yoon 44089734+yansigit@users.noreply.github.com

Summary by CodeRabbit

  • New Features

    • Added subscription-credit quota rows, including usage, expiry, ranking, and utilization handling.
    • Improved compact quota layouts so long labels and values wrap cleanly on narrow screens.
    • Extended account auto-switch reporting to generic OAuth pools with saved thresholds, provider state, and inert-status details.
  • Bug Fixes

    • Prevented duplicate subscription-credit rows and clarified handling of unset or zero thresholds.
  • Documentation

    • Updated CLI auto-switch guidance and JSON output examples across supported languages, including provider restrictions and generic OAuth behavior.

t and others added 4 commits September 7, 2026 01:43
Carries #3728 with raw-label and partial-coverage preservation.

Co-authored-by: Yumi <automation@sbyoon.com>

Co-authored-by: SB Yoon <44089734+yansigit@users.noreply.github.com>
@coderabbitai

coderabbitai Bot commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Team

Run ID: 8824ce33-0bb3-4e78-b1e8-7dda6b0b4658

📥 Commits

Reviewing files that changed from the base of the PR and between 24c761a and 20d84d3.

⛔ Files ignored due to path filters (1)
  • docs-site/public/pr-screenshots/t4-credit-bars-81a8.png is excluded by !**/*.png
📒 Files selected for processing (13)
  • docs-site/src/content/docs/fr/reference/cli/providers-accounts.md
  • docs-site/src/content/docs/ja/reference/cli/providers-accounts.md
  • docs-site/src/content/docs/ko/reference/cli/providers-accounts.md
  • docs-site/src/content/docs/reference/cli/providers-accounts.md
  • docs-site/src/content/docs/ru/reference/cli/providers-accounts.md
  • docs-site/src/content/docs/tr/reference/cli/providers-accounts.md
  • docs-site/src/content/docs/zh-cn/reference/cli/providers-accounts.md
  • docs-site/src/content/docs/zh-tw/reference/cli/providers-accounts.md
  • gui/src/components/QuotaBars.tsx
  • gui/src/styles/provider-quota.css
  • src/cli/account-extended.ts
  • tests/cli/cli-account-pool-verbs.test.ts
  • tests/gui/quota-bars-rows.test.ts

📝 Walkthrough

Walkthrough

The CLI now reports generic OAuth pool settings separately from Codex auto-switch state. The GUI now canonicalizes subscription-credit quota windows, includes direct credit data, and uses a responsive compact layout. Localized CLI documentation and tests cover both changes.

Changes

Generic OAuth auto-switch

Layer / File(s) Summary
Generic OAuth response reporting
src/cli/account-extended.ts
cmdAutoSwitch now reports server-confirmed generic OAuth settings, including autoSwitchThreshold, poolEnabled, and inert. Generic OAuth output keeps enabled false and returns without using the Codex status path.
CLI contract validation and documentation
tests/cli/cli-account-pool-verbs.test.ts, docs-site/src/content/docs/*/reference/cli/providers-accounts.md
Tests cover confirmed, malformed, null, inert, and capability responses. Localized documentation describes generic OAuth thresholds, rejected providers, and the expanded JSON shape.

Subscription-credit quota display

Layer / File(s) Summary
Subscription-credit quota normalization
gui/src/components/QuotaBars.tsx
Quota handling canonicalizes the subscription-credit label, ranks it consistently, avoids duplicate rows, detects incomplete windows, and includes direct credit utilization.
Credit-row rendering and responsive layout
gui/src/components/QuotaBars.tsx, gui/src/styles/provider-quota.css
Compact quota rows mark subscription credits with quota-row--credits. A container query uses a multi-row grid when the container is 440px or narrower.
Quota transformation tests
tests/gui/quota-bars-rows.test.ts
Tests cover direct credit rows, zero values, ordering, deduplication, plan normalization, utilization, and canonical incomplete-window matching.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Sequence Diagram(s)

sequenceDiagram
  participant cmdAutoSwitch
  participant AccountPoolAPI
  participant CLIOutput
  cmdAutoSwitch->>AccountPoolAPI: read or write generic OAuth pool settings
  AccountPoolAPI-->>cmdAutoSwitch: return confirmed settings
  cmdAutoSwitch->>CLIOutput: print threshold, poolEnabled, inert, and inactive state
Loading

Suggested reviewers: luvs01

✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/t4-02-credit-bars-81a8

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

github-actions Bot commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

Deterministic PR hygiene checks passed.

@lidge-jun

Copy link
Copy Markdown
Owner Author

리뷰 · 우선순위 45 / 80

지금 dev HEAD(24c761a05, package 2.45.0)의 gui/src/components/QuotaBars.tsxcreditsUsd를 바로 막대 행으로 안 그립니다. customWindows"Total subscription credits"가 있을 때만 로컬라이즈 케이스로 보이고, 직접 구독 크레딧 필드만 오면 막대가 비거나 불완전할 수 있습니다. 이 PR(DRAFT, Track4 81a8 스택 2/5, base=codex/t4-01-pool-status-81a8, head=codex/t4-02-credit-bars-81a8)은 #3728을 이어받아, creditsUsd.percent가 숫자면 canonical "Total subscription credits" 행을 만들고, 같은 라벨 custom window가 있으면 그걸 우선해 중복을 막습니다. 대소문자·공백 변형은 canonical로 맞추고, incomplete 커버리지 메타도 같은 규칙으로 비교합니다(isCustomQuotaWindowIncomplete).

순위는 custom rank 4.5로 monthly 뒤·기타 custom 앞에 두고, maxQuotaUtilisation도 같은 중복 규칙을 따릅니다. 좁은 카드에서는 quota-row--credits + @container CSS로 라벨/리셋/바를 줄바꿈합니다. tests/gui/quota-bars-rows.test.ts에 직접 credits, 0% without expiry, 순위, 중복 억제, partial coverage, 30-day plan 회귀가 있고, 스크린샷 docs-site/public/pr-screenshots/t4-credit-bars-81a8.png가 붙습니다. checkout에서 QuotaBars.tsx / provider-quota.css / quota-bars-rows.test.ts는 존재하고, 스크린샷·로직은 이 층에서 추가·수정됩니다. #3607/#3662 reset 마커 경로나 Advanced quota activation과는 다른 GUI 표시 층입니다.

gui/src/components/QuotaBars.tsx rawCustomWindowRank - subscription에 4.5를 쓴다. 정수 rank만 쓰던 습관과 다르지만 정렬만 하면 되므로 동작은 된다. 나중에 rank 표를 정리할지 보면 된다.
gui/src/components/QuotaBars.tsx canonical vs raw - subscription만 trim/lowercase로 합치고, " Gem " 같은 다른 라벨은 원문을 유지한다. 테스트가 그 경계를 잠근다.
gui/src/components/QuotaBars.tsx 중복 시 custom 우선 - direct creditsUsd percent/expiry가 더 최신이어도 custom window 값이 이긴다. 와이어가 둘 다 줄 때 어느 쪽이 권위인지 제품 결정이 필요하다.
gui/src/styles/provider-quota.css - 440px container 쿼리는 모던 브라우저 전제다. Aside 좁은 카드 목표가 맞으면 유지.
tests/gui/quota-bars-rows.test.ts - go/free 30-day plan에서 custom 99%와 direct 80%가 같이 있을 때 percent가 [60, 80]로 나온다(custom 라벨은 남기고 percent는 direct 쪽 정렬 규칙과 섞임). 픽스처 의도를 한 번 더 읽으면 좋다.

메인테이너의 판단이 필요한 지점

  • custom window와 creditsUsd가 동시에 올 때 어느 필드를 권위로 둘지
  • #3728을 이 GUI 층 머지와 함께 닫을지, 계정/프로브 쪽 후속이 남는지
  • 좁은 카드 스크린샷만으로 UX 사인을 할지, 실기 Aside도 볼지

너의 추천
DRAFT 유지. #3797이 먼저 준비된 뒤 이 층을 올린다. 구독 크레딧 막대는 체감 버그라 가치는 있지만, Track4 결합 CI가 초록이 될 때까지 단독 머지하지 않는다. types/config 분할과 무관하다.

이 댓글은 grok-bot이 작성했습니다

@lidge-jun
lidge-jun changed the base branch from codex/t4-01-pool-status-81a8 to dev September 6, 2026 18:22
@lidge-jun
lidge-jun marked this pull request as ready for review September 6, 2026 18:24
@lidge-jun
lidge-jun requested a review from Ingwannu as a code owner September 6, 2026 18:24
@lidge-jun
lidge-jun merged commit b72b8ea into dev Sep 6, 2026
35 of 55 checks passed
@lidge-jun
lidge-jun deleted the codex/t4-02-credit-bars-81a8 branch September 6, 2026 18:24
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 6, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-06T18:25:45.166414Z 20d84d3 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant