Ubisam-MobileGit/tasks/005-repository-branch-ui.md
choiminyeong fdda16442a Review and freeze TASK-004/005/006; fix 409/422 typed failures
Independent read-only review of 8a47d30/bbbff77/16c46a5 per
handoff/claude-master-handoff.md's review-and-freeze step. Verified
build/test/lint independently rather than trusting recorded evidence.

Fixed P2: requireSuccess() collapsed HTTP 409/422 into the generic
InvalidResponse, which would have blocked TASK-007's planned
conflict/unprocessable error states. Added ApiFailure.Conflict and
ApiFailure.Unprocessable with test coverage.

Recorded a P3 (CPU-bound work on the Main dispatcher in
CodeBrowserViewModel) for TASK-016 rather than fixing it now. Closed
TASK-005/006's mutual contract-freeze checkboxes. No P0/P1 found.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-08-26 12:54:46 +09:00

4.0 KiB

TASK-005: Browse repositories and branches

Status: implemented and independently reviewed by Claude; no P0/P1 findings; device check deferred Owner: Codex Reviewer: Claude

Writable paths

  • app/src/main/java/com/ubisam/ubgitea/feature/repositories/
  • app/src/test/java/com/ubisam/ubgitea/feature/repositories/
  • app/src/main/java/com/ubisam/ubgitea/MainActivity.kt
  • app/src/main/java/com/ubisam/ubgitea/data/auth/AuthApi.kt (testable gateway extraction only)
  • app/src/main/java/com/ubisam/ubgitea/data/repositories/RepositoryListApi.kt (testable gateway extraction only)
  • app/src/main/res/values/strings_repositories.xml
  • app/src/main/java/com/ubisam/ubgitea/ui/navigation/
  • app/src/test/java/com/ubisam/ubgitea/ui/navigation/
  • tasks/005-repository-branch-ui.md

Outcome

A signed-in user can browse every repository and branch visible to their Gitea account with loading, pagination, refresh, empty, offline, expired-authentication, and server-error states.

Acceptance criteria

  • Repository and branch lists preserve pagination and refresh state.
  • Organization/owner, visibility, default branch, and selected branch are unambiguous.
  • Loading, empty, offline, authentication-expired, and server-error states are accessible and localized.
  • Retry and pagination cannot create duplicate items or overlapping requests.
  • Presentation and ViewModel tests cover primary states and selection behavior.
  • Resource names use the repositories_ prefix.
  • The reviewed completion commit is recorded as TASK-006's contract-freeze base.

Evidence

  • Repository rows open a repository-scoped branch/tag screen; the selected repository, account, default branch, protected status, selected ref, and abbreviated commit ID remain visible.
  • Branch and tag pages are consumed serially with a 100-page bound, presenter-level name deduplication, cancellation of replaced operations, refresh/retry, and deterministic back navigation to the immutable repository snapshot.
  • Focused presenter/ViewModel tests passed, including default selection, tag selection, back restoration, immutable snapshots, deduplication, and network-error mapping.
  • Repository-wide assembleDebug testDebugUnitTest lintDebug passed: 96 unit tests across 21 suites, zero failures/errors.
  • git diff --check passed. Focused sensitive-pattern inspection found no token, client secret, password, private key, or credential material.
  • The independent reviewer and physical-device interaction check are deferred while Codex owns the serial implementation stream. TASK-006 may be developed on the local contract, but its eventual integration review must include this commit before the contract-freeze checkbox is closed.

Claude independent review closure

Reviewed read-only at commit bbbff77 per handoff/claude-master-handoff.md. Independently reran assembleDebug testDebugUnitTest lintDebug --rerun-tasks at 16c46a5 (which includes this commit): BUILD SUCCESSFUL, 102 tests / 23 suites, 0 failures; git diff --check clean.

  • Races/cancellation (verified, no finding): selectRepository, refreshReferences, and retry all route through startOperation, which cancels the prior Job before launching the next one, so rapid repository/branch/tag switches cannot overlap.
  • Immutable snapshots (verified, no finding): RepositoryListUiState.Content and ReferencesContent wrap their lists in Collections.unmodifiableList; backToRepositories() restores the stored repositoryContent snapshot rather than reloading, and the restored snapshot cannot be mutated by later reference-loading state.
  • Page overflow (verified, no finding): loadAllPages bounds branch/tag pagination to MAX_REFERENCE_PAGES (100) and throws a typed failure instead of looping forever if a server never reports the end of a list.
  • No P0/P1 found. The 409/422 typed-failure gap recorded under TASK-004 was the only cross-cutting finding and is now fixed there.

Device interaction remains deferred (no physical device available in this environment); this is an existing known limitation, not a new finding.