Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(mobile): dragging routes to reorder no longer snaps back #22435

ClosedRVZO6(GitHub profile, opens in a new tab)wants to merge 1 commit intomain fromrefs/pull/22435/headopened View on GitHub

Problem

On mobile, in Settings → Environment → Routes, dragging a route by its handle to reorder it (e.g. moving T3 Connect above Tailscale) snaps the row back on release, and the order never changes. Reproduced on Android, on the latest nightly and on a debug build from main.

Change

SettingsDragHandle kept the pan translation in a local let that onUpdate wrote and onFinalize read. With Reanimated installed, RNGH workletizes gesture callbacks, and each one takes its own copy of the variables it closes over. So onFinalize always saw 0, the drop index equaled the start index, and the move was a no-op. Logs from the emulator showed the last update at translationY -80.4, then onEnd(translation: 0) with the finalize event carrying -81.36.

The regression came in with #21124, which replaced the previous useRef (a single shared object, so it worked) with the local variable. onFinalize now reads event.translationY from the final event directly, and the shared variable is gone.

The same handle drives the iOS-only microphone order list, which gets the same fix.

Scope and approval

This is a small, focused fix for an obvious regression in an existing control: one file, with no behavior change beyond restoring drag-to-reorder.

Verification

  • On an Android emulator (API 36) with a debug build and two routes, dragging the second route above the first now sticks. "In use" moves to the new first route once the client reconnects. Dragging it back down also works. Before the fix, both directions snapped back.
  • Lint and typecheck for apps/mobile are clean.
  • I didn't test the iOS microphone list on a device.

Model and harness: Claude Opus 5.5 in Claude Code, running in T3 Code.

🤖 Generated with Claude Code

    1. github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:unvouched

    2. Approvability

      Verdict: Approved at 18d7ee0

      Macroscope's review found this PR approvable — This single-file fix corrects route reordering by reading the final pan translation directly from the gesture event, avoiding stale worklet-captured state. It is narrowly scoped and does not affect schemas, defaults, infrastructure, or sensitive code.

      You can add or adjust custom eligibility rules. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).
    3. coderabbitai[bot](GitHub profile, opens in a new tab)commented
      Review in Change Stack →

      No actionable comments were generated in the recent review.

      ℹ️ Recent review info
      ⚙️ Run configuration
      • Configuration used: Path: .coderabbit.config.ts
      • Review profile: CHILL
      • Plan: Advanced
      • Run ID: 768d7b1b-c9e7-4d7b-9f11-10cf6b6b7b6e
      📥 Commits

      Reviewing files that changed from the base of the PR and between 2893437f261dd50b96010dda3cbf518a28765b80 and 18d7ee04fdda188af91f1e197ea5f08e912b5972.

      📒 Files selected for processing: 1
      • apps/mobile/src/features/settings/components/SettingsDragHandle.tsx

      Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

      Walkthrough

      Changes

      The settings drag handle now passes translation values directly from gesture events to onMove and onEnd. Finalization still reports cancellation as !success.

      Settings drag gesture

      Layer / File(s)Summary
      Pass gesture event translations
      apps/mobile/src/features/settings/components/SettingsDragHandle.tsx
      The gesture callbacks pass event translation values to onMove and onEnd. Finalization retains the !success cancellation value.
      Priority: Low

      Estimated code review effort: 2 (Simple) | ~5 minutes

      Change: Bug fix

      Suggested reviewers: juliusmarminge

      Merge Risk: Minimal · up to 18d7e

      The gesture change matches the consumers’ expectations for route movement and cancellation, so no actionable merge risk remains.

      Pre-merge checks: Passed 4
      Check nameStatusExplanation
      Title checkPassedThe title clearly and concisely describes the primary fix: mobile route dragging no longer snaps back during reordering.
      Description checkPassedThe description covers the problem, root cause, implementation, scope rationale, verification results, limitations, and agent attribution. It does not include the template-requested before/after scree…
      Linked Issues checkPassedCheck skipped because no linked issues were found for this pull request.
      Out of Scope Changes checkPassedCheck skipped because no linked issues were found for this pull request.
      Full details: Description check

      Explanation

      The description covers the problem, root cause, implementation, scope rationale, verification results, limitations, and agent attribution. It does not include the template-requested before/after screenshots or a short recording for the drag interaction, but the remaining content is complete and specific.

      ✨ Finishing Touches
      🧪 Generate unit tests (beta)
      • Create a new PR
      • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
      Comment `@coderabbitai help` to get the list of available commands.
    4. Closing: current main already covers this as of fe0e8d4ee1. If you still see it on a build that includes that commit, reply and we'll reopen.

    5. juliusmarminge closed this

Sign in to join this conversation.