fix(swift-ios): restore thread scrolling and back swipe - #6090
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
CI baseline note: the failing |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 4863570. Configure here.
ApprovabilityVerdict: Needs human review This PR fundamentally reimplements the back-swipe gesture system, replacing a simple SwiftUI DragGesture with a complex 245-line native UIPanGestureRecognizer implementation. Despite good test coverage, the significant changes to core navigation/scrolling interactions warrant human review to verify UX behavior. You can customize Macroscope's approvability policy. Learn more. |

What Changed
DragGesturewith a native UIKitUIPanGestureRecognizerWhy
The broad SwiftUI gesture attached to
ThreadDetailViewcompeted with the transcript collection view. In practice, vertical scrolling was only reliable when the gesture began near the top of the window, while the native navigation gesture only worked from the screen edge.UIKit gesture-recognizer arbitration lets the back gesture reject vertical pans before recognition and cooperate with child scroll views explicitly. That restores native scrolling ownership and makes the requested full-surface back swipe reliable without stealing horizontal child scrolling.
This is a focused child PR for #5178 and targets its owner branch.
UI Changes
There is no visual appearance change; this changes touch interaction only.
Verified on a physical iPhone with the final implementation: transcript scrolling works from the full thread surface and a rightward swipe returns to the thread list from anywhere on screen. The reporter completed the device acceptance pass.
Verification
TranscriptViewportGeometryTests: 10/10 passed on iPhone 17 Pro Simulatorapps/swift-ios/Scripts/ci-test.sh: the changed gesture suite passed; the script exits 65 because fiveHomeThreadMetadataTestsassertions already fail identically on the owner branch atf98cab5534863570f3: exit 0, no blocking defectsgit diff --check upstream/t3code/rebuild-mobile-app-swift...HEAD: passedChecklist
Implemented with GPT-5.6 Sol in T3 Code/Codex. Independently reviewed by Claude Opus 5 high.
Note
Medium Risk
Touch handling is centralized on the window root with nuanced scroll-view and text-input edge cases; behavior is well tested but still interaction-critical on thread detail.
Overview
Replaces the thread detail SwiftUI
DragGesture(left-edge-only back swipe) with aThreadBackSwipeGestureViewthat installs a UIKitUIPanGestureRecognizeron the window root, scoped to the thread surface and compact width only.The new
ThreadBackSwipeGesturepolicy rejects vertical pans at recognition time so the transcript collection view keeps vertical scrolling, triggers back when a rightward pan reaches 72pt with a 1.4× horizontal-to-vertical ratio, runs simultaneously with vertical scroll views but only shares horizontal nested scrollers at their leading edge, and skipsUITextField/ first-responderUITextViewso text editing keeps horizontal drags. The recognizer is tied to the representable lifecycle (install/uninstall on window changes).TranscriptViewportGeometryTestsgains unit coverage for begin/navigate thresholds, scroll-edge gating, touch routing, and text-input exclusion.Reviewed by Cursor Bugbot for commit a45c0ed. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Restore thread back-swipe and scrolling in iOS by replacing SwiftUI gesture with UIKit pan recognizer
DragGestureedge-swipe handler fromThreadDetailViewand replaces it with a UIKitUIPanGestureRecognizerinstalled on the window's root view controller via a newThreadBackSwipeGestureViewUIViewRepresentable.ThreadBackSwipeGestureheuristics: requires rightward, predominantly horizontal motion (ratio 1.4) with ≥72pt translation, allows simultaneous recognition with vertical scroll views, and cooperates with horizontal scrollers only at their leading edge.iPhonelayout).Macroscope summarized a45c0ed.