Repository navigation
feat(chat): show active project label in chat top bar - #455
Merged
Merged
Conversation
Contributor
|
Debug APK built successfully Download APK artifact Commit: |
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.
概要
チャット画面のヘッダー(
CenterAlignedTopAppBar)に、現在の会話がどのプロジェクト(作業フォルダ)に属しているかを表示するようにしました。ChatHomeScreenのCenterAlignedTopAppBarで、チャットタイトル(「チャット」またはセッションタイトル)の下にフォルダアイコン付きでプロジェクト名を表示sessionId == null)ではselectedWorkspacePathから解決し、複数プロジェクトが登録されている場合はタップでドロップダウンメニューから切り替え可能sessionId != null)ではセッション固有のsessionDirectoryのみを表示し、別の新規チャット用に選ばれていたselectedWorkspacePathが混ざらないように分離ChatViewModelで新規セッション作成時(通常送信・スラッシュコマンド送信)にsessionDirectoryを記録し、既存セッション・サブエージェント・親セッションへの遷移時にも取得済みdirectoryを引き継ぐよう補強AndCodeAppの自動ワークスペース選択LaunchedEffectにchatState.selectedWorkspacePathを含め、ドロワー「新しいチャット」後の選択欠落を解消テスト・検証
ChatProjectLabelTest:resolveChatProjectLabelの 5 ケース(一致ワークスペース名、フォルダ名フォールバック、既存セッションでのsessionDirectory優先、sessionDirectory == null時の非漏洩、未選択時)を追加ChatViewModelTest: セッション作成時・オープン時のsessionDirectory保持テストを追加./gradlew --no-daemon --console=plain spotlessCheck: 通過(ユニットテストのコンパイル・実行はこの環境に Android SDK がないため CI に委譲)Pre-PR review
判定: APPROVE
ブロッカー
なし
提案(非ブロッキング)
app/src/test/java/com/yugahashimoto/andcode/feature/chat/ChatViewModelTest.kt: 新規追加の 2 件のテストに加えて、sendCommand(スラッシュコマンドからの新規セッション作成)、createSessionのレスポンスでdirectory = nullが返った場合のselectedWorkspacePathフォールバック、およびopenSubagentSession/openParentSession/resolveParentSession経由でのsessionDirectory引き継ぎもユニットテストで押さえるとさらに安心です。チェック済み項目
ChatHomeScreen.kt:1065—ChatTopBarTitleのプロジェクト名TextにModifier.weight(1f, fill = false)・maxLines = 1・TextOverflow.Ellipsisが適用されており、短い名前では中央寄せを保ちつつ長い名前でも右側のArrowDropDownを押し出さない構成を確認。ChatHomeScreen.kt:1022-1025—LaunchedEffect(canSwitchProject) { if (!canSwitchProject) projectMenuExpanded = false }により、セッション開始やワークスペース数減少でcanSwitchProjectがfalseになった際にメニュー展開状態がリセットされることを確認。ChatViewModel.kt:1222-1231—resolveParentSessionでparentSession全体を取得し、ParentSessionRef(parentId, parentTitle, parentSession?.directory)にdirectoryを保持していること、およびopenParentSession(1207-1210)・openSubagentSession(1196-1204) でdirectoryが受け渡されることを確認。git diff origin/main...HEAD(5 ファイル、399b60fa)の全ハンクと、ChatViewModel.kt内の全createSession/openSession/newSession/refreshPendingQuestions、およびAndCodeApp.kt内のopenSession/openSubagentSession/selectWorkspace/ChatHomeScreen呼び出し元を確認。ChatHomeScreenの新パラメータ(workspaces,onSelectWorkspace)はデフォルト引数付きのため、既存の@PreviewやChatVoiceInstrumentedTest.ktへの破壊的変更がないことを確認。AndCodeApp.kt:795-807のLaunchedEffectキーにchatState.selectedWorkspacePathが追加された点について、ドロワーのonNewChat(1087) でselectWorkspace(null)が呼ばれた際にも既存セッションからの新規作成時と同様に先頭ワークスペースが再選択される(ワークスペース未登録時はnullのまま)挙動となり、不整合がないことを確認。R.string.chat_home_title・R.string.cd_folder・R.string.cd_expand_dropdownを参照していること、および全 8 ロケール(values,values-ar,values-es,values-fr,values-ja,values-pt-rBR,values-ru,values-zh-rCN)のstrings.xmlにこれら 3 キーが存在することをrgで確認。.editorconfig・config/detekt/detekt.yml・build.gradle.ktsと照合し、import 順、末尾カンマ、インデント、行長(全追加行が 140 文字以内)、末尾改行を確認(※読み取り専用レビューのため./gradlewの実行自体は行っていません)。ChatProjectLabelTest.kt(5 ケース: 既知ワークスペース一致、リスト外パスのフォルダ名フォールバック、オープン済みセッションでのsessionDirectory優先、sessionDirectory == null時のselectedWorkspacePath非漏洩、未選択時のnull)およびChatViewModelTest.ktの追加 2 ケースの内容を確認。