Conversation
…tings) Adds the per-day OpenAI Admin API chart to the tray/pop-out MenuCard and the Settings providers pane, on top of the core model and bridge DTO. Extends BarChart with an optional controlled selection API, adds ProviderDetail.openAiApiUsage, 13 locale keys in 8 locales, and tests.
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: trueThanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Thermo-nuclear reviewReviewed by Codex gpt-6-luna (xhigh); verified and validated by Claude The PR was checked for completeness against the approved design note (chart, toggle, day detail, footer, tray/pop-out card, Settings, 13 locale keys in all 8 locales, tests). Nothing was missing. Findings:
|
|
Thermo-nuclear fixes landed at 813458d ("Address thermo review"). Fixed: all 3 findings above (project id masking, full-window scrollable chart, capped animation stagger). Commands run (E-core wrappers, pnpm): |
CUA proofBuild commit:
Data path: the real Admin fetch path ( Commands:
Not verified visually: the tray card's line item / model lists below the fold (background scroll is unavailable on this surface); they are shown in the Settings screenshots. Screenshots (local, not committed), |
|
Validated 2026-10-02 at 813458d (PR head; base #699 at the new head f328c66 pending merge-in — see stack note):
Stack note: this branch still contains the OLD #699 head (5d99354) below its merge base — after #699's f328c66 lands, merge the new base in so the flake fix is behind this head too. |
Summary
Part (b) of the deferred upstream CodexBar 0.66.0 "OpenAI per-day usage chart": the UI. Part (a) (Rust model, provider fetch, bridge DTO,
types/bridge.ts) is #699; this PR is stacked on it and targetsport/micro-0.66.0-openai-daily-usage-core.OpenAIApiUsageChart: Cost | Tokens toggle, one bar per UTC day, a day detail panel (cost, requests, input / cached input / output tokens, line items, models) and a footer with the window label and total.MenuCard: collapsed "Daily API usage" section foropenaiapionly, hidden on error, in compact overview, and whendailyis empty.ChartsSectiondraws the same chart foropenaiapifrom the newProviderDetail.openAiApiUsagefield.BarChartgains an optional controlledselectionprop (listbox/option semantics, roving tabindex, arrow/Home/End keys). Without it, behavior is unchanged.OpenAIChart*) in all 8 locales,LocaleKey, andi18n/keys.ts.Approved design (summarized)
From
design-openai-per-day-chart.md, implemented as written:BarChart; no new charting or other dependency.aria-live=politeregion; line items and models are capped at 5 rows plus "+N more".openaiapi(the idopenaialiases Codex).openaiapistays out ofPROVIDER_CHART_DATA_IDS(the local-log tabs do not apply).Upstream reference
Pinned to
steipete/CodexBartag v0.66.0 (read only):openai.js,OpenAIAPIUsageSnapshot.swift,CostHistoryChartMenuView,docs/openai.md.Deferred / not done
CODEXBAR_SEED_USAGE_JSONOpenAI-API seed variant for proof harness runs.OPENAI_HISTORY_DAYSsetting.animations={false}); Settings honorsenableAnimations.Interpretation notes
dailyrenders nothing in the card/Settings (the standalone component showsDetailChartEmpty).open_ai_api_usageto the TauriProviderDetailDTO (and TSProviderDetail) so Settings has a data path; it is only filled when the snapshot has no error.{ "{}" }convention.Validation
Commands ran through the E-core wrappers with
cargo +1.98.0.cargo fmt --allcargo clippy --manifest-path rust/Cargo.toml --all-targets -- -D warningscargo clippy --manifest-path apps/desktop-tauri/src-tauri/Cargo.toml --all-targets -- -D warningscargo test -p codexbar(includes locale completeness test)cargo test -p codexbar-desktop-tauripnpm test(vitest, full)vitest runnew/touched:OpenAIApiUsageChart,BarChart,MenuCardOpenAIUsage,ChartsSectionpnpm run lintpnpm run build(check-locale,tsc --noEmit, vite build)Known failure, not caused by this PR:
commands::tests::bootstrap_payload_exposes_every_provider_variantfails (catalog 79 vs 78 active providers). It fails identically on the unmodified base branch (804ff96a), and it reads the machine's real settings viadirs::config_dir(), so it is environment dependent.New tests:
OpenAIApiUsageChart.test.tsx(13),MenuCardOpenAIUsage.test.tsx(6, including provider siloing, error, compact overview, empty window,describeCardpresence),BarChartselection mode (5),ChartsSectionopenaiapi (3), and a Rust test forProviderDetail.open_ai_api_usage(defaultNone, omitted from JSON, serialized asopenAiApiUsage).Affected areas
Tray/pop-out MenuCard, Settings > Providers detail pane, shared
BarChart, locale files (8), Tauriget_provider_detailDTO,styles.css.UI proof
Pending: coordinator will capture CUA proof on a fresh build. No desktop app was run for this PR.