Ubisam-MobileGit/tasks/065-code-tabs-compare-and-reading-aids.md
choiminyeong 54530096e0 TASK-065: code tabs, comparing two files, and reading aids
- Up to five code files saved as tabs in a strip above the bottom tabs.
- Compare a file with one from another ref, commit or place; the
  current file goes left or right, then the other is chosen.
- The side pane on a wide screen is dragged to size and snaps back to
  its default; the header/source split snaps to the middle.
- A tapped name is marked everywhere in the file, with previous/next.
- The Repositories tab pressed again goes back to the list page the
  repository came from, then to the first page.

Agent: main (opus)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-07 20:38:55 +09:00

3.5 KiB

TASK-065: Saved code tabs, comparing two files, and reading aids

Status: done Owner: Claude Reviewer: human product owner

Outcome

Requested by the human product owner, 2026-10-07:

  1. Code files can be kept as tabs. Saving a tab puts a strip between the screen and the bottom tabs; each saved file stays there, at most five, and tapping one goes back to it.
  2. Two files can be compared side by side like a merge tool: the current file is placed on the left or right, then another file (from another commit or another place) is opened and the same button pressed again to compare the two.
  3. On the unfolded screen the side pane beside the code can be resized by dragging; near its default width it snaps to the default like a magnet.
  4. Tapping a word in the code marks every occurrence of the same name.
  5. Pressing the Repositories tab again while inside a repository returns to the repository list page that was being viewed; pressing it again there goes to the first page.

Scope

  • Included: the five items above.
  • Excluded: editing or merging files; comparing directories; three-way comparison.

Writable paths

  • app/src/main/java/com/ubisam/ubgitea/
  • app/src/main/res/values/
  • app/src/test/java/com/ubisam/ubgitea/
  • tasks/, docs/

Acceptance criteria

  • The code viewer has a "save tab" button; a saved file shows as a chip in a strip above the bottom tabs (and above the viewer's toolbar when reading full screen). Tapping a chip opens that file in its repository and ref; its close mark removes it. Tabs survive a restart.
  • A sixth tab is refused with a message; nothing is evicted silently.
  • The compare button asks whether the current file goes left or right, then a banner shows the waiting file. Pressing compare on another file (in the code viewer or a commit's file diff) opens a two-column view where matching lines stay level, differing lines are coloured, and there are next/previous difference and swap-sides actions.
  • The line comparison is a pure function with unit tests, and gives up gracefully on files that differ too much.
  • The side pane width is dragged with a handle, kept between launches, snaps to the default within 16dp, and resets on double tap.
  • Tapping an identifier highlights all whole-word occurrences in a colour distinct from search hits; tapping it again or tapping a non-word clears it.
  • Repositories tab reselect: inside a repository → the list page last viewed; on the list with page > 1 → page 1. Other tabs behave as before.
  • All new text is in string resources; new controls have spoken labels.

Security and privacy

No additional concerns. Saved tabs hold only owner, repository name, ref and path; no tokens.

Required checks

./gradlew compileDebugKotlin compileDebugUnitTestKotlin testDebugUnitTest assembleDebug lintDebug

Evidence

  • 2026-10-07: the required checks pass; 461 unit tests, 0 failures; lint 0 errors.
  • New tests: LineDiffTest, CodeWorkbenchViewModelTest, openFile in CodeBrowserViewModelTest, reselect in RepositoryListViewModelTest, snapTo in SplitTest, wordAt and findWordOccurrences in CodeSearchTest, and a file route and an unrestored comparison in RouteEncodingTest.
  • Live verification: none. No device was connected; the tab strip, the compare screen, the drag handle's snap and the word marks were not seen on a screen by the implementer.

Review findings

None yet.