Skip to content

feat: show proxy name in badge, sort saved-proxy picker, default to Saved tab (#7643)#7720

Merged
diegosouzapw merged 2 commits into
release/v3.8.49from
feat/7643-proxy-ui-qol
Jul 19, 2026
Merged

feat: show proxy name in badge, sort saved-proxy picker, default to Saved tab (#7643)#7720
diegosouzapw merged 2 commits into
release/v3.8.49from
feat/7643-proxy-ui-qol

Conversation

@diegosouzapw

Copy link
Copy Markdown
Owner

Summary

Three small, additive UX fixes to the proxy-assignment flow, all requested in #7643:

  1. Badge shows the proxy's name, not its host. The per-connection "proxy configured" badge (ConnectionRow.tsx) previously always rendered proxyHost, so several saved proxies sharing a domain hostname were indistinguishable at a glance. GET /api/settings/proxy?resolve= now includes the proxy's name (already present on proxy_registry, just dropped by toProxyConfig()), and the badge renders proxyName || proxyHost || t("proxy").
  2. Saved-proxy picker is alphabetized. ProxyConfigModal.tsx's saved-proxy <select> now renders a client-side .sort()-derived list ordered by name, instead of the backend's recency-first order. listProxies()'s DB-level ORDER BY is untouched (other consumers rely on it).
  3. Modal defaults to the Saved tab when saved proxies exist. Previously the modal always fell back to the Custom tab when a scope had no existing assignment, even with a non-empty proxy pool. It now defaults to Saved whenever savedProxies.length > 0 and there's no existing assignment; still defaults to Custom when the pool is empty, and existing custom-proxy assignments are unaffected.

A small helper (resolveConnProxyField) was extracted in ConnectionsListPanel.tsx so the two ConnectionRow render call sites (already large map callbacks) don't each pick up a new cyclomatic decision point from the added name fallback — keeps check:complexity-ratchets at the frozen baseline (2059).

How it was validated (TDD, Hard Rule #18)

Two new Vitest UI test files, written first and confirmed red-then-green:

  • tests/unit/ui/connection-row-proxy-name-7643.test.tsx — badge shows name over host; falls back to host when no name; falls back to the translated placeholder when neither is set.
  • tests/unit/ui/proxy-config-modal-saved-sort-default-7643.test.tsx — saved-proxy <select> renders alphabetically regardless of API order; modal defaults to Saved when proxies exist and no assignment is set; still defaults to Custom when the pool is empty; existing custom-proxy assignments still resolve to Custom (regression guard).

Confirmed the modal test suite fails against the pre-fix logic (temporarily reverted the setMode branch, re-ran, 2/4 red) and passes again after restoring the fix.

npx vitest run --config vitest.config.ts tests/unit/ui/connection-row-proxy-name-7643.test.tsx tests/unit/ui/proxy-config-modal-saved-sort-default-7643.test.tsx
# 2 files, 7 tests passed

Gates run locally, all green:

  • node scripts/check/check-test-discovery.mjs
  • npm run typecheck:core / npm run typecheck:noimplicit:core (pre-existing unrelated errors in combo.ts/usageTracking.ts/cliRuntime.ts untouched by this PR, confirmed identical on base)
  • npx eslint --suppressions-location config/quality/eslint-suppressions.json <changed files>
  • npm run check:complexity-ratchets (2059/2059, 890/890 — no regression)
  • node scripts/check/check-file-size.mjs
  • node scripts/check/check-dashboard-typecheck.mjs (259/259 baseline, no new errors)
  • npm run check:cycles

npm run test:coverage was not run locally (heavy/shared box) — change is additive-only; CI's coverage gate is authoritative.

Scope

No i18n keys added — reuses existing proxy, proxyConfiguredBySource, savedProxy, selectSavedProxyPlaceholder keys (verified present in both en.json and pt-BR.json). No DB migration — proxy_registry.name already existed. Checked for in-flight conflicts (gh pr list --search "proxy badge OR ProxyConfigModal OR toProxyConfig") — #7707 and #7299 touch unrelated proxy files, no overlap.

Closes #7643

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@diegosouzapw
diegosouzapw merged commit 63716ad into release/v3.8.49 Jul 19, 2026
13 of 20 checks passed
@diegosouzapw
diegosouzapw deleted the feat/7643-proxy-ui-qol branch July 19, 2026 21:00
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.

feat: UI quality of life improvements (proxy names, sorting)

1 participant