diff --git a/app/src/main/java/com/ubisam/ubgitea/feature/history/HistoryScreen.kt b/app/src/main/java/com/ubisam/ubgitea/feature/history/HistoryScreen.kt index 8569985..d340f67 100644 --- a/app/src/main/java/com/ubisam/ubgitea/feature/history/HistoryScreen.kt +++ b/app/src/main/java/com/ubisam/ubgitea/feature/history/HistoryScreen.kt @@ -284,11 +284,14 @@ private fun FileDiffView(state: HistoryUiState.SelectedFileDiff) { } } val horizontalOffsetPx = remember(state.rows) { mutableFloatStateOf(0f) } + // Dragging left must reveal what's further along the line (offset increases), matching + // every other horizontally-scrollable surface on Android — verified live to be backwards + // with a plain "+ delta", so the sign is flipped here instead. val horizontalScrollableState = rememberScrollableState { delta -> - val newOffset = (horizontalOffsetPx.floatValue + delta).coerceIn(0f, maxHorizontalOffsetPx) - val consumed = newOffset - horizontalOffsetPx.floatValue + val previousOffset = horizontalOffsetPx.floatValue + val newOffset = (previousOffset - delta).coerceIn(0f, maxHorizontalOffsetPx) horizontalOffsetPx.floatValue = newOffset - consumed + previousOffset - newOffset } LaunchedEffect(beforeState, afterState) { snapshotFlow { beforeState.firstVisibleItemIndex to beforeState.firstVisibleItemScrollOffset } diff --git a/docs/development-log.md b/docs/development-log.md index 77cb8ea..97e42e4 100644 --- a/docs/development-log.md +++ b/docs/development-log.md @@ -399,3 +399,17 @@ This is the append-only implementation and handoff record shared by Codex and Cl - Known limitations: The Custom Tab's toolbar isn't tinted to match the app's own color scheme (left plain rather than hardcoding a color inconsistent with the app's dynamic/Material You theming) — a minor visual polish item, not a functional gap. The OAuth consent ("Authorize") click itself is unchanged and unavoidable by design; only the surface it renders on changed. Live end-to-end confirmation of the login flow is pending as of this commit. - Next recommended task: Get the human product owner's live confirmation of the login flow, then continue to the two remaining queued items from TASK-024/025 (image viewer, Issues/PR numbered pagination). - Next owner: Claude, continuing per the standing direction. + +## 2026-08-27 — TASK-025 follow-up: fix diff-view horizontal-scroll direction + +- Agent and role: Claude, self-directed device testing — the human product owner re-paired their device over wireless `adb` under a fresh pairing code/port and asked to test horizontal scroll on the current screen directly, rather than reporting a specific symptom first. +- Commit/diff: continued on `claude/task-015-notifications`; `feature/history/HistoryScreen.kt` only. +- Bug: verified by scripting `adb shell input swipe` in both directions against the live device and comparing before/after screenshots (rather than waiting for the human product owner to notice and describe it): the diff view's horizontal scroll, jitter-free since the previous follow-up, ran backwards — dragging left revealed the very start of the line (the `-`/`+ ` prefix) instead of further content along it, and dragging right did the opposite. Every other horizontally-scrollable surface on Android does the reverse (drag left reveals more content to the right, i.e. "forward"). +- Root cause: the manually-driven scroll offset from the previous follow-up computed `newOffset = horizontalOffsetPx + delta` inside `rememberScrollableState { delta -> ... }`; the sign was backwards for how Compose's `scrollable` reports `delta` for this gesture. +- Fix: flipped to `newOffset = horizontalOffsetPx - delta` (with the returned consumed-delta value adjusted to match). Reverified with the same scripted-swipe-plus-screenshot method: dragging left now reveals later content, dragging right returns toward the start, and both diff panels stay in sync throughout. +- Files changed: `feature/history/HistoryScreen.kt`, `tasks/025-branch-detail-tabs.md` (evidence updated in place, same as the prior diff-scroll follow-up). +- Checks and results: `./gradlew assembleDebug testDebugUnitTest lintDebug` BUILD SUCCESSFUL, all unit tests passing, 0 lint errors. Reinstalled on the human product owner's device over wireless `adb`; the direction fix itself was verified directly via scripted swipes rather than waiting on a live report. +- Review findings and resolutions: None from a separate review pass — found via direct device testing prompted by the human product owner's "좌우 스크롤 해서 이상한걸 감지해볼래?" request, rather than a bug report. +- Known limitations: While investigating, also confirmed that partial characters get visually clipped at the viewport edge when scrolled to a non-character-aligned pixel position — this is expected behavior for any horizontally-scrolled monospace text (the same happens in GitHub's and VS Code's own diff/code viewers) and was not treated as a defect, though it was more noticeable while the direction bug was still live and scroll landed at unusual positions. +- Next recommended task: Get the human product owner's live confirmation of the diff view (jitter-free and now correctly directional) alongside the rest of the TASK-025 batch and the TASK-026 Custom Tabs login flow, then continue to the two remaining queued items (image viewer, Issues/PR numbered pagination). +- Next owner: Claude, continuing per the standing direction. diff --git a/tasks/025-branch-detail-tabs.md b/tasks/025-branch-detail-tabs.md index 4a0fff2..72ece22 100644 --- a/tasks/025-branch-detail-tabs.md +++ b/tasks/025-branch-detail-tabs.md @@ -72,7 +72,8 @@ Plus six more follow-up fixes/changes found or requested during the same live-te - `RepositoryListScreen.kt`: `RepositoryContent`/`ReferencesContent` wrapped in `PullToRefreshBox` (`@OptIn(ExperimentalMaterial3Api::class)`), manual "새로고침" `OutlinedButton`s removed from both. - `./gradlew compileDebugKotlin`: BUILD SUCCESSFUL, both after the `@OptIn(ExperimentalMaterial3Api::class)` fix for `PullToRefreshBox` and again after the diff-scroll rewrite. - `./gradlew assembleDebug testDebugUnitTest lintDebug` (`--rerun-tasks` on the first full pass, incremental on the diff-scroll-rewrite follow-up): BUILD SUCCESSFUL both times, all unit tests passing, 0 lint errors. -- Live device: build installed over wireless `adb` (`adb-RFCYA0RD1CZ-ztOzAA._adb-tls-connect._tcp`, Galaxy Z Fold) three times across this task — initial batch, then again after the diff-scroll jitter report and fix; human product owner asked to confirm the diff view specifically no longer jitters, alongside the rest of the batch — result pending as of this commit. +- `HistoryScreen.kt`'s diff-scroll `rememberScrollableState` (third pass): verified live (by directly swiping the device over `adb`) that the jitter-free scroll from the second pass ran in the wrong direction — dragging left revealed the start of the line instead of further along it, backwards from every other horizontally-scrollable surface on Android. Root cause: `newOffset = horizontalOffsetPx + delta` had the sign backwards for this gesture; fixed to `newOffset = horizontalOffsetPx - delta`, confirmed correct by the same live-swipe method (drag left now reveals later content, drag right returns toward the start, both panels stay in sync). +- Live device: build installed over wireless `adb` (`adb-RFCYA0RD1CZ-ztOzAA._adb-tls-connect._tcp`, Galaxy Z Fold) four times across this task — initial batch, after the diff-scroll jitter fix, and again after the direction fix, the last verified directly via scripted `adb shell input swipe` plus before/after screenshots rather than waiting on a live report. Human product owner asked to confirm the rest of the batch (tabs, overlap fix, status-bar padding, back-button removal, pull-to-refresh) — result pending as of this commit. ## Review findings