Repository navigation
feat(drawer): show each chat's pull request state in the sidebar - #447
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
概要
左側サイドメニュー(ドロワー)の各チャット行に、そのチャットが作成した PR の状態アイコンを表示します。既存のコンポーザー上バッジ(
#443 マージ済みなど)と同じ状態判定を使い、オープン / ドラフト / マージ済み / クローズ / コンフリクトを色付きアイコンで示します。PullRequestStatusRepositoryが保持し、sessionStatusesとしてドロワーへ提供SecureSettingsRepositoryに永続化(暗号化 SharedPreferences、chatId<TAB>owner/repo#numberの行形式)ui/components/PullRequestStateUi.ktに共通化し、既存バッジと共有cd_pull_request_statusを全 8 ロケールに追加テスト
:app:testGithubDebugUnitTest成功:app:lintGithubDebug成功spotlessCheck/detekt成功Pre-PR review
判定: APPROVE
ブロッカー
origin/main...HEAD(5コミット、72b1bc99まで)を全ハンク通読し、前回APPROVE後に追加された docs のみの差分も確認しました。最終HEADにCI失敗・挙動破壊・i18n退行・ハードルール違反になる箇所は見つかりませんでした。提案(非ブロッキング)
app/src/main/java/com/yugahashimoto/andcode/data/repository/PullRequestStatusRepository.kt:150—session_pull_requestsはチャット削除後もエントリが残り、PR をリンクしたチャット数に比例して無制限に育ちます(1 セッションあたり最大 5 件でも、セッション数に上限なし)。EncryptedSharedPreferences の復号コストも含め、将来セッション削除時の掃除や全体上限・古いセッションの間引きを検討するとよいです(動作は正しく、ブロック要因ではありません)。app/src/main/java/com/yugahashimoto/andcode/ui/AppDrawerRows.kt:485— ドロワーの PR アイコンは状態表示のみでタップで GitHub を開けません。contentDescription も「状態」のみなので、行タップ(チャットを開く)と競合しない範囲で PR を開く導線を足すかは UX 判断(今回は仕様どおりで問題なし)。チェック済み項目
72b1bc99がコメントのみ(3 insertions / 2 deletions、ChatViewModel.ktの KDoc 差し替えだけ)であることをgit showで確認。旧記述「periodic refresh を止める」は新挙動(ドロワーは transcript を独立追跡)と矛盾していたため、修正は正確で、dismissPullRequest(ChatViewModel.kt:891-894)が composer 側pullRequestRefsのみ落としtrackSessionは dismissal 前に呼ばれる実装(ChatViewModel.kt:857-863)と一致。cd_pull_request_statusがvalues/strings.xmlと全 7 ロケール(ar, es, fr, ja, pt-rBR, ru, zh-rCN)に存在することを確認。i18n-check.ymlの「全ロケール必須」条件を満たす。Kotlin 側にハードコード文字列なし(contentDescriptionはstringResource、状態名はlabelRes())。AppModule.kt(single<PullRequestSessionStore> { get<SecureSettingsRepository>() }とPullRequestStatusRepository(... sessionStore = get()))と手動構築AndCodeApplication.kt:283-287(sessionStore = settings)の両経路が同期済み。ChatViewModelはコンストラクタ依存を増やしていないため ViewModelFactory 側の追加変更不要。PullRequestRef.key("$owner/$repo#$number")とparsePullRequestKeyの往復が一致、MAX_TRACKED_PULL_REQUESTS・PullRequestStatus(ref, state)の参照も実在を確認。sessionIdがString?であるためsessionId?.letの扱いも妥当。pullRequestRefsInが「新しい順(takeLast+reversed)」を返し、trackSessionのfirstOrNull()が最新を拾う仕様と一致。KDoc の「in flight は省略して古いものにフォールバック」もmapNotNull実装と一致。color()/icon()/labelRes()はPullRequestLinkBar.kt/AppDrawerRows.ktから正しく import、Icons・Color・ImageVectorの未使用 import 残りなし。PullRequestStateUi.ktに既存シンボルとの衝突なし。@Composable拡張の呼び出し位置も composable 内で妥当。行長は 140 以内で detekt/ktlint 上問題なし。PullRequestStatusRepositoryTest(trackSession/永続化/ラウンドトリップ/起動時追跡、scope.cancel()で後始末)、ChatViewModelPullRequestTest(dismiss 後もドロワー用に記録)、DrawerModelTest(最新 PR の紐付け)を確認。FakeStore追加で既存テストの hermetic 性も維持。