From f3adf007d907d0dcdf9ef75e8d5086630ecdaa67 Mon Sep 17 00:00:00 2001 From: choiminyeong Date: Thu, 27 Aug 2026 23:38:06 +0900 Subject: [PATCH] TASK-032: fix reversed ALL/FAVORITES swipe direction on repository list 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 --- .../repositories/RepositoryListScreen.kt | 8 +- docs/development-log.md | 14 +++ ...032-repository-list-swipe-direction-fix.md | 85 +++++++++++++++++++ 3 files changed, 105 insertions(+), 2 deletions(-) create mode 100644 tasks/032-repository-list-swipe-direction-fix.md diff --git a/app/src/main/java/com/ubisam/ubgitea/feature/repositories/RepositoryListScreen.kt b/app/src/main/java/com/ubisam/ubgitea/feature/repositories/RepositoryListScreen.kt index 7d7d19b..3db414b 100644 --- a/app/src/main/java/com/ubisam/ubgitea/feature/repositories/RepositoryListScreen.kt +++ b/app/src/main/java/com/ubisam/ubgitea/feature/repositories/RepositoryListScreen.kt @@ -314,9 +314,13 @@ private fun Modifier.modeSwipeGesture( totalDragX += dragAmount }, onDragEnd = { + // Content follows the finger, same convention as HorizontalPager elsewhere in this + // app: dragging left (negative totalDragX) brings the next tab in from the right + // (ALL -> FAVORITES, since FAVORITES is the right-hand tab), dragging right brings the + // previous tab in from the left (FAVORITES -> ALL). This was previously inverted. when { - totalDragX > SwipeThresholdPx && mode == RepositoryListMode.ALL -> onShowFavorites() - totalDragX < -SwipeThresholdPx && mode == RepositoryListMode.FAVORITES -> onShowAllRepositories() + totalDragX < -SwipeThresholdPx && mode == RepositoryListMode.ALL -> onShowFavorites() + totalDragX > SwipeThresholdPx && mode == RepositoryListMode.FAVORITES -> onShowAllRepositories() } }, ) diff --git a/docs/development-log.md b/docs/development-log.md index c0fb0f4..6ef50e4 100644 --- a/docs/development-log.md +++ b/docs/development-log.md @@ -519,3 +519,17 @@ This is the append-only implementation and handoff record shared by Codex and Cl - Known limitations: the error message still doesn't distinguish "genuinely offline" from "reachable but slow" — a request still too slow even at 30 seconds, or a truly offline device, both still render the same message; the fix targets the common slow-NAS case specifically, not a full error-taxonomy redesign. EUC-KR only, not CP949's extended completion range (deliberate, see task file). No response caching was added — the connection-pool sharing cuts handshake overhead, not the request/response itself. - Next recommended task: get live confirmation from the human product owner that "LGD-P9-CLCI-4K"'s commit history now loads, that `.cpp`/`.h` files open correctly, and that the "커밋" label reads right — not yet re-tested against those exact cases in this session. Also still pending from earlier in this session: the green theme/footer-height/language-star batch (TASK-030), pinch-zoom/pan, CSV, PDF, and Issues/PR numbered pagination. - Next owner: Claude, continuing per the standing direction. + +## 2026-08-27 — TASK-032: fix reversed ALL/FAVORITES swipe direction on the repository list + +- Agent and role: Claude, direct continuation of the same live session — "메인 화면 좌우 탭전환 스와이프가 반대로 되어 있는 것 같다" (the main screen's left/right tab-switch swipe seems reversed). +- Commit/diff: continued on `claude/task-015-notifications`; `feature/repositories/RepositoryListScreen.kt` only, plus `tasks/032-repository-list-swipe-direction-fix.md`. +- Bug found: the repository list (the app's actual home screen after login, distinct from `BranchDetailScreen`'s already-correct Files/Commit `HorizontalPager`) switches its ALL/FAVORITES tabs via a hand-rolled `detectHorizontalDragGestures` modifier rather than `HorizontalPager`, and that gesture's `onDragEnd` had its comparison signs backwards relative to the drag-follows-finger convention every other swipe surface in this app already uses: swiping right moved ALL -> FAVORITES and swiping left moved FAVORITES -> ALL, the opposite of what a rightward drag revealing the left-hand tab (and vice versa) should do. +- How it was implemented: the two `when` branch conditions in `modeSwipeGesture`'s `onDragEnd` were swapped (comparison direction only — the drag-accumulation and threshold logic were untouched), confirmed correct by re-deriving the convention directly from `BranchDetailScreen`'s already-correct `HorizontalPager` behavior and from `ModeTabs`'s actual tab order (ALL left, FAVORITES right) rather than guessing. +- Files changed: `feature/repositories/RepositoryListScreen.kt`, `tasks/032-repository-list-swipe-direction-fix.md`. +- Checks and results: `./gradlew compileDebugKotlin compileDebugUnitTestKotlin` BUILD SUCCESSFUL; `./gradlew testDebugUnitTest` BUILD SUCCESSFUL, all unit tests passing (no dedicated test for this gesture, same category as this app's other pure-Compose gesture code); `./gradlew assembleDebug lintDebug` BUILD SUCCESSFUL, 0 lint errors. Installed on the human product owner's device over wireless `adb`. +- Review findings and resolutions: None from a separate review pass. +- Known limitations: no dedicated unit test for the gesture direction itself; live confirmation of the corrected swipe feel is still pending in this session. +- Also this turn: while looking into a separately-reported bug (tapping a repository's new favorite star turns it red but doesn't actually favorite it), traced the root cause to a real architectural conflict rather than a simple bug — Gitea's `PUT`/`DELETE /user/starred/{owner}/{repo}` endpoints require `write:repository` OAuth scope (verified against Gitea's own route registration source), but this app's `OAuthClientConfig` has a hard `require(scopes.all { it.isReadOnly })` invariant and only ever requests read-only scopes. Every star/unstar attempt is therefore guaranteed to fail server-side (403), caught generically, and rendered as the reported red "failed" star. Not fixed yet — this needs the human product owner's direction, since the only real fix (requesting `write:repository`) breaks the just-built persistent-login promise from TASK-029 at least once (a scope change requires fresh consent) and changes this app's deliberate read-only security posture; flagged to them rather than decided unilaterally. +- Next recommended task: get the human product owner's direction on the star/favorite OAuth-scope conflict (add write scope vs. make favorites a local-only bookmark vs. remove the feature), then continue per the standing direction — still pending from earlier in this session: TASK-030's green theme/footer-height/language-star batch, TASK-031's label/EUC-KR/timeout batch, pinch-zoom/pan, CSV, PDF, and Issues/PR numbered pagination, all awaiting live confirmation. +- Next owner: Claude, continuing per the standing direction once the human product owner responds on the OAuth-scope question. diff --git a/tasks/032-repository-list-swipe-direction-fix.md b/tasks/032-repository-list-swipe-direction-fix.md new file mode 100644 index 0000000..28a2148 --- /dev/null +++ b/tasks/032-repository-list-swipe-direction-fix.md @@ -0,0 +1,85 @@ +# 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`'s `onDragEnd` + branch conditions only). +- Excluded: `BranchDetailScreen`'s `HorizontalPager` (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**: `RepositoryListScreen` doesn't use `HorizontalPager` for its ALL/FAVORITES tabs + (a plain `TabRow`/`Tab` pair, tap-switched, plus a separate hand-rolled + `detectHorizontalDragGestures` modifier for swipe) — the comparison signs in that hand-rolled + gesture's `onDragEnd` were backwards relative to the drag-follows-finger convention that + Compose's `HorizontalPager` itself provides automatically (and that `BranchDetailScreen` already + relies on, unmodified, for its own Files/Commit swipe). `totalDragX` accumulates 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 from `ModeTabs`'s `Tab` order and + `TabRow`'s `selectedTabIndex`), 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 `when` branch 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 + +- [x] Swiping left while on ALL now switches to FAVORITES. +- [x] Swiping right while on FAVORITES now switches to ALL. +- [x] Tap-to-switch (the `TabRow`'s `Tab`s) is unaffected. +- [x] 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 + +```text +./gradlew compileDebugKotlin compileDebugUnitTestKotlin +./gradlew testDebugUnitTest +./gradlew assembleDebug lintDebug +``` + +## Evidence + +- `RepositoryListScreen.kt`: `modeSwipeGesture`'s `onDragEnd` branch 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.