modeSwipeGesture's onDragEnd had its comparison signs backwards relative to this app's drag-follows-finger convention (already correct in BranchDetailScreen's HorizontalPager): swiping right moved ALL -> FAVORITES and swiping left moved FAVORITES -> ALL. Swapped the two branch conditions so a leftward drag reveals FAVORITES (the right-hand tab) and a rightward drag reveals ALL (the left-hand tab). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
4.5 KiB
TASK-032: Fix reversed ALL/FAVORITES swipe direction on the repository list
Status: implemented; all required checks pass; live-installed, awaiting the human product owner's confirmation Owner: Claude Reviewer: Codex
Outcome
The repository list screen's own left/right swipe between its ALL and FAVORITES tabs
(RepositoryListScreen.modeSwipeGesture) had its direction inverted relative to this app's own
established swipe convention (and relative to BranchDetailScreen's HorizontalPager, which
already behaves correctly): swiping right moved ALL -> FAVORITES and swiping left moved
FAVORITES -> ALL, the opposite of "content follows the finger." Live-reported as "메인 화면 좌우
탭전환 스와이프가 반대로 되어 있는 것 같다" (the main screen's left/right tab-switch swipe seems
reversed) — this is the repository list because it's the app's actual home/first screen after
login, distinct from BranchDetailScreen's own Files/Commit tab pager (already correct, and the
subject of this session's earlier gesture-conflict fixes).
Scope
- Included:
feature/repositories/RepositoryListScreen.kt(modeSwipeGesture'sonDragEndbranch conditions only). - Excluded:
BranchDetailScreen'sHorizontalPager(unaffected — uses Compose's own built-in drag handling, which already followed the correct convention; verified, not just assumed, before concluding this was a separate, single-screen bug). No change to tap-to-switch (Tab.onClick), the swipe threshold, or any other gesture behavior.
Design notes
- Root cause:
RepositoryListScreendoesn't useHorizontalPagerfor its ALL/FAVORITES tabs (a plainTabRow/Tabpair, tap-switched, plus a separate hand-rolleddetectHorizontalDragGesturesmodifier for swipe) — the comparison signs in that hand-rolled gesture'sonDragEndwere backwards relative to the drag-follows-finger convention that Compose'sHorizontalPageritself provides automatically (and thatBranchDetailScreenalready relies on, unmodified, for its own Files/Commit swipe).totalDragXaccumulates the raw horizontal drag delta, positive when the finger moves rightward; with ALL as the left-hand tab and FAVORITES as the right-hand tab (confirmed directly fromModeTabs'sTaborder andTabRow'sselectedTabIndex), a rightward drag should reveal the tab to the left (ALL), and a leftward drag should reveal the tab to the right (FAVORITES) — the previous code had both branches' comparisons swapped from that. - Fix, not a rewrite: the two
whenbranch conditions were swapped in place (comparison operators and signs only); the drag-accumulation, threshold, and consume-on-horizontal-drag logic were left exactly as they were, since none of that was implicated in the reported bug.
Acceptance criteria
- Swiping left while on ALL now switches to FAVORITES.
- Swiping right while on FAVORITES now switches to ALL.
- Tap-to-switch (the
TabRow'sTabs) is unaffected. - Build, unit tests, and lint pass.
- Live confirmation from the human product owner that the swipe direction now feels correct — the build has been reinstalled on the device but not yet re-tested against this exact gesture in this session.
Required checks
./gradlew compileDebugKotlin compileDebugUnitTestKotlin
./gradlew testDebugUnitTest
./gradlew assembleDebug lintDebug
Evidence
RepositoryListScreen.kt:modeSwipeGesture'sonDragEndbranch conditions swapped (totalDragX < -SwipeThresholdPx && mode == ALL -> onShowFavorites()/totalDragX > SwipeThresholdPx && mode == FAVORITES -> onShowAllRepositories()), with a comment explaining the now-correct convention../gradlew compileDebugKotlin compileDebugUnitTestKotlin: BUILD SUCCESSFUL../gradlew testDebugUnitTest: BUILD SUCCESSFUL, all unit tests passing (no dedicated test for this gesture — it's private Compose gesture-handling with no non-UI logic to isolate, the same category as this session's earlier pinch-zoom/pan gesture work)../gradlew assembleDebug lintDebug: BUILD SUCCESSFUL, 0 lint errors.- Installed on the human product owner's device over wireless
adb(adb install -r, streamed install succeeded); not yet re-tested live against the swipe gesture itself in this session.
Known limitations
- No dedicated unit test exists for the gesture direction itself (same category as this app's other pure-Compose gesture code — see Evidence).
- Live confirmation is still pending in this session.
Review findings
None yet — pending Codex/human review.