-
Notifications
You must be signed in to change notification settings - Fork 679
fix(gui): providers overview quota/auth, Claude pool toggle, combos/models layout, dev session bootstrap #988
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
d0aa51b
fix(gui): provider overview quota/auth polish, combo/model layout, de…
Wibias 762c713
Merge remote-tracking branch 'upstream/dev' into codex/providers-copy…
Wibias f83413d
fix(gui): keep Combos revalidation silent but announced
Wibias d1f3871
fix(gui): address Codex review on v2 strut, quota aggregation, sessio…
Wibias a5ee086
fix(gui): seed Combos revalidation state and pin the aria-busy contract
Wibias 3fc1eb5
fix(server): share the escaped session bootstrap renderer and pin the…
Wibias e2d8ca4
fix(gui): announce silent revalidation via sr-only status region, sta…
lidge-jun File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
95 changes: 95 additions & 0 deletions
95
gui/src/components/provider-workspace/ProviderCapacityQuota.tsx
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,95 @@ | ||
| /** | ||
| * ProviderCapacityQuota — per-provider quota bars plus the aggregation context the | ||
| * quota API attaches for pooled Codex providers (estimate, excluded accounts, recovery | ||
| * rows, current-account breakdown). Shared by the aggregate dashboard and the | ||
| * single-provider Overview so both surfaces present the same capacity semantics. | ||
| */ | ||
| import { useT, useI18n } from "../../i18n/shared"; | ||
| import { | ||
| accountQuotaFromReport, | ||
| capacityAggregationFromReport, | ||
| type CapacityWindowView, | ||
| type ProviderQuotaReportView, | ||
| } from "../../provider-workspace/report"; | ||
| import { type QuotaWindowKey } from "../QuotaBars"; | ||
| import QuotaBars from "../QuotaBars"; | ||
|
|
||
| export function ProviderCapacityQuota({ report, pending }: { report: ProviderQuotaReportView; pending: boolean }) { | ||
| const t = useT(); | ||
| const { locale } = useI18n(); | ||
| const aggregation = capacityAggregationFromReport(report); | ||
| const primaryQuota = accountQuotaFromReport(report); | ||
| const showsAggregate = aggregation?.presentation === "aggregate"; | ||
| const incompleteWindowKeys = new Set<QuotaWindowKey>(); | ||
| const incompleteCustomWindowLabels = new Set<string>(); | ||
| if (showsAggregate && aggregation) { | ||
| if (aggregation.fiveHour?.incomplete) incompleteWindowKeys.add("fiveHour"); | ||
| if (aggregation.weekly?.incomplete) incompleteWindowKeys.add("weekly"); | ||
| if (aggregation.monthly?.incomplete) incompleteWindowKeys.add("monthly"); | ||
| for (const window of aggregation.customWindows ?? []) { | ||
| if (window.incomplete) incompleteCustomWindowLabels.add(window.label); | ||
| } | ||
| } | ||
| const recoveryRows: Array<{ key: number; label: string; window: CapacityWindowView }> = showsAggregate && aggregation ? [ | ||
| ...(aggregation.fiveHour ? [{ key: 0, label: t("codexAuth.fiveHour"), window: aggregation.fiveHour }] : []), | ||
| ...(aggregation.weekly ? [{ key: 1, label: t("codexAuth.weekly"), window: aggregation.weekly }] : []), | ||
| ...(aggregation.monthly ? [{ key: 2, label: t("codexAuth.monthly"), window: aggregation.monthly }] : []), | ||
| ...(aggregation.customWindows ?? []).map((window, index) => ({ key: index + 3, label: window.label, window })), | ||
| ] : []; | ||
| const formatPercent = (value: number) => new Intl.NumberFormat(locale, { maximumFractionDigits: 1 }).format(value); | ||
| const formatRecoveryAt = (value: number) => new Intl.DateTimeFormat(locale, { | ||
| dateStyle: "medium", | ||
| timeStyle: "short", | ||
| }).format(new Date(value > 10_000_000_000 ? value : value * 1000)); | ||
|
|
||
| return ( | ||
| <> | ||
| {showsAggregate && <div className="pws-capacity-label">{t("pws.capacity.estimate")}</div>} | ||
| {(primaryQuota || pending) && ( | ||
| <QuotaBars | ||
| quota={primaryQuota} | ||
| threshold={80} | ||
| t={t} | ||
| layout="stacked" | ||
| pending={pending} | ||
| incompleteWindowKeys={showsAggregate ? incompleteWindowKeys : undefined} | ||
| incompleteCustomWindowLabels={showsAggregate ? incompleteCustomWindowLabels : undefined} | ||
| /> | ||
| )} | ||
| {aggregation && ( | ||
| <div className="pws-capacity-details"> | ||
| {recoveryRows.flatMap(({ key, label, window }) => ( | ||
| window.nextRecoveryAt !== undefined && window.nextRecoveryPercent !== undefined | ||
| ? [<div className="pws-capacity-recovery" key={key}> | ||
| <span>{t("pws.capacity.nextRecovery")} · {label} · {formatRecoveryAt(window.nextRecoveryAt)}</span> | ||
| <strong>{t("pws.capacity.recoveryShare", { percent: formatPercent(window.nextRecoveryPercent) })}</strong> | ||
| </div>] | ||
| : [] | ||
| ))} | ||
| {showsAggregate && aggregation.currentAccount?.quota && ( | ||
| <div className="pws-capacity-current"> | ||
| <span className="pws-capacity-label"> | ||
| {t("pws.capacity.currentAccount")} | ||
| {aggregation.currentAccount.plan ? ` · ${aggregation.currentAccount.plan}` : ""} | ||
| </span> | ||
| <QuotaBars quota={aggregation.currentAccount.quota} threshold={80} t={t} layout="stacked" /> | ||
| </div> | ||
| )} | ||
| {aggregation.incomplete && aggregation.excludedAccounts > 0 && ( | ||
| <div className="pws-capacity-incomplete"> | ||
| {t("pws.capacity.incomplete", { | ||
| excluded: aggregation.excludedAccounts, | ||
| unknown: aggregation.unknownPlanAccounts, | ||
| })} | ||
| </div> | ||
| )} | ||
| {aggregation.partialWindowAccounts > 0 && ( | ||
| <div className="pws-capacity-incomplete"> | ||
| {t("pws.capacity.partial", { count: aggregation.partialWindowAccounts })} | ||
| </div> | ||
| )} | ||
| </div> | ||
| )} | ||
| </> | ||
| ); | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.