mirror of
https://github.com/openai/codex.git
synced 2026-09-09 15:58:47 +00:00
Apply the pinned Prettier layout to the keymap handoff and rollout notes so the root `pnpm run format` check accepts the documentation.
2.9 KiB
2.9 KiB
TUI Keymap Additive Rollout Plan
This plan restructures the existing keymap implementation into a reviewable
additive stack while preserving the final behavior from revision 0f03e76c.
Goals
- Keep the final behavior effectively identical to
0f03e76c. - Reorder history to show intent and risk reduction clearly.
- Make each change compile, format cleanly, and pass scoped tests.
- Establish high-confidence behavior characterization before binding rewrites.
Commit Sequence
-
Docs and specification foundation
- Add/reshape long-term docs that explain how the keymap system works.
- Include:
- conceptual model
- action matrix
- default keymap template guidance with explicit URL
- testing strategy notes
- No functional code change.
-
Additive config primitives (not wired)
- Introduce keymap config types and schema support in
core. - Keep runtime behavior unchanged by not consuming these config values yet.
- Ensure parsing/serialization paths are complete and documented.
- Introduce keymap config types and schema support in
-
Behavior characterization tests (pre-rewrite)
- Add tests that lock down existing event behavior before switching bindings.
- Cover key event matching and context-sensitive behaviors that must stay stable.
- Use these tests as the safety net for subsequent rewiring.
- Run
cargo llvm-covand target full branch coverage for keybinding logic.
-
Binding replacement using characterized behavior
- Introduce keymap-driven binding resolution and wire call sites.
- Replace legacy binding checks while preserving characterized behavior.
- Keep docs in sync with any semantics that became explicit.
-
UX polish and affordances
- Apply help/footer/tooltip/key-hint refinements once behavior is stable.
- Keep affordance text concise and formatted for readability.
- Update snapshots as needed.
Validation Gates Per Commit
For each commit in the sequence:
- Run formatting (
just fmtincodex-rs). - Run scoped tests for affected crates (minimum
cargo test -p codex-tuifor TUI changes and relevantcoretests whencorechanges). - Ensure branch compiles cleanly (
cargo testpath used as compile gate). - For characterization and binding commits, run coverage and track branch
coverage for keybinding logic (
cargo llvm-cov).
JJ Workflow
- Build stack from
trunk()with explicit ordered changes. - Use
jj new -A/jj new -Bto place changes relative to target revisions. - Rebase existing implementation changes into the new stack as needed.
- Resolve conflicts immediately and keep each change coherent.
- Use clear
jj describemessages with title + explanatory body.
Acceptance Criteria
- Final tip behavior matches
0f03e76cin practice. - Stack reads top-to-bottom as: docs -> config -> characterization -> rewiring -> UX polish.
- Each commit is independently reviewable with passing checks.