docs: コマンドリファレンスを CLI / TUI に分割し記述を実装に同期#57
Merged
Conversation
変更内容: - document/03-commands.md を document/03-commands/ ディレクトリに分割 (README + 01-cli.md + 02-tui.md)。design/・data/ の慣習に合わせる - 03-commands を参照していた 8 ファイルのリンクを更新 - space → session switch のリネームを全ドキュメントに伝播 - 切替・terminal を実装済み(✅)として実装状況を是正(04-orchestration) - design/05-home の Enter 動作の矛盾(coming soon→セッション切替)を解消 - diff が未登録である点を 02-tui の注記に明記(ai/doctor のみ placeholder) - command.rs のレジストリ説明コメントを実態に合わせて更新 確認方法: - cargo fmt / clippy --all-targets -D warnings / test 全通過(517 tests) - ドキュメント内リンク切れゼロを確認 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
📊 Test Coverage
|
kkyosuke
added a commit
that referenced
this pull request
Jun 20, 2026
## 目的 issue #57。home 画面の起動・イベント配線が引数過多で seam が広く、テスト用の `event_loop_compat` が全引数を再スレッドしていた。これを `Wiring` 構造体に束ねて整理し、`#[allow(clippy::too_many_arguments)]` を撤去する。 ## 変更内容 ### 1. `event_loop` の 18 引数 → `Wiring` 構造体 - `workspace_root` + 全コールバック(persist / dispatch_create / rename_display / dispatch_remove / evict_pool / existing_branches / open_terminal / open_config / preview / tab_op / close_tab)を `Wiring<'a>` に集約。`event_loop` は 7 引数になり `#[allow(too_many_arguments)]` を撤去。 - `run` の closure 群は `Wiring` リテラルにまとめて渡す。 ### 2. handlers の context 構造体化 - `overview_key` / `switch_key` / `focus_key` / `focus_menu_key` / `focus_prompt_key` ほか全ハンドラが `&mut Wiring` を受け取る形に統一。全ハンドラから `#[allow(too_many_arguments)]` を撤去。 - 素通しされるだけで未使用だった `reader` 引数を handler 系から削除。 - 「enter focus → (live なら) pane 再アタッチ」の 3 箇所重複を `focus_and_attach` に、terminal/agent の新規 pane 起動を `launch_pane` に共通化。 ### 3. `terminal_pane` のチョード matcher 重複 - `is_leader` / `is_next_tab` / `is_prev_tab` / `is_new_terminal_tab` / `is_new_agent_tab` / `is_close_tab` の 6 個を `chord(key, raw, letter)` ヘルパ 1 つに集約。 - `is_copy` は exact-modifier 一致・raw 制御文字フォーム無しと挙動が異なる(`Ctrl+Shift+C` / 生 `0x03` を copy にしてしまう)ため据え置き。 ### テスト側 - `event_loop_compat` / `run_with_tasks` は fake を値渡し(`impl FnMut`)で受け取り、ローカルの dispatch closure と寿命を揃えて `Wiring` を構築。呼び出し側(`&mut x` 渡し)は変更不要。 ## テスト・確認方法 - `cargo fmt` / `cargo clippy --all-targets -- -D warnings` 通過。 - `cargo test`(lib 1305 件 + 統合テスト)通過。挙動は不変。 - 変更対象ファイル(`event/handlers.rs` / `event/mod.rs`)の行・関数カバレッジ 100%。pre-commit の `coverage_enforce`(`--workspace --fail-under 100`)も通過。 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: test <test@example.com> Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This was referenced Jun 20, 2026
kkyosuke
added a commit
that referenced
this pull request
Jun 20, 2026
## 目的 性能 / UI 応答性・フィードバック / 責務の肥大化 の 3 観点で現行コードをレビューし、まだ issue 化されていない新規所見を issue ストア(`.usagi/issues/`)に登録する。 既存 issue でカバー済みの所見(#40 history append、#44/#57 handlers 引数過多、#45/#56 HomeState 肥大、#61 config 責務、#62 毎フレーム再計算・store 全再構築 など)は重複登録せず除外した。 ## 変更内容 新規 issue 5 件を追加(`index.json` はキャッシュのため gitignore 対象・非コミット): | # | 種別 | 優先度 | 概要 | |---|---|---|---| | 65 | perf(tui) | high | エージェント高頻度出力時の全画面再描画コアレス・`link_cells` 全走査キャッシュ・Switch プレビュー差分化(没入 `drive` の最適化が出力経路/プレビューに未展開) | | 66 | fix(tui) | medium | 統括/在席モードで背景状態(バッジ・update 通知)の反映が次のキー入力まで遅延(`animate` 条件が live セッションを見ていない) | | 67 | chore(tui) | medium | `coming-soon` プレースホルダコマンドが規約「記載=実装済み」に違反(doctor は実装済みなのに placeholder) | | 68 | perf(tui) | low | アイドル時のポーリング起床(`wait` 250Hz・watcher 空時 5Hz)・スクロールバック常駐メモリの最適化 | | 69 | refactor(usecase) | low | `session::set_display_name` の表示ラベル解決を presentation 層へ寄せる(層責務の漏れ) | 各 issue に該当ファイル:行・原因・改善方針・確認方法を記載。 ## テスト・確認方法 - 本 PR はドキュメント(issue ストア)の追加のみでコード変更なし。 - pre-commit / pre-push フック(branch-name / coverage)通過済み。 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: test <test@example.com> Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
目的
document/03-commands.mdは CLI コマンドと TUI 内コマンドが 1 ファイルに混在していた。系統ごとに分割して見通しを良くし、あわせてドキュメント全体を実装の現状と突き合わせて陳腐化を解消する。変更内容
コマンドリファレンスの分割
document/03-commands.md→document/03-commands/ディレクトリへ分割(既存のdesign/・data/と同じ「README + 連番ファイル」慣習に統一)README.md— 概要・凡例・目次01-cli.md— CLI コマンド(usagi <cmd>)02-tui.md— TUI 内コマンド(hop ホーム画面)03-commandsを参照していた 8 ファイルのリンクを更新(design/05-home.mdは TUI 専用なので02-tui.mdを直接参照)記述を実装に同期(レビューで発見した陳腐化の修正)
space→session switchのリネーム(impl Add file-based storage for workspaces and settings #4)を全ドキュメントに伝播(01-overview / design/README / 04-orchestration)terminalを 🚧 → ✅ に是正Enter動作の矛盾(「coming soon」→ セッション切替)を解消diffは未登録(ai/doctor のみ placeholder)である点を 02-tui の注記に明記src/presentation/tui/home/command.rsのレジストリ説明コメントを実態に合わせて更新(space参照を除去、session/terminal を実装済みと明記)テスト・確認方法
cargo fmt/cargo clippy --all-targets -- -D warnings/cargo test全通過(517 tests, 0 failed)🤖 Generated with Claude Code