Sharing one ScrollState across every row in the diff panels made each row's
layout pass overwrite the shared max-scroll bound with its own line width,
so the visible offset snapped back and forth mid-drag ("글자가 춤을 추네").
Replace it with a manually-driven offset clamped against one bound computed
once per file, instead of recomputed per row.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
12 KiB
12 KiB
TASK-025: Tabbed branch detail screen (Files + History), repository row commit time, swipeable repository/favorites tabs, and live-testing follow-up fixes
Status: implemented; all required checks pass; device verification pending Owner: Claude Reviewer: Codex
Outcome
Three more live requests from the same testing session:
- Tapping a branch/tag now opens one screen with two swipeable tabs — 파일 (Files, the code browser, default) and 히스토리 (History) — over the same ref, restoring file/folder browsing (removed from the UI by TASK-024) while keeping the direct-to-history behavior the human product owner asked for, by making history the second tab instead of the only destination.
- Each repository row on the repository list now shows its last-commit time (reusing the existing
updatedAtEpochMillisfield and the sharedformatInstanthelper from TASK-024 — no new API data needed). - The repository list's 전체(All)/즐겨찾기(Favorites) tabs are now swipeable (swipe right from All → Favorites, swipe left from Favorites → All), not just tap-to-switch.
Plus six more follow-up fixes/changes found or requested during the same live-testing pass on the same branch, kept in this task rather than split out since they're all small, tightly related touch-ups to screens this task already modifies or reuses:
- Overlap bug fix: the narrow-layout (non-Z-Fold-unfolded) branch of
CommitDetailScreen'sBoxWithConstraintshadHeader(...)and its content as bare siblings instead of children of aColumn, soBoxWithConstraints(which behaves likeBox— it does not arrange multi-child branches vertically on its own) rendered them stacked on top of each other. Reported twice by the human product owner via screenshot before being root-caused; fixed by wrapping each branch's contents inColumn(Modifier.fillMaxSize()) { ... }. - Status-bar padding fix:
BranchDetailScreen'sTabRowwas jammed against the status bar because, unlike every other top-level screen in the app, it wasn't wrapped in its ownScaffold. Fixed withModifier.statusBarsPadding()on the outerColumn(not a nestedScaffold, to avoid double-padding sinceCodeBrowserScreen/HistoryScreenalready have their ownScaffolds internally). - Diff horizontal-scroll fix, in two passes:
DiffSideLine(in the History tab's file-diff view) originally hadModifier.fillMaxWidth().horizontalScroll(state)and nosoftWrap = false, so long lines wrapped instead of overflowing — nothing to scroll. First pass fixed that by removingfillMaxWidth()and addingsoftWrap = false, matching the already-workingPatchTextcomposable's modifier pattern — but that pattern shares oneScrollStateacross every row in the panel (so dragging any line moves them all together), and a singleScrollState's scroll bound is set from whichever row's layout pass ran most recently; with many differently-wide lines in the same list, that bound kept getting overwritten mid-drag, snapping the visible offset back and forth ("글자가 춤을 추네" — reported live, with a screenshot, after the first pass had already been installed). Second pass replaced the sharedScrollStatewith a hand-rolled scroll: oneModifier.scrollable(...)per row feeding a single shared offset value, clamped against one bound computed once up front (viaTextMeasurer, from the longest line in the file) instead of recomputed per row, then applied to each row with a plainModifier.offset { ... }— so no per-row layout pass can stomp on another row's bound anymore. - Loading-text simplification: the references-loading message on the repository screen previously interpolated the repository name into a longer sentence; simplified to a plain "로딩 중" per direct request, and the now-unused
%1$splaceholder removed fromrepositories_references_loading. - In-app back buttons removed: every screen-header back button (
CodeBrowserScreen'sBrowserHeader,HistoryScreen'sHeader,NotificationsScreen'sFilterTabs,WorkItemsScreen'sModeTabsandDetailHeader,RepositoryListScreen'sReferencesContentheader) removed, since every screen already has aBackHandlerwired to the system back gesture and the human product owner asked to rely on that instead.WorkItemsScreen'sDetailHeadercomposable (which consisted only of a back button) removed entirely along with all 5 call sites. Now-unusedhistory_back/notifications_back/workitems_back/codebrowser_backstring resources removed;repositories_backkept, since it's a distinct recovery action on the references-error state's secondary button, not a header back button. - Pull-to-refresh replaces manual refresh buttons:
RepositoryListScreen'sRepositoryContentandReferencesContenteach had a manual "새로고침"OutlinedButton; both replaced withPullToRefreshBox(Material3,@OptIn(ExperimentalMaterial3Api::class)) wrapping theirLazyColumns, so pulling down from the top refreshes instead.
Scope
- Included:
ui/navigation/Route.kt/RouteStackSaver.kt(Route.CodeBrowser/Route.Historyreplaced by oneRoute.BranchDetail), newfeature/branchdetail/BranchDetailScreen.kt,MainActivity.ktwiring,strings_branchdetail.xml, plus the follow-up touch-ups (items 4-9 above) tofeature/history/HistoryScreen.kt,feature/codebrowser/CodeBrowserScreen.kt,feature/notifications/NotificationsScreen.kt,feature/workitems/WorkItemsScreen.kt,feature/repositories/RepositoryListScreen.kt, and their string resources. - Excluded: No change to
CodeBrowserViewModel/HistoryViewModelinternals — both are reused exactly as they were, including their own internal drill-down (subfolder navigation, commit detail) and their own per-stateBackHandlers. This screen only adds theTabRow+HorizontalPagerchrome around them. No change to actual refresh/pagination/network logic — item 9 only changes the trigger UI, not whatonRefreshdoes.
Design notes
- Both tabs' ViewModels (
codeBrowserViewModel,historyViewModel) are opened together whenRoute.BranchDetailbecomes current, and closed together when either tab's internal back-handling has nothing left to unwind (onCodeBrowserBack/onHistoryBackboth close both ViewModels and pop the route) — a single shared exit point rather than two independently-tracked one. HorizontalPager's defaultbeyondViewportPageCount(0) means only the currently visible tab is composed, so each tab's own internalBackHandlers never conflict with each other — the system back button always applies to whichever tab is actually on screen, with no extra coordination code needed.CodeBrowserScreen's existing "히스토리" header button is kept, repurposed to animate the pager to the History tab instead of pushing a route — a working existing affordance, not dead code.Route.CodeBrowserandRoute.Historyare fully removed (not left dead), sinceRoute.BranchDetailis now the only way either screen is reached.
Acceptance criteria
- Tapping a branch/tag opens
Route.BranchDetail, defaulting to the Files tab. - Files tab supports folder drill-down and reading file contents (the restored TASK-006 code browser, unmodified).
- Swiping left/right between tabs works (
HorizontalPager); tapping a tab also works (TabRow). - System back: within a subfolder/commit-detail, back unwinds that tab's own internal state first; only at each tab's own root does back exit the branch-detail screen entirely.
RouteEncoding/RouteStackSaverround-tripRoute.BranchDetailincluding a ref containing a slash, and fall back toRepositorieson truncated/malformed persisted data.- Commit-detail screen renders correctly (no overlapping content) in the narrow/folded layout.
BranchDetailScreen's tab row sits below the status bar, not jammed against it.- Diff view supports horizontal scroll on long lines (synced across before/after panels).
- References-loading message reads a plain "로딩 중".
- No in-app back buttons remain on any screen header; system back gesture still exits each screen/subview correctly.
- Pulling down from the top of the repository list or references list triggers a refresh; no manual refresh button remains.
- Build, unit tests, and lint pass.
- Full device confirmation of the tab UI, swipe gesture, back-button removal, and pull-to-refresh together in one pass.
Required checks
./gradlew assembleDebug
./gradlew testDebugUnitTest
./gradlew lintDebug
Evidence
feature/branchdetail/BranchDetailScreen.kt(new):TabRow+HorizontalPager(pageCount = { 2 }), page 0 =CodeBrowserScreen, page 1 =HistoryScreen, both passed through unmodified with their full existing parameter lists.ui/navigation/Route.kt:CodeBrowser/Historyreplaced byBranchDetail(owner, name, refKind, ref).RouteStackSaver.kt'sRouteEncodingupdated to match (TYPE_BRANCH_DETAILreplacesTYPE_CODE_BROWSER/TYPE_HISTORY).MainActivity.kt:onReferenceSelectednow maps the tapped reference'sReferenceKind(branch/tag) toCodeReferenceKindand pushes oneRoute.BranchDetail, matching what previously only fedRoute.CodeBrowser'srefKindfield — this mapping had been temporarily lost when TASK-024 redirected the tap straight toRoute.History(which didn't need a ref kind); this task restores it.RouteEncodingTest.ktupdated:code browser route round-tripsandhistory route round-tripstests replaced by onebranch detail route round-trips including a ref containing a slashtest; the truncated-route and full-back-stack tests updated to match.HistoryScreen.kt'sCommitDetailScreen: eachBoxWithConstraintsbranch now wrapsHeader(...)+ content inColumn(Modifier.fillMaxSize()) { ... }instead of leaving them as bare siblings.BranchDetailScreen.kt: outerColumngainedModifier.statusBarsPadding().HistoryScreen.kt'sDiffSideLine(first pass, superseded — see below):Modifier.horizontalScroll(horizontalScrollState).padding(...)withsoftWrap = false, nofillMaxWidth().HistoryScreen.kt'sDiffSideLine/FileDiffView(second pass, current): sharedScrollStatereplaced by a manually-driven offset —rememberScrollableState { delta -> ... }updates oneMutableFloatStateclamped to[0, maxHorizontalOffsetPx], wheremaxHorizontalOffsetPxis computed once per selected file viarememberTextMeasurer().measure(...)against the longest line's character count (monospace, so any character stands in for the widest line's glyph width). Each row appliesModifier.scrollable(sharedScrollableState, Orientation.Horizontal)for gesture capture andModifier.offset { IntOffset(-horizontalOffsetPx.value.roundToInt(), 0) }for rendering, wrapped inBox(Modifier.fillMaxWidth().clipToBounds())since a plainoffset(unlikehorizontalScroll) doesn't clip overflow on its own.strings_repositories.xml:repositories_references_loadingsimplified to a fixed "로딩 중" string (no%1$splaceholder); call site inRepositoryListScreen.ktupdated to match.- Back buttons removed from
CodeBrowserScreen.BrowserHeader,HistoryScreen.Header,NotificationsScreen.FilterTabs,WorkItemsScreen.ModeTabs;WorkItemsScreen.DetailHeadercomposable and its 5 call sites removed entirely;ReferencesContent's header back button removed.history_back/notifications_back/workitems_back/codebrowser_backstring resources removed as now-unused. RepositoryListScreen.kt:RepositoryContent/ReferencesContentwrapped inPullToRefreshBox(@OptIn(ExperimentalMaterial3Api::class)), manual "새로고침"OutlinedButtons removed from both../gradlew compileDebugKotlin: BUILD SUCCESSFUL, both after the@OptIn(ExperimentalMaterial3Api::class)fix forPullToRefreshBoxand again after the diff-scroll rewrite../gradlew assembleDebug testDebugUnitTest lintDebug(--rerun-taskson 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.
Review findings
None yet — pending Codex/human review.