feat: PLAN31_2-tui-framework TUI 土台 (tui/ + メニューエンジン + 既存 project 操作の非回帰移送)#56
Merged
Merged
Conversation
9 tasks
devbase list の対話 TUI を commands/project.py から lib/devbase/tui/ パッケージへ 分離し、全カテゴリを束ねるトップ階層メニューの入口を新設する (PLAN31_2 PR1)。 - tui/menu.py: questionary ラッパ・MENU_BACK 番兵・Esc/← バインド・引数収集 ヘルパ (text/confirm/integer/path, input フォールバック) - tui/dispatch.py: dispatch_lifecycle / dispatch_group (旧 _start_project_action を一般化、PR3〜5 の group 委譲も先行整備) - tui/actions_project.py: 既存 project up/down/rebuild の非回帰移送 (一覧選択→ running はサブメニュー→他は直接 up、番号入力フォールバック) - tui/app.py: トップ階層メニュー (project/env/plugin/snapshot/status)。 「プロジェクト操作」を先頭・既定ハイライトで従来フローへ Enter 連打到達 (3.2)。 env 以降は後続 PR 用プレースホルダ (_route に1行追加で配線) - commands/project.py: listing/整形の純粋ロジックへ縮約、cmd_project_list は tui.run への薄い委譲に置換 後方互換: --plain/非TTY→table、questionary 不在→従来の番号入力フォールバックへ縮退。 テスト: TUI エンジン系を tests/cli/tui/ へ移設・拡充。全 pytest 510 passed/1 skipped。 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
takemi-ohama
commented
Jun 10, 2026
takemi-ohama
left a comment
Contributor
Author
There was a problem hiding this comment.
🤖 cross-review | round 1 | gemini | APPROVE
TUI機能の分離とトップメニュー化の土台として、既存のCLI互換性を保ちつつ綺麗に整理されています。1点だけ、堅牢性の観点から入力関数の再帰呼び出しについてインラインでコメントを残しました。
takemi-ohama
commented
Jun 10, 2026
takemi-ohama
left a comment
Contributor
Author
There was a problem hiding this comment.
🤖 cross-review | round 1 | codex | REQUEST_CHANGES
対話 TUI 経路の戻り値契約と入力ヘルパのキャンセル規約に修正が必要です。
cross-review round1 の 3 件を修正: 1. [major] actions_project.run() が dispatch_lifecycle の戻り値を捨てており project up/down/rebuild 失敗時も devbase list の終了コードが常に 0 になる問題を 修正。run() は操作実行時に rc(int) を返すプロトコルへ拡張し、app._top_menu_loop が last_rc を記憶して終了コードへ伝搬する (判定は is 同一性で rc=0 を誤マッチさせない)。 2. [minor] menu.text() / menu.path() の allow_empty=False 空入力時の自己再帰呼び出しを while ループへ変更し RecursionError リスクを除去。 3. [minor] questionary 経路の text/confirm/path に Esc→中止 (None) バインドが無く docstring/select のナビ規約と不整合だったため _ask_with_escape ヘルパで with_escape_cancel を適用。 テスト追従: rc 伝搬・非0 rc 伝搬・Esc バインド登録・while 再入力ループの検証を追加 (510 passed → 520 passed / 1 skipped)。 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Contributor
Author
cross-review round1 対応サマリcommit:
対応内容
テスト
3 thread すべて reply + resolve 済み。 |
takemi-ohama
commented
Jun 10, 2026
takemi-ohama
left a comment
Contributor
Author
There was a problem hiding this comment.
🤖 cross-review | round 2 | gemini | APPROVE
前回の指摘箇所(再帰呼び出しの回避)が修正されていることを確認しました。追加の修正提案はありません。
takemi-ohama
commented
Jun 10, 2026
takemi-ohama
left a comment
Contributor
Author
There was a problem hiding this comment.
🤖 cross-review | round 2 | codex | APPROVE
追加の修正必須指摘はありません。
takemi-ohama
added a commit
that referenced
this pull request
Jun 10, 2026
PR1 を cross-review approved → release へ merge (50ab9c2) 済みに更新し、 後続 PR (project/env/plugin/snapshot/status) が tui 土台へ配線する手順 (_route 1 行追加・menu 引数収集・dispatch_group・confirm/chdir) を申し送りとして追記。 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This was referenced Jun 11, 2026
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.
Summary
issues/PLAN31_2_list-tui-unified.mdTest plan