feat: ?でキーバインド一覧(ヘルプ)を表示 (closes #9)#17
Conversation
issue #9 対応。? を押すと中央モーダルでキーバインド一覧を表示し、 任意キー/Escで閉じる。? に割り当てられていた後方検索は廃止し、 前方検索(/)とn/Nの双方向巡回は維持する。 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
📝 WalkthroughWalkthrough
Changesキーバインドヘルプモーダル追加
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
internal/ui/model.go (1)
44-57: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick winプレビュー中の
?でもヘルプを開けるようにしてください
handleKey()ではpreviewFocusedがhandleNormalKey()より先に処理されるため、プレビュー中は?がhandlePreviewKey()に吸われます。handlePreviewKey()側に?の分岐がないと、この状態からヘルプを開けません。🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@internal/ui/model.go` around lines 44 - 57, `handleKey()` routes preview focus before normal key handling, so `?` is currently swallowed by `handlePreviewKey()` and cannot open help while preview is focused. Update `handlePreviewKey()` in App to recognize `?` and delegate to the same help-opening path used elsewhere (or route it to `handleHelpKey()`), ensuring the preview state still allows help access without changing the existing input-mode ordering.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Outside diff comments:
In `@internal/ui/model.go`:
- Around line 44-57: `handleKey()` routes preview focus before normal key
handling, so `?` is currently swallowed by `handlePreviewKey()` and cannot open
help while preview is focused. Update `handlePreviewKey()` in App to recognize
`?` and delegate to the same help-opening path used elsewhere (or route it to
`handleHelpKey()`), ensuring the preview state still allows help access without
changing the existing input-mode ordering.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 6e40a3f9-4085-414a-84b3-f7abcb3aa49f
📒 Files selected for processing (9)
.claude/plans/plan.mdREADME.mdREADME_ja.mdinternal/ui/help.gointernal/ui/keybinding.gointernal/ui/layout.gointernal/ui/model.gointernal/ui/model_test.gointernal/ui/render.go
概要
issue #9 の対応です。
?を押すとキーバインド一覧(ヘルプ)を中央モーダルで表示できるようにしました。変更点
?でキーバインド一覧を中央モーダル表示(任意キー /Esc/qで閉じる)help.goのhelpEntries()に定義し、renderHelpModal()で描画[?]Helpを追記、README(日英)にも記載?に割り当てられていた後方検索を廃止/とn/Nの双方向巡回は維持しているため検索機能自体は利用可能テスト
?でヘルプ表示 / 任意キーで閉じる / ヘルプ表示中にカーソルが動かない / render にキー一覧を含む、のユニットテストを追加Closes #9
🤖 Generated with Claude Code
Summary by CodeRabbit
New Features
?でキーバインド一覧のヘルプを中央モーダル表示できるようになりました。Esc、qで閉じられます。Bug Fixes
?の動作が後方検索ではなくヘルプ表示に変更されました。Documentation