NS8 slice: Implement the modal input engine and command rails #45

Closed
opened 2026-06-21 09:12:12 +00:00 by tmk241 · 1 comment
Owner

OBJECTIVE: Make Normal, Insert, Select, Panel, and Prompt modes real session state with discoverable Space/m/g rails and mobile-safe paths for core actions.

AUTHORITY: Parent #43; KEYMAP.md sections Modes, Leader keys and rails, Counts and repetition; req: input/001-007, session/004, testing/001-004.

AGENT AUTHORITY:

  • Delivery authority: local-commit
  • Tracker authority: this issue may be commented and closed when acceptance passes; parent #43 may be commented/checklisted.
  • Handoff state: committed clean, tracker commented/closed.

PARENT: #43 via explicit issue link and parent checklist.

SCOPE: Input normalization, modal state machine, pending-key/prefix state, Space leader pause behavior, Insert pending-space rail, contextual help/rail rendering, replay fixtures. Likely files: src/input.zig, src/leader.zig, src/session.zig, src/tui.zig, replay/tests.

BOUNDARIES: Do not implement every operation behind every rail; unmapped rail entries may return clear not implemented diagnostics. Do not require Esc/Ctrl/Alt/function keys for core mode transitions.

ACCEPTANCE:

  • Normal/Insert/Select/Panel/Prompt are explicit states in protocol/headless tests.
  • Space pause opens the visible command rail in Normal/Select/Panel contexts.
  • Insert mode preserves ordinary spaces while supporting the KEYMAP.md pending-space rail; Space pause then n returns to Normal; Space pause then Space inserts a literal space.
  • m and g prefixes show valid next-key rails without executing hidden behavior.
  • Space Space restores the last rail/panel context.
  • Counts/repetition pending state is represented and visible even if only a first repeatable movement is wired in this slice.
  • Unknown or incomplete prefix sequences recover predictably with a visible diagnostic and no mode corruption.

VERIFICATION:

  • zig build test
  • Replay/headless tests for Normal→Insert→Normal, literal Insert spaces, Space rail, m/g rails, Space Space recovery, unknown prefix recovery, and count pending/clear behavior.
  • zig build v1-smoke

BLOCKERS: none.

OBJECTIVE: Make Normal, Insert, Select, Panel, and Prompt modes real session state with discoverable Space/m/g rails and mobile-safe paths for core actions. AUTHORITY: Parent #43; KEYMAP.md sections `Modes`, `Leader keys and rails`, `Counts and repetition`; req: input/001-007, session/004, testing/001-004. AGENT AUTHORITY: - Delivery authority: local-commit - Tracker authority: this issue may be commented and closed when acceptance passes; parent #43 may be commented/checklisted. - Handoff state: committed clean, tracker commented/closed. PARENT: #43 via explicit issue link and parent checklist. SCOPE: Input normalization, modal state machine, pending-key/prefix state, Space leader pause behavior, Insert pending-space rail, contextual help/rail rendering, replay fixtures. Likely files: `src/input.zig`, `src/leader.zig`, `src/session.zig`, `src/tui.zig`, replay/tests. BOUNDARIES: Do not implement every operation behind every rail; unmapped rail entries may return clear `not implemented` diagnostics. Do not require Esc/Ctrl/Alt/function keys for core mode transitions. ACCEPTANCE: - Normal/Insert/Select/Panel/Prompt are explicit states in protocol/headless tests. - Space pause opens the visible command rail in Normal/Select/Panel contexts. - Insert mode preserves ordinary spaces while supporting the KEYMAP.md pending-space rail; `Space` pause then `n` returns to Normal; `Space` pause then `Space` inserts a literal space. - `m` and `g` prefixes show valid next-key rails without executing hidden behavior. - `Space Space` restores the last rail/panel context. - Counts/repetition pending state is represented and visible even if only a first repeatable movement is wired in this slice. - Unknown or incomplete prefix sequences recover predictably with a visible diagnostic and no mode corruption. VERIFICATION: - `zig build test` - Replay/headless tests for Normal→Insert→Normal, literal Insert spaces, Space rail, m/g rails, Space Space recovery, unknown prefix recovery, and count pending/clear behavior. - `zig build v1-smoke` BLOCKERS: none.
tmk241 added the sliceready-for-agentgoal labels 2026-06-21 09:12:12 +00:00
Author
Owner

Completed in commit 1468675 (Add modal input state and rails).

What changed:

  • Added explicit TUI client modes: Normal, Insert, Select, Panel, and Prompt.
  • Added visible mode/status rendering and modal input dispatch.
  • Added Insert pending-space rail: Space opens the rail, n returns to Normal, Space inserts a literal space, and ordinary text commits space + text.
  • Added m, g, and repeat rails with visible status/recovery, plus Space Space restore of the last rail.
  • Added pending count state and visible count status; count is consumed by repeatable left/right movement and safely cleared by unsupported movement diagnostics.
  • Updated mobile acceptance traces to enter Insert explicitly and return to Normal before leader commands.
  • Kept incomplete operations visible as diagnostics rather than pretending full object/navigation implementation is done.

Verification:

  • zig fmt src/tui.zig src/leader.zig src/main.zig src/mobile_acceptance.zig && zig build test
  • zig build
  • zig build v1-smoke
  • zig build run -- --help
  • zig build run -- src/main.zig
  • redgate lint /opt/repositories/mim/REQUIREMENTS.md && redgate health /opt/repositories/mim/REQUIREMENTS.md

Notes:

  • Object behavior, complete vertical movement/list movement, and full core editing remain in later NS8 slices (#46/#47/#49), as scoped.
Completed in commit 1468675 (`Add modal input state and rails`). What changed: - Added explicit TUI client modes: Normal, Insert, Select, Panel, and Prompt. - Added visible mode/status rendering and modal input dispatch. - Added Insert pending-space rail: `Space` opens the rail, `n` returns to Normal, `Space` inserts a literal space, and ordinary text commits `space + text`. - Added `m`, `g`, and repeat rails with visible status/recovery, plus `Space Space` restore of the last rail. - Added pending count state and visible count status; count is consumed by repeatable left/right movement and safely cleared by unsupported movement diagnostics. - Updated mobile acceptance traces to enter Insert explicitly and return to Normal before leader commands. - Kept incomplete operations visible as diagnostics rather than pretending full object/navigation implementation is done. Verification: - `zig fmt src/tui.zig src/leader.zig src/main.zig src/mobile_acceptance.zig && zig build test` - `zig build` - `zig build v1-smoke` - `zig build run -- --help` - `zig build run -- src/main.zig` - `redgate lint /opt/repositories/mim/REQUIREMENTS.md && redgate health /opt/repositories/mim/REQUIREMENTS.md` Notes: - Object behavior, complete vertical movement/list movement, and full core editing remain in later NS8 slices (#46/#47/#49), as scoped.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: tmk241/mim#45