Skip to content

Fix torrents screen flashing when tapping a disconnected server (#252) - #259

Merged
taylorcox75 merged 1 commit into
release/v3.8.45from
bugfix/#252-quickconnect-panel-flicker
Sep 20, 2026
Merged

taylorcox75 merged 1 commit into
release/v3.8.45from
bugfix/#252-quickconnect-panel-flicker

Conversation

@taylorcox75

Copy link
Copy Markdown
Owner

Summary

  • Fixes the not-connected screen flashing (panel → skeleton → panel) when tapping a server to connect. Reporter's own note pinned the cause: instant on airplane mode, ~10s "skeleton loader" on LTE — same bug, different timing.
  • Root cause: the moment a tap fires handleQuickConnect, connectMutation goes pending and serverIsLoading flips true, which fell through to the full-screen skeleton branch and unmounted QuickConnectPanel mid-tap. QuickConnectPanel was already built to stay mounted through this (per-row spinner via connectingId, disabled other rows, per-server error text) — the screen just wasn't giving it the chance.
  • Fix: keep the not-connected panel branch active when connectingId !== null, i.e. for a user-initiated connect from this screen. An automatic background reconnect never sets connectingId, so it's unaffected and still falls through to the skeleton branch exactly as before (Fix reconnect UI after a long background (skeleton instead of stale data + auth toast) #245's "skeleton instead of stale data during an established-session reconnect" behavior is preserved).
  • File touched: app/(tabs)/(torrents)/index.tsx only, per this task's scope in the v3.8.45 plan (Task A owns services//context/, Task C owns RSS).

Test plan

  • Added tests/rn/screens/TorrentsScreen.test.tsx (new tests/rn/screens/ subtree — first screen-level test in the repo), covering the three cases called out for this fix:
    1. A user-initiated connect keeps the panel mounted and reflects the tapped server as connecting (via the connectingId prop reaching QuickConnectPanel), instead of unmounting into the skeleton.
    2. An automatic reconnect on an already-connected session (isConnected: true, isReconnecting: true) still shows the skeleton, not the panel — confirms Fix reconnect UI after a long background (skeleton instead of stale data + auth toast) #245 behavior survives.
    3. A cold launch (initialLoadComplete: false, serverIsLoading: true, no tap) still shows the skeleton, not the panel.
  • npx tsc --noEmit — exit 0.
  • npm test — 79/79 suites, 1133/1133 tests passing (baseline was 78/1130; +1 suite/+3 tests from this PR).
  • npm run lint — 0 errors, 37 warnings (repo baseline, unchanged).
  • npm run format — clean.
  • Not run in the simulator (per repo convention, agents don't run the app) — this is a pure conditional-rendering change verified through the new screen test and the existing three-state logic already exercised by QuickConnectPanel's design; the owner should still eyeball it once in Xcode.

Fixes #252

🤖 Generated with Claude Code

Tapping a server on the not-connected screen flipped serverIsLoading
true the instant the connect mutation went pending, which unmounted
QuickConnectPanel in favor of the skeleton loader before falling back
to the panel once connect settled — a panel/skeleton/panel flash
(instant in airplane mode, ~10s on a real network per the issue).

Keep the panel mounted while a user-initiated connect (connectingId
set by this screen's own handleQuickConnect) is in flight; an
automatic background reconnect leaves connectingId null so it still
falls through to the skeleton as before (#245 behavior preserved).

Fixes #252
@taylorcox75
taylorcox75 merged commit b761f83 into release/v3.8.45 Sep 20, 2026
1 check passed
@taylorcox75
taylorcox75 deleted the bugfix/#252-quickconnect-panel-flicker branch September 20, 2026 23:58
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