Ubisam-MobileGit/tasks/064-review-fixes-star-double-tap-and-diff-lines.md
choiminyeong 6a149087c0 TASK-064: ignore a second star tap in flight; keep -- and ++ lines in diffs
Agent: main (opus)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-29 20:25:49 +09:00

2.3 KiB

TASK-064: Fixes from the full review — star double tap, diff lines

Status: implemented; required checks pass; not yet confirmed on a device Owner: Claude Reviewer: human product owner

Outcome

  1. A quick double tap on a repository's star no longer sends a star and an unstar together.
  2. A changed line whose own text starts with -- or ++ (an SQL or Lua comment, a Markdown ---, a C++ ++i; at the start of a line) shows in the diff. Before, it was dropped, and the line numbers under it were off by one per dropped line.
  3. A hunk header the parser cannot read leaves its rows unnumbered, instead of numbering them from 1.

Scope

  • Included: RepositoryListViewModel.toggleFavorite, UnifiedDiffParser.
  • Excluded: anything else the review looked at.

Writable paths

  • app/src/main/java/com/ubisam/ubgitea/feature/repositories/RepositoryListViewModel.kt
  • app/src/main/java/com/ubisam/ubgitea/domain/history/UnifiedDiffParser.kt
  • app/src/test/java/com/ubisam/ubgitea/feature/repositories/RepositoryListViewModelTest.kt
  • app/src/test/java/com/ubisam/ubgitea/domain/history/UnifiedDiffParserTest.kt
  • tasks/064-review-fixes-star-double-tap-and-diff-lines.md
  • docs/development-log.md

Acceptance criteria

  • While a star or unstar request for a repository is on its way, another tap on that repository's star does nothing. After it settles, the next tap works as before.
  • Inside a hunk, +++x is an added ++x and --- x is a removed -- x. The file's own ---/+++ lines, which come before the first hunk, are still skipped.
  • A hunk header that does not match @@ -a[,b] +c[,d] @@ gives rows with no line numbers, and its raw text is the hunk label.
  • Unit tests cover all three.

Security and privacy

No additional concerns.

Required checks

./gradlew compileDebugKotlin compileDebugUnitTestKotlin testDebugUnitTest assembleDebug lintDebug

Evidence

See the development log entry for TASK-064.

Review findings

Found by the full code review of 2026-09-29. Other reported candidates were checked against the code and dropped: the offline cache cannot show another account's list (every logout path clears it), state updates run on the main thread without a suspension between read and write, and the highlighter's patterns cannot match an empty string.