refactor(tui-config): provisioning ロジックの退避と config/state modal 分離#326
Merged
Conversation
4f22e5d to
08006d1
Compare
config 画面の責務過多・肥大を是正する。 - provisioning(start_install_runtime / start_pull_model / install_error_message)を config/mod.rs から config/provisioning.rs へ退避。 mod.rs は launcher 責務に純化。provisioning.rs はスレッド生成・ サブプロセス実行の端末 I/O ラッパなので coverage 除外(SSoT scripts/coverage.sh)。 - state/mod.rs の InstallModal / ModelModal / ModelRow 型と install/model modal の委譲メソッド群を state/modal.rs へ括り出し。型は state から re-export するため ui.rs の参照は不変。 - config/event.rs(994 行)を event/mod.rs(実コード)+ event/tests.rs (テスト)に分割。state/ の `mod tests;` 外出しに倣う。 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
08006d1 to
5cb919e
Compare
…rovisioning # Conflicts: # scripts/coverage.sh # src/presentation/tui/config/event.rs
📊 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.
目的
config 画面に責務過多・肥大が見られた(issue #61)。launcher・状態・イベントの各責務を分離する。
変更内容
1. provisioning ロジックの退避
config/mod.rsに同居していたstart_install_runtime/start_pull_model/install_error_message(バックグラウンドスレッド生成・install_task進捗記録・SetupError→日本語メッセージ変換)をconfig/provisioning.rsへ移動。mod.rsは「画面を起動して closure を注入する」launcher 責務に純化。provisioning.rsはスレッド生成・サブプロセス実行の端末 I/O ラッパで計測不能なため、coverage 除外を SSoT (scripts/coverage.sh) に追加(config/mod.rsと同じ扱い)。2. config/state の modal 分離
state/mod.rsのInstallModal/ModelModal/ModelRow型定義と、install/model modal の委譲メソッド群をstate/modal.rsへ括り出し。stateから re-export するためui.rsのuse ...state::{InstallModal, ModelModal}は変更不要。3. config/event のテスト外出し
config/event.rs(994 行=実コード ~283 + テスト 711)をevent/mod.rs(実コード)+event/tests.rs(テスト)に分割。state/が既に採用しているmod tests;外出しの前例に倣う。テスト・確認方法
cargo fmt/cargo clippy --all-targets -- -D warnings/cargo test全て通過。Closes #61
🤖 Generated with Claude Code