Skip to content

feat(tui): two-tab layout isolating Accounts and Providers (PR-3) - #69

Merged
xjoker merged 2 commits into
cursor/provider-launch-5a91from
cursor/provider-tui-panel-5a91
Aug 26, 2026
Merged

feat(tui): two-tab layout isolating Accounts and Providers (PR-3)#69
xjoker merged 2 commits into
cursor/provider-launch-5a91from
cursor/provider-tui-panel-5a91

Conversation

@xjoker

@xjoker xjoker commented Aug 26, 2026

Copy link
Copy Markdown
Owner

Third slice of custom-provider support (方案 A). Surfaces custom providers in the TUI.

Per the refined design (two tabs), the TUI is now split into a top-level tab layout that isolates codex-native ChatGPT accounts from third-party API+key providers — their semantics (quota/scoring/OAuth vs base_url/key) and key bindings never mix.

Stacked on PR-2 (#68) — base branch is cursor/provider-launch-5a91; retarget down the stack as they merge.

What's in this PR

  • Tab bar at the top: Accounts (N) / Providers (N); Tab / BackTab switches (q/h stay global).
  • Accounts tab: the existing account table + detail panel, unchanged.
  • Providers tab: a full-height, read-only table of custom providers (alias / name / model / base_url) with a selection highlight (j/k move it). The stored API key is never rendered. Empty state points to codex-switch provider add.
  • Per-tab key routing: account keys (a/r/t/i/s/space///Esc, and W auto-warmup) only fire on the Accounts tab; provider selection keys only on the Providers tab.
  • Providers carry no OAuth/usage, so they stay out of the account table, scoring, refresh, warmup, and reset-card logic.

Interactive add/remove within the Providers tab is PR-4; CLI provider add/remove already exists from PR-1.

Tests

  • providers_tab_lists_custom_providers_without_the_key — renders the Providers tab via TestBackend, asserts it lists a provider (alias + base_url) and does not leak the API key.
  • cargo fmt --check, cargo clippy --all-targets --all-features -- -D warnings, cargo test --all — all pass, 0 failed.

Manual demo (real TUI, verified via video review)

Seeded an isolated home (2 accounts + 2 providers) and drove the real TUI: the tab bar switches between the Accounts table and the Providers table with Tab, the selection moves with j, and no API key is shown.

tui_two_tabs_accounts_providers_demo.mp4

Accounts tab:

Accounts tab

Providers tab (keys never shown):

Providers tab

Note: CI Format and audit will be red until #63 (webbrowser RUSTSEC bump) merges to dev; pre-existing and unrelated.

To show artifacts inline, enable in settings.

Open in Web Open in Cursor 

cursoragent and others added 2 commits August 26, 2026 01:38
Load custom API provider profiles into the TUI and render them in a
separate "Custom providers" panel below the account table. Providers carry
no OAuth/usage, so they stay out of the account table, scoring, and refresh;
the panel lists alias / name / model / base_url and never renders the key.

Interactive add/remove of providers in the TUI is PR-4.

Adds a TestBackend render test asserting the panel lists a provider and does
not leak the API key.

Co-authored-by: xJoker <xjoker@users.noreply.github.com>
Rework the custom-providers UI from a stacked panel into a top-level tab
layout (per design 方案③), isolating codex-native ChatGPT accounts from
third-party API+key providers:

- Tab bar with Accounts (N) / Providers (N); Tab / BackTab switches.
- Accounts tab: the existing account table + detail panel, unchanged.
- Providers tab: a full-height read-only table of custom providers
  (alias / name / model / base_url) with a selection highlight; the API key
  is never rendered.
- Event loop routes keys per active tab: account keys (a/r/t/i/s/space///Esc,
  and W auto-warmup) only fire on the Accounts tab; j/k move the provider
  selection on the Providers tab; q/h/Tab are global.

Interactive add/remove within the Providers tab is PR-4.

Test updated to render the Providers tab; still asserts the key never
renders.

Co-authored-by: xJoker <xjoker@users.noreply.github.com>
@cursor cursor Bot changed the title feat(tui): custom providers panel (PR-3) feat(tui): two-tab layout isolating Accounts and Providers (PR-3) Aug 26, 2026
@xjoker
xjoker marked this pull request as ready for review August 26, 2026 05:01
@xjoker
xjoker merged commit bbcf014 into cursor/provider-launch-5a91 Aug 26, 2026
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.

2 participants