feat(list): devbase list の対話選択を simple-term-menu で TUI 化 (i29)#42
Merged
Conversation
takemi-ohama
commented
Jun 7, 2026
takemi-ohama
left a comment
Contributor
Author
There was a problem hiding this comment.
🤖 cross-review | round 1 | codex | REQUEST_CHANGES
ANSI 色付き menu entry による TUI 表示幅崩れは修正してください。
takemi-ohama
commented
Jun 7, 2026
takemi-ohama
left a comment
Contributor
Author
There was a problem hiding this comment.
🤖 cross-review | round 1 | gemini | APPROVE
The implementation correctly introduces the TUI interactive project selector using simple-term-menu according to the plan. I have reviewed the code and everything looks solid. No further changes required.
- _STATUS_COLOR を False に: menu entry に ANSI を埋め込むと simple_term_menu の wcswidth() が -1 を返し表示幅計算/ハイライト消去が 崩れるため、実機検証まで色付けを無効化 (機能 > 装飾) - _build_menu_entries: ショートカット無し行 (10件目以降) の手動 4 スペース 字下げを除去。simple_term_menu はショートカット定義時に全行へ 4 文字 ガターを自前描画するため、二重インデントになっていた - test: 上記に合わせて 10件目の期待値を body 先頭 (字下げ無し) に更新 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Contributor
Author
🛠 cross-review fix | round 1 | 対応サマリcodex (REQUEST_CHANGES) の 2 件をコードを読んで再判定のうえ、いずれも妥当と確認し修正しました。gemini は APPROVE (指摘 0)。 対応コミット: 41de921
両スレッドへ個別 reply 済み・Resolve 済みです。再レビューをお願いします。 |
takemi-ohama
commented
Jun 7, 2026
takemi-ohama
left a comment
Contributor
Author
There was a problem hiding this comment.
🤖 cross-review | round 2 | gemini | APPROVE
設計・実装ともに要件を過不足なく満たしており、TUI導入時のエッジケース(ANSI表示幅の不具合回避や、自動ガター付与時の二重インデント防止)にも適切に対応されています。未対応環境へのフォールバック等も堅牢で問題ありません。
takemi-ohama
commented
Jun 7, 2026
takemi-ohama
left a comment
Contributor
Author
There was a problem hiding this comment.
🤖 cross-review | round 2 | codex | APPROVE
修正必須の追加指摘はありません。
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.
概要
devbase list(TTY 時の対話選択)をsimple-term-menuベースの TUI 化し、矢印キー移動・[1-9]番号ジャンプ・/インクリメンタル検索で起動プロジェクトを選べるようにします。設計書issues/i29_list-tui-simple-term-menu.md/ 実装プランissues/i29_list-tui-plan.mdに基づきます。変更は
lib/devbase/commands/project.pyの対話選択ロジックに限定し、非 TTY 判定(cmd_project_listの isatty ガード)と一覧テーブル出力は現状維持です。simple_term_menu未導入環境では従来の番号入力方式へフォールバックします。関連 Issue
issues/i29_list-tui-simple-term-menu.md、PR docs(issues): devbase list TUI化 設計書(i29) + issues/ を git 追跡対象化 #41 でマージ済み)変更点
simple-term-menu>=1.6(Unix 専用の任意依存。pyproject.toml/uv.lock)lib/devbase/commands/project.py):_build_menu_entries/_color_status: rows → メニュー表示文字列生成。先頭 9 件に[1-9]ショートカット付与、STATUS の色付け(running=緑 / stopped=灰、_STATUS_COLORで無効化可)_show_menu/_tui_select_and_up/_start_project_up: TerminalMenu 起動とproject up委譲_interactive_select_and_up:_HAVE_TERMINAL_MENUの import 可否で TUI / 番号入力を分岐するディスパッチャに変更(旧本体は_fallback_select_and_upへ改名・温存)tests/cli/test_project_list.py): TUI 経路・中止・fallback のテストを追加。既存 input ベース 6 件は_HAVE_TERMINAL_MENU=False固定で fallback テストとして成立化動作確認
uv run pytest tests/cli/test_project_list.py -q→ 40 passed(既存 34 + 新規 6)uv run pytest -q→ 439 passed, 1 skippeduv run python -m compileall -q lib bin→ エラーなしuvx ruff check --select=E9,F63,F7,F82 lib→ All checks passed./bin/devbase listで ↑↓ 移動(端で循環)/1-9ジャンプ //検索 / Enter 起動 / Esc 中止 / STATUS 色で桁ずれ・検索崩れがないこと./bin/devbase list | catがプレーンテーブルを出すこと補足
_STATUS_COLOR = Falseでプレーン表示にデグレード可能