Skip to content

Fix float bar pills for informational metrics - #733

Draft
Finesssee wants to merge 1 commit into
mainfrom
fix/floatbar-informational-metric
Draft

Finesssee wants to merge 1 commit into
mainfrom
fix/floatbar-informational-metric

Conversation

@Finesssee

@Finesssee Finesssee commented Oct 1, 2026 •

Copy link
Copy Markdown
Collaborator

Found while proving #702 (LiteLLM spend-only account, scenario s4).

Summary

When the selected metric is informational, the float bar rendered it as a quota anyway:

  • the pill read 0% (or 100% in remaining mode),
  • the tooltip read LiteLLM: 0% used followed by Resets No budget set, because the informational text went through the reset formatter.

Informational metrics have no quota percentage: no budget set, a balance line, or no active session. The tray card and the tray tooltip already show their text, so the float bar now does the same:

  • The pill shows the informational text, or an em dash when there is none.
  • The tooltip is <Provider>: <text>. A reset line is added only when the window has a reset timestamp.
  • The pill keeps the neutral tone. Warning and critical tones stay for real quotas and provider problems.

This is not specific to LiteLLM. Every provider whose selected metric falls back to an informational primary is affected on main, for example Hugging Face billing, OpenRouter "Account balance unavailable", Kilo "Credit usage unavailable", and Codex or Claude "No active 5h session" with no other lane.

Upstream reference

None. The float bar is a Windows-only surface, so upstream has no counterpart. The behavior matches this app's tray card and tray tooltip, which already show informational text.

Ported / Deferred

Nothing is ported or deferred.

Validation

  • pnpm --dir apps/desktop-tauri install --frozen-lockfile: pass
  • pnpm run check-locale: OK, 871 keys
  • pnpm test: 65 files, 396 passed. The first full run had 1 failure in useTrayPanelLayout.sizing.test.tsx ("does not feed measurement style changes back into another auto-fit pass"). That test is timing-based and comes from main. It passed 3 of 3 runs in isolation, and the full rerun was green.
  • src/floatbar/FloatBar.test.tsx: 31 passed. The five informational tests fail without the FloatBar.tsx change.
  • pnpm run lint: 0 errors. The warnings already exist on main, including the unused SettingsSnapshot import in FloatBar.tsx.
  • pnpm run build: pass
  • Rust is unchanged.

Affected areas

  • Float bar pills (apps/desktop-tauri/src/floatbar/FloatBar.tsx) and tests
  • UI-affecting: the float bar only. The tray card, tray tooltip and tray icon already handled informational windows.

Merge note: port branches that add resetDescriptionFallback to the float bar (the #657/#702 chain) conflict in one hunk. To resolve it, pass null instead of the fallback when the window is informational.

UI proof

PASS at 0e0944f3 (browser-use over WebView2 CDP, no keyboard, mouse or focus): #733 (comment)

  • Informational seed: the pill reads "No active 5h session" with the neutral tone, no % and no reset element. The tooltip is Codex: No active 5h session, and the tray card shows the same text.
  • Percent control: the pill reads "61%" with the inline reset "2h 59m".
  • No host email or account was visible, and the theme stayed dark under auto.
  • Not covered: tray icon pixels and the tray menu (native). They already handled informational windows.

The float bar rendered an informational selected metric (no budget set,
a balance line, no active session) as "0% used" and turned its text into
"Resets <text>". Pills now show the informational text (or an em dash),
keep the neutral tone and only show a reset taken from a timestamp, like
the tray card and the tray tooltip already do.
@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)

Result: PASS on build 0e0944f3c223245e5c01769b5b8b71425f58f999, the current PR head "Show informational float bar metrics as text". With an informational selected metric, the float bar pill shows the text "No active 5h session" with the neutral tone, no percentage and no reset wording. A percentage metric (the control) still shows "61%" with its inline reset.

At the maintainer's direction, this proof drove the app's WebView2 over CDP with the browser-use CLI instead of CUA. It used no keyboard, mouse or focus. All proof windows stayed on the second display, the foreground window was never part of the proof process tree, and the kit settings turned the global shortcut off.

Setup

  • Build: pnpm run tauri:build:debug at 0e0944f3 in the worker worktree. The exe was copied to the proof kit.
  • Proof-only patch: never committed, and reverted after the build.
    • A workspace Cargo.toml [patch.crates-io] dirs shim for an isolated home, plus the resulting Cargo.lock change.
    • The no-activation overlay for proof windows, because main does not have Stop CodexBar from stealing focus #713 yet.
  • Data: isolated USERPROFILE, HOME, APPDATA, LOCALAPPDATA and empty provider homes under the kit. Only Codex is enabled, the theme is auto, the float bar is on with the inline reset, and the global shortcut is off.
  • Seeds (CODEXBAR_SEED_USAGE_JSON, one synthetic Codex snapshot, errorState ready):
    • info: the primary window is informational, "No active 5h session" over 300 minutes, the shape RateWindow::no_active_session() produces. There is no secondary window, so the informational primary is the selected metric.
    • percent (control): the primary is 61% used and resets 3 hours after launch, and the secondary is 24% used.
  • Commands: bash launch.sh info|percent exports WEBVIEW2_ADDITIONAL_BROWSER_ARGUMENTS=--remote-debugging-port=9335 .... Each run was driven with BU_CDP_URL=http://127.0.0.1:9335 BU_NAME=worker-733 BH_TAB_MARKER=0 browser-use <<'PY' ... PY. Before each attach, curl /json/version showed Edg/154 WebView2, and the port 9335 listener's parent was this kit's exe.

Results

# Assertion Result
A0 No real email or account from the host is visible. DOM scans of the tray panel and the float bar in every run found no @ addresses and no host user name. PASS
A1 Dark under theme auto: matchMedia('(prefers-color-scheme: dark)') is true, data-theme=dark, body rgb(28, 28, 30) with text rgb(245, 245, 247). PASS
A2 Bridge (get_cached_providers), info: selectedMetric is the informational primary: isInformational true, usedPercent 0, resetsAt null, resetDescription "No active 5h session". PASS
A3 Float bar, info: .floatbar__pct reads No active 5h session. The pill has no % and no .floatbar__reset element. The tooltip is exactly Codex: No active 5h session. The class is floatbar__pill--ok, with the Codex brand border rgb(73, 163, 176). PASS
A4 Tray card, info: the Session row shows "No active 5h session" without a bar, matching the float bar. PASS
A5 Control, percent: the pill reads 61% with the inline reset 2h 59m. The tooltip is Codex: 61% used followed by Resets in 2h 59m, and the tone is ok. The tray card shows Session 61% used and Weekly 24% used. PASS
— Tray icon pixels and the tray menu label. Not covered (native, browser-use per maintainer). They already handled informational windows before this PR.

Before this fix, the same situation on the #702 build (LiteLLM spend-only account, scenario s4) rendered the pill as 0% and the tooltip as LiteLLM: 0% used followed by Resets No budget set. See the #702 proof comment.

Validation at 0e0944f3

Command Result
pnpm install --frozen-lockfile pass
pnpm run check-locale OK, 871 keys
pnpm test 65 files, 396 passed. The timing-based useTrayPanelLayout.sizing.test.tsx case failed once under full-suite load, passed 3 of 3 runs alone, and the full rerun was green.
src/floatbar/FloatBar.test.tsx 31 passed. The five informational tests fail without the FloatBar.tsx change.
pnpm run lint 0 errors
pnpm run build pass

Rust is unchanged.

Screenshots

All paths are under C:\Users\FSOS\AppData\Local\Win-CodexBar\port-audit\proof\floatbar-info\shots\. The float bar window is transparent, so its captures are RGBA. Each -on-dark.png copy composites the capture onto #1c1c1e at 4x so the white pill text is readable.

  • 733-info-floatbar-on-dark.png: the pill reads "No active 5h session" with the teal Codex border.
  • 733-info-tray-card.png: the tray card's Session row with the same text.
  • 733-percent-floatbar-on-dark.png: the control pill, "61%" and "2h 59m".
  • 733-percent-tray-card.png: the control tray card, 61% and 24% used.

Seen again during this proof (on main, not caused by this PR)

  • A reset more than about 24.8 days away triggers an immediate forced refresh. This is the useProviders timer overflow that Fix reset refresh timer for resets over 24.8 days away #720 fixes. A first percent seed with a reset in 2099 was replaced by a forced refresh about 100 ms after launch, with two Codex fetches in the log. The same seed with a reset 3 hours out stayed, and that run is the control above.

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