feat: show proxy name in badge, sort saved-proxy picker, default to Saved tab (#7643)#7720
Merged
Merged
Conversation
…efault to Saved tab (#7643)
Contributor
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
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.
Summary
Three small, additive UX fixes to the proxy-assignment flow, all requested in #7643:
ConnectionRow.tsx) previously always renderedproxyHost, so several saved proxies sharing a domain hostname were indistinguishable at a glance.GET /api/settings/proxy?resolve=now includes the proxy'sname(already present onproxy_registry, just dropped bytoProxyConfig()), and the badge rendersproxyName || proxyHost || t("proxy").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-levelORDER BYis untouched (other consumers rely on it).savedProxies.length > 0and 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 inConnectionsListPanel.tsxso the twoConnectionRowrender call sites (already large map callbacks) don't each pick up a new cyclomatic decision point from the addednamefallback — keepscheck:complexity-ratchetsat 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
setModebranch, re-ran, 2/4 red) and passes again after restoring the fix.Gates run locally, all green:
node scripts/check/check-test-discovery.mjsnpm run typecheck:core/npm run typecheck:noimplicit:core(pre-existing unrelated errors incombo.ts/usageTracking.ts/cliRuntime.tsuntouched 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.mjsnode scripts/check/check-dashboard-typecheck.mjs(259/259 baseline, no new errors)npm run check:cyclesnpm run test:coveragewas 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,selectSavedProxyPlaceholderkeys (verified present in bothen.jsonandpt-BR.json). No DB migration —proxy_registry.namealready 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