Skip to content

Honor provider lane labels in Settings usage bars and metric picker (GAP-55) - #738

Draft
Finesssee wants to merge 1 commit into
mainfrom
fix/settings-lane-labels
Draft

Finesssee wants to merge 1 commit into
mainfrom
fix/settings-lane-labels

Conversation

@Finesssee

Copy link
Copy Markdown
Collaborator

GAP-55: Settings lane names (found in the #668, #697, #702, #703, #710 and #730 proofs).

On main 7695471, the Settings > Providers detail surfaces label the session/weekly lanes with the
fixed ProviderSessionLabel / ProviderWeeklyLabel locale keys even when the bridge snapshot
already carries provider-declared labels (LiteLLM "Personal budget"/"Team budget", Kimi, StepFun),
and MenuBarMetricSection.tsx metricOptions() offers fixed "Automatic / Session / Weekly" — even
though the tray MenuCard.tsx already localizes the same bridge primaryLabel/secondaryLabel
values. The Menu bar metric picker and the Usage bars in Settings are the two surfaces that
ignored them.

Behavior changes:

  • get_provider_detail now forwards the cached snapshot's primaryLabel/secondaryLabel
    (serialize-only DTO addition; no fetch or persistence change).
  • UsageSection.tsx labels the session bar with provider.primaryLabel (falling back to the
    ProviderSessionLabel locale key) and the weekly bar with provider.secondaryLabel (falling
    back to ProviderWeeklyLabel).
  • MenuBarMetricSection.tsx metricOptions() offers the provider-declared labels for the
    session/weekly options with the same locale-key fallbacks. Automatic and every
    provider-specific extra (tertiary label keys, extra usage, Mistral monthly plan, Gemini
    average, credits) keep working unchanged; no cross-provider branching beyond label plumbing.
  • types/bridge.ts gains optional primaryLabel/secondaryLabel on ProviderDetail.

Validation (fix/settings-lane-labels):

  • pnpm run check-locale — OK, 871 keys.
  • pnpm test (vitest) — 65 files / 397 tests pass, including 4 new co-located tests:
    UsageSection: provider-declared labels shown / generic labels kept when none declared;
    MenuBarMetricSection: picker offers provider-declared labels / keeps generic labels.
  • pnpm run lint — 0 errors (11 pre-existing warnings on main, unchanged).
  • pnpm run build — pass.
  • Rust: cargo check + cargo test -p codexbar + cargo test -p codexbar-desktop-tauri
    (DTO-only change; expected: 1 known Isolate bootstrap payload test from real settings #684 bootstrap env baseline failure on branches
    without Make the bootstrap catalog test hermetic (#684) #711) — cargo fmt --all --check clean.

No new dependencies. UI-affecting: browser-use proof comment follows at the proven head.

@coderabbitai

coderabbitai Bot commented Oct 1, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Autopilot is currently an internal CodeRabbit preview.


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.

@Finesssee

Copy link
Copy Markdown
Collaborator Author

UI proof (browser-use)

Proven at e316541 (PR head). Build: debug desktop exe with the
proof-only dirs shim (kit proof\738, isolated home under proof\738\home, empty provider
homes, CODEXBAR_PROOF_MODE=settings, CDP on 9335, proof-window-guard running, PATH cut to
system folders + kit bin). Amp's usage comes from a kit-local deterministic amp CLI stub
(prints an Amp Pro Tier line; real provider parser runs unchanged: $70.00 of $100.00 agent
allowance → 30%, orb 10h of 50h → 80%); Copilot is the no-custom-labels control (no snapshot,
no fetch). DOM reads/clicks and page-local JS through CDP only; no OS keyboard/mouse, no
tab activation.

# Scenario Assertion Result
A0 privacy no e-mails / personal strings in the whole settings surface (3302 chars scanned) PASS
A1 Amp (custom labels) Settings → Providers → Amp usage bars labeled "Agent usage" (30%) and "Orb usage" (80%), not Session/Weekly PASS
A2 Amp (custom labels) Tray Display metric picker offers Automatic / Agent usage / Orb usage (no "Session"/"Weekly" strings) PASS
A3 Amp values sane: primary 30% ("Resets in 15d 0h"), secondary 80%, plan "Pro", source "cli" PASS
B1 Copilot (control) Tray Display picker keeps the generic "Session" label; no custom lane labels invented PASS
C1 both settings surface stays dark under theme auto (colorScheme dark, settings-surface--full) PASS
C2 both document.hasFocus() false on the settings page during the whole run (no focus stealing) PASS

Screenshots (local, not committed): C:\Users\FSOS\AppData\Local\Win-CodexBar\port-audit\proof\738\shots\A-amp-detail.png, ...\B-copilot-control.png. No personal data visible.

@Finesssee

Copy link
Copy Markdown
Collaborator Author

Validated 2026-10-02 at e316541 (PR head; base main 7695471):

  • pnpm run check-locale — OK, 871 keys match between Rust and TS.
  • pnpm test (vitest) — 65 files / 397 tests pass, including 4 new co-located tests:
    • UsageSection: provider-declared lane labels shown ("Personal budget"/"Team budget"); generic labels kept when the provider declares none.
    • MenuBarMetricSection: metric picker offers provider-declared labels; keeps generic "Session"/"Weekly" when none declared.
  • pnpm run lint — 0 errors (11 pre-existing warnings on main, unchanged; all pre-date this diff).
  • pnpm run build — pass (vite).
  • Rust (DTO-only addition; serialize-only fields, no fetch/persistence change):
    cargo check pass; cargo test -p codexbar 2160+1/0 fail/1 ign; cargo test -p codexbar-desktop-tauri 459 pass, 1 known baseline failure bootstrap_payload_exposes_every_provider_variant (79 vs 78 — reads real settings; hermetic fix is Make the bootstrap catalog test hermetic (#684) #711, not on main-base branches; also fails on unmodified main).
    cargo fmt --all --check clean.
  • UI proof (browser-use): comment above — A0 privacy, A1-A3 Amp custom labels (usage bars + metric picker), B1 Copilot generic control, C1 dark, C2 no focus steal. All PASS.
  • Pushed fix/settings-lane-labels e316541 (fast-forward, new branch); ls-remote head matches local.
  • No new dependencies; no cross-provider branching beyond label plumbing; locale keys kept as fallbacks.

Finesssee added a commit that referenced this pull request Oct 2, 2026
@Finesssee

Copy link
Copy Markdown
Collaborator Author

Adversarial validation passed at a8a3e96

Scope: honor provider lane labels in Settings usage bars and the metric picker (#738, GAP-55), validated as merged into release/v0.70.0 (merge a8a3e96 = merge of e316541 into 64f32db).

Attacks (highest-risk semantics, from the merged tree):

  • Fallback ordering is exact: the picker builds { value: "session", label: provider.primaryLabel || t("ProviderSessionLabel") } (and the weekly twin) — a provider-declared label wins, and the fixed localized key is the fallback, so an empty string or None cannot render a blank option; the test offers the provider-declared lane labels in the metric picker asserts both directions (declared "Personal budget"/"Team budget" shown; keys absent when overridden, present when not).
  • The GAP-55 bug is fixed at both surfaces: UsageSection.tsx no longer hardcodes ProviderSessionLabel/ProviderWeeklyLabel for provider.session/weekly, and MenuBarMetricSection.tsx uses the bridge's primaryLabel/secondaryLabel for Automatic/Session/Weekly — the audit's exact complaint that LiteLLM's "Personal budget"/"Team budget" were being replaced by fixed labels.
  • Bridge types extended safely: the new optional primaryLabel/secondaryLabel fields default to undefined, so an older bridge payload cannot crash the picker.
  • Test honesty: the MenuBarMetricSection test asserts the picker options by role/name against a rendered component with a real bridge snapshot, and UsageSection.test asserts the settings bars show the declared labels — not snapshot-text replays.

No defects found. READY for the un-draft rule.

Finesssee added a commit that referenced this pull request Oct 2, 2026
…menu label (stacked on #657; tray_bridge stays on the presentation-plan layout; picker merges #738 lane labels with #717 primaryMetricLabel)
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.

1 participant