Skip to content

Add quick server switcher - #260

Merged
taylorcox75 merged 1 commit into
release/v3.8.45from
feature/#249-quick-server-switcher
Sep 21, 2026
Merged

taylorcox75 merged 1 commit into
release/v3.8.45from
feature/#249-quick-server-switcher

Conversation

@taylorcox75

Copy link
Copy Markdown
Owner

Summary

Fixes #249

Switching servers today means Settings → Disconnect → Torrents → Connect. This adds a quick switcher directly on the Torrents screen, per the direction settled in the issue thread (a popup/sheet reusing the QuickConnectPanel look, not a new tab, Transfer tab untouched):

  • components/ServerSwitcherModal.tsx — a themed sheet listing every saved server (ServerIconBadge + name + address, mirroring QuickConnectPanel's row treatment), marks the currently-connected server with a checkmark pill, and switches directly to whichever other server is tapped by calling the existing connectToServer (no manual disconnect-then-connect — that's already handled by connectMutation.onMutate). Owns its own transient switching-id/inline-error state, so a failed switch shows a per-row error without needing the global toast (which an RN <Modal> would otherwise cover — see AGENTS.md's ToastContext note). A footer row links to Settings → Servers for full management.
  • app/(tabs)/(torrents)/index.tsx — a compact server badge + name in the header (left of the search bar) opens the sheet. Broadened the existing saved-servers useFocusEffect to also fetch while connected (previously gated to the disconnected-only QuickConnectPanel), so the switcher's list stays current. Bumped listContent's top padding to make room for the new header row.
  • i18n keys (switchServer, manageServers, currentServer) added to all six locales.
  • AGENTS.md File Index updated with the new component.

Test plan

  • npx tsc --noEmit — exit 0
  • npm test — 80 suites / 1158 tests passing (includes new tests/rn/components/ServerSwitcherModal.test.tsx, 9 cases: list rendering, current-server marking, switch on tap, close-on-current-tap, close-on-success, inline error on failure, manage-servers link, backdrop close)
  • npm run lint — 0 errors, 37 warnings (repo baseline)
  • npm run format
  • Not run in a simulator (per AGENTS.md, this agent doesn't run the app) — the header badge and switcher sheet are UI-visible changes the owner should verify visually.

🤖 Generated with Claude Code

Lets you switch servers from the torrents screen instead of going
Settings → Disconnect → Torrents → Connect. A compact server badge in
the header opens ServerSwitcherModal, which lists saved servers, marks
the connected one, and switches directly to whichever other one is
tapped via the existing connectToServer.
@taylorcox75
taylorcox75 merged commit 6df42a3 into release/v3.8.45 Sep 21, 2026
1 check failed
@taylorcox75
taylorcox75 deleted the feature/#249-quick-server-switcher branch September 21, 2026 00:49
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