feat(keybindings): add resolved action-based keymap#166
Merged
Conversation
- Add canonical key specs, action descriptors, contexts, and conflict-validated defaults - Route chat input, autocomplete, permission, question, and runtime key handling through semantic actions - Implement readline-style editing, Ctrl+C clear-or-quit, prompt arrow/Enter controls, and Unix suspend - Generate shortcut help from the resolved keymap instead of duplicated static rows - Cover key parsing, resolution, prompt behavior, runtime actions, and generated help with tests
- Remove obsolete raw permission and question key adapters - Drop unimplemented keymap placeholder actions and contexts - Remove unused release-to-child runtime command path - Keep tests focused on the production keymap executor path
- Add explicit bounded/unbounded tool body height policy - Render .claude/plans/* markdown bodies without the generic tool height cap - Keep normal write diffs capped to avoid flooding tool output - Add regression tests for long plan rendering and non-plan diff capping
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
add a resolved action-based keymap layer for chat input, autocomplete, and inline prompts, then route the existing interaction handlers through that shared action model.
Keymap architecture
src/app/keymapwith typed key specs, key contexts, action descriptors, default binding groups, platform validation, and conflict detectionInteraction handling
Tool rendering
.claude/plans/*markdown plan bodies render at their full wrapped height instead of inheriting the generic tool body capWhy
Key handling had accumulated separate hardcoded paths across chat input, autocomplete, permissions, plan approvals, and questions. That made shortcut behavior harder to reason about, duplicated help text, and left stale raw-key adapters in place after the inline prompt work moved toward action-based dispatch.
This branch puts key behavior behind a typed resolved keymap so defaults can be validated once, dispatch can ask for an action by context, and help text can describe the same bindings the runtime actually uses. That is the stable base for future configurable keybindings without keeping parallel shortcut implementations alive.
The plan rendering fix addresses a related planning workflow issue: generated
.claude/plans/*files are review artifacts, not ordinary noisy tool output. They should render as complete markdown while the generic cap remains in place for normal tool bodies and diffs.Closes #140
Validation
cargo fmt --all -- --checkcargo check --offlinecargo clippy --all-targets --all-features -- -D warningscargo testcargo test tool_call::tests::Notes