Repository navigation
feat(providers): show live usage in the sidebar - #726
Merged
Merged
Conversation
nixuuu
marked this pull request as ready for review
November 14, 2026 14:42
This was referenced Nov 14, 2026
nixuuu
added a commit
that referenced
this pull request
Nov 14, 2026
Stage 3 of 3 (on #728). Adds proxy accounts to the sidebar usage glance from #726, using its typed `ProxyUsageSection` slot. Also has the gateway's first account check run shortly after startup. - **Popover, web and mobile:** one row per CLIProxyAPI proxy that a profile uses and whose accounts the gateway has read. The row shows "Through <proxy>" (truncated) over "N accounts · M cooling down" and links to the proxy card. Its accessible label is the full sentence "Through <proxy>: N accounts · M cooling down". - Plan windows are never inferred from these accounts. - Proxies without a key, unused proxies, unread or rejected accounts, and non-CLIProxyAPI proxies are left out. - **Trigger:** without plan usage but with proxy sections, the slot shows a connection icon instead of bars. The aria label lists both. - **Data source:** the existing shared `ListProxies` read, patched by `OverviewUpdate.proxy_accounts`. Reading it never calls a proxy. - **Gateway:** the first periodic check now runs about 15 s after startup instead of 5 min, so the sidebar fills without opening settings. - **Also in this stack (#728):** the mobile bot-chat failure card now uses the proxy wording for proxy instances, matching web. - **Tests and docs:** `sidebar-usage.test.ts` covers the section projection and text. `docs/provider-accounts.md` replaces the old "not rendered yet" note for `ProxyUsageSection`. ## Browser review Reviewed on a separate review host with a fake CLIProxyAPI and a Codex instance using the proxy, in light and dark at 1280 px: - With only a proxy (no plan usage), the trigger showed the connection icon. - The popover row read "Through Team CLIProxyAPI" over "3 accounts · 1 cooling down" and linked to the proxy card. - The first version truncated the counts ("1 co…"). Moving them to a second line fixed it. At phone width the page has no horizontal scroll. I did not check the popover itself on a phone: it closes when the sidebar collapses, and I didn't open the drawer. Mobile native visuals were not checked on a device, but the Android and iOS exports pass. The change is JS only, so the native fingerprint is unchanged. ## Checks typecheck, lint, format:check, gen:check, web build, `expo export` (android, ios). Domain tests pass, and the proxy-accounts, proxies, provider-usage and schema integration tests pass. ## Copy audit (§8) | Before | After | Reason | | --- | --- | --- | | (slot unused) | "Through Team CLIProxyAPI" / "3 accounts · 1 cooling down" | Names the proxy; counts are the proxy's accounts, not the user's plan. Short, no repeated facts. | | Trigger label "Show provider usage. Codex: 42% used" | "Show provider usage. … Through Team: 3 accounts · 1 cooling down" | The section is spoken too; the icon is never the only cue. | | (mobile bot failure) "A usage or turn limit was reached. … check your plan …" | "The proxy reported a usage limit. Wait for it to reset or check the proxy's accounts, then retry." | Same wording as web and as thread failures. |
nixuuu
added a commit
that referenced
this pull request
Nov 15, 2026
Touch fires pointerleave right after the tap, before its click, so the hover close timer shut the Updates and Provider usage popovers as soon as the tap opened them. Only a mouse leaving closes them now. Fixes: #726 Related: #98 Co-Authored-By: Claude Opus 5.5 <[email protected]>
nixuuu
added a commit
that referenced
this pull request
Nov 15, 2026
## Problem On touch screens (mobile browsers) the sidebar **Updates** and **Provider usage** popovers close right after a tap opens them. Touch fires `pointerleave` right after the tap, before its `click`. At that moment the popover isn't pinned yet, so `leave()` schedules the 250 ms hover close; the click then opens the popover and the timer closes it. ## Fix Only a mouse leaving schedules the close, as `HoverCard` already does. On touch, a tap toggles the popover. ## Verification - Local: oxfmt on the two edited files (no changes). Lint, typecheck and tests are left to CI. - Not checked yet on a real phone or in mobile emulation. - Copy audit: no UI text changes. Fixes: #726 Related: #98 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 5.5 <[email protected]>
nixuuu
added a commit
that referenced
this pull request
Nov 18, 2026
## Problem The Updates and Provider usage panels in the sidebar footer can overlap when the pointer moves quickly between their triggers. Each panel manages its own open state, so the first panel can stay open during its 250 ms pointer-leave grace period while the second opens. ## Change - Share the active panel between the two footer controls and skip the outgoing panel’s exit animation on handoff. - Preserve the pointer grace period for moving into panel content. A panel opened by activating its button takes priority over hover. - Keep keyboard activation, Escape dismissal, focus return, and narrow-screen sheets. ## Verification Retested PR head `192bac0ae0c032b3a95b75bc51d9d03dad3ce116` locally on `nix-pc` after syncing with `dev`. The isolated Chromium 155 regression using the shared Popover passed all four viewport and theme combinations. The three edited Svelte components compiled without warnings. The sync includes #979, which fixes the worker shutdown race that caused the route migration test to time out in CI. - An isolated Chromium regression using the shared Popover reproduced simultaneous open panels with the previous independent state and passed with the fix. - Verified handoff in both directions, entry into panel content, pointer-leave dismissal, keyboard activation, Escape and focus return on the applicable widths. Checked light and dark at 390 px and 1024 px. - Compiled the three edited Svelte components and ran the formatter on the edited TypeScript and CSS. Repository-wide checks remain with CI. - Copy audit: no UI text changes. Fixes: #726
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
The sidebar now shows provider plan usage without opening Settings. One quiet, reserved footer slot contains a mini-bar for each provider with data, showing its highest active window across enabled instances. Hover on desktop or tap opens per-instance meters, reset times, billing notices and Open provider settings. The native mobile drawer has the same glance and details.
ProxyUsageSectionexposes the small typed shape for a later upstream-account section without fetching or rendering proxy status.Related: #697
Validation
bun install,bun run gen:check, whole-repo typecheck, lint, formatting and the web production build passed. Final overlay primitive changes were checked again with typecheck, lint, formatting and web build.138e0c6b171c82b4933e86808cdfef56da73b8c6, Android906dc944f94eb8333fa384ed9f198834fdd30d13. Tracked fingerprint source inputs have no differences from dev. No native dependency or configuration changes; eligible for the normal OTA release pipeline, no update published manually.Copy audit (§8)
New copy uses sentence case, short labels, glossary terms, localized numbers and reset times. No new jargon, errors, empty states, destructive actions or humour. Full labels remain available through truncated-text hints; short, typical and long names were reviewed at desktop and phone widths. Status meaning is present in text and accessible labels as well as bar colour/shape.