Conversation
TUI から session create したら作成完了後にその新規セッションへ自動で 在席(Focus)へ移る。MCP(session_create)経由は TUI を介さないため在席に 入らず、一覧へバックグラウンド反映されるだけでカーソルは動かない。 Completion に focus を載せ、完了 drain で enter_focus_named を呼ぶ。 旧挙動を記した design/05-home.md を修正し、MCP の非在席を doc 化。 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
📊 Test Coverage
🎉✨ パーフェクト!全ファイル Lines カバレッジ 100% を達成しました 🏆🐰 |
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.
目的
セッションを作成したら、そのまま新規セッションを操作できるように、作成完了後に自動で**在席(Focus)**へ移りたい。MCP 経由の作成は在席に入らない。
設計ドキュメント(
00-tutorial.md/design/05-home.mdの複数箇所)は元々「作成 → 在席」と記載しており、実装だけが追いついていなかった。本 PR で実装をドキュメントの意図に合わせる。変更内容
実装
tasks::Completionにfocus: Option<String>を追加。成功した TUI 作成のときだけ新規ブランチ名を載せる。run_create成功時にfocus: Some(created.name)を設定(削除・失敗・panic はNone)。HomeState::enter_focus_named(name)を追加。一覧更新後に行番号を計算せず、名前で一致させて在席に入る。apply_task_completion(一覧 refresh 後)に続けてenter_focus_namedを呼ぶ。MCP の扱い
session_createはusecase::session::createを直接呼ぶだけで TUI 状態に触れない。実行中 TUI への反映もバックグラウンド refresh 経由でカーソルを動かさないため、MCP 経由は在席に入らない(コード変更不要・自然に満たされる)。ドキュメント
design/05-home.md: 「作成しても自動で在席に入らない」という旧記述を新挙動(TUI 作成は在席へ/削除はカーソル維持/MCP は非在席)に修正。03-commands/03-mcp.md:session_createが別プロセスのため在席に入らない旨を追記。テスト・確認方法
enter_focus_namedの一致/不一致の単体テスト(state)。terminalが新規セッションの worktree でペインを開くことで検証する結合テスト(event loop)。focusを載せるよう更新。既存のCompletion構築にfocus: Noneを補完。cargo fmt --check/cargo clippy --all-targets -- -D warnings/cargo test(1538 件)すべて green。🤖 Generated with Claude Code