Skip to content

feat(proxies): show proxy accounts in the sidebar usage popover - #731

Merged
nixuuu merged 2 commits into
devfrom
feat/proxy-accounts-sidebar
Nov 14, 2026
Merged

nixuuu merged 2 commits into
devfrom
feat/proxy-accounts-sidebar

Conversation

@nixuuu

@nixuuu nixuuu commented Nov 14, 2026 •

Copy link
Copy Markdown
Member

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 " (truncated) over "N accounts · M cooling down" and links to the proxy card. Its accessible label is the full sentence "Through : 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 (feat(proxies): show proxy accounts in settings on web and mobile #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
nixuuu force-pushed the feat/proxy-accounts-ui branch from b3a975d to 83b2574 Compare November 14, 2026 15:40
@nixuuu
nixuuu force-pushed the feat/proxy-accounts-sidebar branch from 27db200 to d11b2ce Compare November 14, 2026 15:40
@nixuuu
nixuuu force-pushed the feat/proxy-accounts-ui branch from 83b2574 to 852520a Compare November 14, 2026 16:09
@nixuuu
nixuuu force-pushed the feat/proxy-accounts-sidebar branch from d11b2ce to a616649 Compare November 14, 2026 16:09
@nixuuu
nixuuu marked this pull request as ready for review November 14, 2026 16:09
@nixuuu
nixuuu changed the base branch from feat/proxy-accounts-ui to dev November 14, 2026 16:18
The sidebar usage glance gets a section per CLIProxyAPI proxy in use whose
accounts the gateway has read: Through <proxy>: N accounts · M cooling
down, linking to the proxy card. Without plan usage the trigger shows a
connection icon. The gateway's first account check now runs shortly after
startup.
@nixuuu
nixuuu force-pushed the feat/proxy-accounts-sidebar branch from a616649 to 78cb353 Compare November 14, 2026 16:33
@nixuuu
nixuuu merged commit 1ce39db into dev Nov 14, 2026
11 checks passed
@nixuuu
nixuuu deleted the feat/proxy-accounts-sidebar branch November 14, 2026 16:44
nixuuu added a commit that referenced this pull request Nov 14, 2026
nixuuu added a commit that referenced this pull request Nov 14, 2026
nixuuu added a commit that referenced this pull request Nov 14, 2026
nixuuu added a commit that referenced this pull request Nov 14, 2026
## Change

CLIProxyAPI account identities in Settings → Proxies now use the same
click-to-reveal privacy component as Providers. Hidden values have no
plaintext title, tooltip or accessible name; keyboard activation reveals
the accessible value, Escape hides it, and the existing 30-second
timeout remains. Truncated identities keep their layout on reveal.
Account detail messages also use privacy protection because upstream
messages can repeat a login.

The sidebar Provider usage popover lists each proxy account with its
provider, limit windows, percentage, compact bars, reset time and
non-Active status. Accounts are grouped by provider, with the most-used
windows first. A bounded internal scroller keeps large lists compact.
Checked timestamps, loading, empty and error states use the existing
cached data. No polling or refresh request was added; the shared
ListProxies cache, overview feed and gateway lease remain responsible
for reads.

## Identity audit

- Settings → Proxies: account labels and detail messages protected;
plaintext title removed.
- Settings → Providers and sign-in completion: existing AccountStatusRow
already uses Sensitive for emails; shared reveal behavior retained.
- Sidebar limits and provider usage: direct providers show instance
labels and computer names, not account email fields; their meters remain
unchanged. Proxy account identities use the same protected row as
Settings.
- Proxy pickers select saved connections and contain no upstream account
identities.
- Thread import and provider sign-in flows do not separately render
upstream account emails or logins. Explicit entry fields are unchanged.

## Validation

`nice` install, typecheck, lint, format:check, web build and gen:check
passed. Focused gateway/domain unit checks: 8 passing tests, 47
assertions. No UI test suite added. Browser review uses a disposable
isolated stack and synthetic identities: light/dark, desktop/phone, DPR
1/2, short/typical/long emails, 1/6/30 accounts, internal scrolling,
reveal/Escape and accessibility attribute inspection. The measured short
email stayed 55.5 px wide on reveal; no hidden identity or host appeared
in title/aria attributes.

Window parsing now follows the reported duration, including daily,
monthly and custom periods. A weekly-only Codex plan can put its weekly
window in primary; an empty secondary is not a second quota. Empty zero
watermarks are dropped for Codex and Claude. Plan names cross the
gateway boundary as a closed enum; Codex's sanitized
`id_token.plan_type` and passive plan header are supported. Other
providers show a plan only if management exposes a recognized name. Raw
JWTs are never decoded or downloaded. Additive proto fields and
generated code are included. See docs/proxies.md for source links and
limitations.

Proxy hosts are also protected: the card, all three agent mapping lines,
the edit form's read-only mappings, and the selected connection in proxy
pickers. Scheme, port and path remain visible. Editable URL inputs
remain readable. Plain URL picker descriptions were removed to avoid
leaking through option tooltips or accessible labels.

## Copy audit

New privacy labels: “Account identity”, “Account details”, “Proxy host”
and “Proxy URL”; these describe hidden values without disclosing them.
Proxy usage reuses “Through …”, “Checked …”, limit/reset labels, account
statuses and the existing empty state. Error recovery adds “Open proxy
settings to check access, then refresh.” New loading state: “Checking
accounts…”. Plan labels use established subscription names (Free, Plus,
Pro, Team, Business, Enterprise, Max, Max 5x/20x, Ultra, Other plan).
Window names use “Daily”, “Monthly”, a numeric duration, or “Primary
limit”/“Secondary limit” when only a slot is known. Sentence case,
active voice, short sentences, action after errors, no new jargon or
glossary terms, no humor, and no color-only meaning. Reviewed
short/typical/long values at desktop and phone width.

Related: #728, #731, #745

## Reset timestamp follow-up

The stage 1 review fixture used `2099-01-01T00:00:00Z`, causing the
26,345-day countdown. This was fixture data, not a seconds/milliseconds
conversion defect. Corrected browser fixtures use resets one day and
three hours ahead.

The gateway now rejects reset timestamps more than 400 days ahead, and
the shared formatter also hides implausible dates already cached. Codex
`reset-at` and Claude reset headers remain epoch seconds; Codex
`reset-after-seconds` remains relative to the quota observation.
Realistic gateway fixtures cover these three paths, accidental
millisecond epochs, the 400-day boundary and cached invalid dates.

Follow-up checks: install, gen:check, typecheck, lint, format:check and
web build passed. Focused gateway and capacity tests passed (11 tests,
74 assertions). Corrected stage 1 browser review confirmed one-day and
three-hour countdowns.

Copy audit: no new UI wording; unknown reset times omit the existing
reset label while retaining usage readings.

The CI integration fixture also contained an obsolete 2033 reset
(`2000000000` epoch seconds), which the 400-day guard correctly
discarded. The management integration suite now fixes its clock to the
quota observation and uses a three-hour reset, restoring the real clock
during cleanup. PostgreSQL lease timing continues to use real elapsed
time. No production behavior or UI wording changed in this fixture
correction.

Repeated local validation: `proxy-accounts.test.ts`, `proxies.test.ts`
and the gateway management tests passed together three consecutive times
(24 tests, 177 assertions per run); the management integration and
gateway tests also passed in an initial focused run. Typecheck, lint and
format:check passed after the fixture correction.
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