NS10 slice: Cover raw input, cursor movement, and mode switches in E2E #71

Closed
opened 2026-06-21 14:50:34 +00:00 by tmk241 · 3 comments
Owner

OBJECTIVE: Add browser-terminal E2E scenarios that prove raw input and mode behavior visually and semantically: Esc, Space leader, Esc mobile/attached escape, arrows/Home/End/Page, digit counts, % match jump, insert/normal/select/panel transitions, and cursor movement.

AUTHORITY: Parent #65; KEYMAP.md modal grammar; REQUIREMENTS.md 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; comment/update parent #65.
  • Handoff state: committed clean, tracker commented/closed.

PARENT: #65 NS10 via explicit parent link and parent checklist.

SCOPE: terminal-e2e scenarios and assertions for input/mode/cursor behavior; fixtures only as needed.

BOUNDARIES:

  • Do not change KEYMAP.md behavior except to fix mismatches found by tests.
  • Do not rely only on headless Client tests; this slice must exercise the browser terminal harness.
  • No native iOS automation.

REGRESSION CLASS: catches raw-input and modal regressions: Esc echoing as ^[, Space leader ignored, Esc mobile escape broken, cursor movement drift, and attached-key aliases diverging from mobile paths.

EVIDENCE ARTIFACTS: browser screenshots before/after mode transitions, semantic transcript with visible controls, final buffer/cursor/mode assertions, and input event log.

REQUIREMENT IMPACT: protects existing input/session/testing requirement authority; update authority if new modal-key invariants become durable requirements not already covered by KEYMAP.md/REQUIREMENTS.md.

ACCEPTANCE:

  • E2E catches the exact historical failure where Esc is echoed as ^[ instead of switching mode.
  • E2E catches the exact historical failure where typed spaces disappear/corrupt text while in insert mode.
  • Scenarios prove insert -> normal via Esc (the durable mobile/attached SSH path; Insert-mode Space remains literal), normal Space leader, select mode entry/exit, panel focus, and cursor marker movement.
  • Scenarios cover attached-key aliases: arrows, Home/End, PageUp/PageDown, direct digit count, and %.
  • Semantic artifacts assert final buffer/cursor/mode; screenshots assert visible cursor/chrome is present and not skewed.

VERIFICATION:

  • zig build terminal-e2e
  • zig build test
  • zig build v1-smoke
  • redgate lint /opt/repositories/mim/REQUIREMENTS.md && redgate health /opt/repositories/mim/REQUIREMENTS.md

BLOCKERS: depends on terminal harness #69 and matrix runner #66 enough to add scenarios.

SLICE_CONTRACT:
objective: Add E2E coverage for raw keys, cursor movement, and mode switches.
authority: #65, KEYMAP.md, REQUIREMENTS.md input/testing rows.
acceptance: browser-terminal tests fail on Esc echo, broken spaces, broken leader, cursor/mode regressions, and key alias regressions.
verification: terminal-e2e plus canonical gates.
non_goals: native iOS automation, keymap redesign.
blockers: terminal harness exists.

OBJECTIVE: Add browser-terminal E2E scenarios that prove raw input and mode behavior visually and semantically: Esc, Space leader, Esc mobile/attached escape, arrows/Home/End/Page, digit counts, `%` match jump, insert/normal/select/panel transitions, and cursor movement. AUTHORITY: Parent #65; KEYMAP.md modal grammar; REQUIREMENTS.md 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; comment/update parent #65. - Handoff state: committed clean, tracker commented/closed. PARENT: #65 NS10 via explicit parent link and parent checklist. SCOPE: terminal-e2e scenarios and assertions for input/mode/cursor behavior; fixtures only as needed. BOUNDARIES: - Do not change KEYMAP.md behavior except to fix mismatches found by tests. - Do not rely only on headless `Client` tests; this slice must exercise the browser terminal harness. - No native iOS automation. REGRESSION CLASS: catches raw-input and modal regressions: Esc echoing as `^[`, Space leader ignored, Esc mobile escape broken, cursor movement drift, and attached-key aliases diverging from mobile paths. EVIDENCE ARTIFACTS: browser screenshots before/after mode transitions, semantic transcript with visible controls, final buffer/cursor/mode assertions, and input event log. REQUIREMENT IMPACT: protects existing input/session/testing requirement authority; update authority if new modal-key invariants become durable requirements not already covered by KEYMAP.md/REQUIREMENTS.md. ACCEPTANCE: - E2E catches the exact historical failure where Esc is echoed as `^[` instead of switching mode. - E2E catches the exact historical failure where typed spaces disappear/corrupt text while in insert mode. - Scenarios prove insert -> normal via Esc (the durable mobile/attached SSH path; Insert-mode Space remains literal), normal Space leader, select mode entry/exit, panel focus, and cursor marker movement. - Scenarios cover attached-key aliases: arrows, Home/End, PageUp/PageDown, direct digit count, and `%`. - Semantic artifacts assert final buffer/cursor/mode; screenshots assert visible cursor/chrome is present and not skewed. VERIFICATION: - `zig build terminal-e2e` - `zig build test` - `zig build v1-smoke` - `redgate lint /opt/repositories/mim/REQUIREMENTS.md && redgate health /opt/repositories/mim/REQUIREMENTS.md` BLOCKERS: depends on terminal harness #69 and matrix runner #66 enough to add scenarios. SLICE_CONTRACT: objective: Add E2E coverage for raw keys, cursor movement, and mode switches. authority: #65, KEYMAP.md, REQUIREMENTS.md input/testing rows. acceptance: browser-terminal tests fail on Esc echo, broken spaces, broken leader, cursor/mode regressions, and key alias regressions. verification: terminal-e2e plus canonical gates. non_goals: native iOS automation, keymap redesign. blockers: terminal harness exists.
tmk241 added the slice label 2026-06-21 14:50:34 +00:00
Author
Owner

Progress committed in 9aafe0e (Fix terminal input mode and cursor rendering).

What changed:

  • mim now starts in Normal mode; Insert is explicit (i/commands).
  • Insert-mode Space inserts a literal space immediately; Normal-mode Space opens the leader rail. Requirement input/002 and KEYMAP docs updated accordingly.
  • Standalone Esc is disambiguated from CSI without consuming the following key; attached-key arrows/Home/End keep working.
  • Dirty buffers now have a reachable discard quit path: Space Q (Shift+Q is iOS-reachable); regular Space q remains protected.
  • Cursor rendering no longer inserts/squeezes a glyph into text. Cursor and selections are rendered as cell background attributes; E2E artifacts derive debug markers (, ) from ANSI color evidence and SVG screenshots include color swatches.
  • Terminal E2E matrix added scenarios for normal-start explicit insert, iOS Shift-letter path, Esc mode switch, cursor-left insertion semantics, and dirty discard quit.

Verification:

  • zig build terminal-e2e
  • zig build test
  • zig build
  • zig build v1-smoke
  • redgate list /opt/repositories/mim/REQUIREMENTS.md && redgate lint /opt/repositories/mim/REQUIREMENTS.md && redgate health /opt/repositories/mim/REQUIREMENTS.md

Not closing #71 yet: remaining acceptance still needs browser-terminal coverage for select mode entry/exit, PageUp/PageDown, digit counts, and % match jump.

Progress committed in `9aafe0e` (`Fix terminal input mode and cursor rendering`). What changed: - `mim` now starts in Normal mode; Insert is explicit (`i`/commands). - Insert-mode Space inserts a literal space immediately; Normal-mode Space opens the leader rail. Requirement `input/002` and KEYMAP docs updated accordingly. - Standalone Esc is disambiguated from CSI without consuming the following key; attached-key arrows/Home/End keep working. - Dirty buffers now have a reachable discard quit path: `Space Q` (Shift+Q is iOS-reachable); regular `Space q` remains protected. - Cursor rendering no longer inserts/squeezes a `▌` glyph into text. Cursor and selections are rendered as cell background attributes; E2E artifacts derive debug markers (`☻`, `░`) from ANSI color evidence and SVG screenshots include color swatches. - Terminal E2E matrix added scenarios for normal-start explicit insert, iOS Shift-letter path, Esc mode switch, cursor-left insertion semantics, and dirty discard quit. Verification: - `zig build terminal-e2e` ✅ - `zig build test` ✅ - `zig build` ✅ - `zig build v1-smoke` ✅ - `redgate list /opt/repositories/mim/REQUIREMENTS.md && redgate lint /opt/repositories/mim/REQUIREMENTS.md && redgate health /opt/repositories/mim/REQUIREMENTS.md` ✅ Not closing #71 yet: remaining acceptance still needs browser-terminal coverage for select mode entry/exit, PageUp/PageDown, digit counts, and `%` match jump.
Author
Owner

Progress committed in 0d4d0ec (Expand terminal input E2E coverage).

Covered in the browser-terminal matrix now:

  • attached Esc mode switch and full CSI reader for multi-byte sequences (PageUp/PageDown now reach input parsing);
  • attached Home/End/arrows, cursor-left insertion, direct digit count (3l), % match jump;
  • select mode entry/exit with selection color artifact (attr:selection/ from ANSI evidence);
  • panel focus/directory scenario;
  • normal-mode Space leader from iOS-default reachable keys;
  • dirty discard via Space Q;
  • Normal A appends at EOL, Insert Enter inserts newline with current indent, and Tab follows tab-indented buffers.

Verification on committed tree before commit:

  • zig build terminal-e2e
  • zig build test
  • zig build
  • zig build v1-smoke
  • redgate list /opt/repositories/mim/REQUIREMENTS.md && redgate lint /opt/repositories/mim/REQUIREMENTS.md && redgate health /opt/repositories/mim/REQUIREMENTS.md

Not closing yet: this issue acceptance still explicitly says Space-n mobile escape, but current source/requirements now intentionally make Insert-mode Space literal immediately. We still need a durable mobile-safe Insert->Normal path that does not use hold timing and does not corrupt ordinary typing, or the #71 acceptance should be revised to match the new product rule.

Progress committed in `0d4d0ec` (`Expand terminal input E2E coverage`). Covered in the browser-terminal matrix now: - attached Esc mode switch and full CSI reader for multi-byte sequences (`PageUp`/`PageDown` now reach input parsing); - attached Home/End/arrows, cursor-left insertion, direct digit count (`3l`), `%` match jump; - select mode entry/exit with selection color artifact (`attr:selection`/`░` from ANSI evidence); - panel focus/directory scenario; - normal-mode Space leader from iOS-default reachable keys; - dirty discard via `Space Q`; - Normal `A` appends at EOL, Insert Enter inserts newline with current indent, and Tab follows tab-indented buffers. Verification on committed tree before commit: - `zig build terminal-e2e` ✅ - `zig build test` ✅ - `zig build` ✅ - `zig build v1-smoke` ✅ - `redgate list /opt/repositories/mim/REQUIREMENTS.md && redgate lint /opt/repositories/mim/REQUIREMENTS.md && redgate health /opt/repositories/mim/REQUIREMENTS.md` ✅ Not closing yet: this issue acceptance still explicitly says `Space-n` mobile escape, but current source/requirements now intentionally make Insert-mode Space literal immediately. We still need a durable mobile-safe Insert->Normal path that does not use hold timing and does not corrupt ordinary typing, or the #71 acceptance should be revised to match the new product rule.
Author
Owner

Closing receipt for #71.

Acceptance note: the original Space-n mobile escape text is superseded by the current product/keymap rule from this build: Insert-mode Space is always literal, and mobile SSH clients commonly expose Esc/Ctrl, so Esc is the durable mobile/attached Insert→Normal path. The issue body has been updated accordingly to avoid reintroducing a Space-prefix ambiguity that corrupts ordinary Insert-mode spaces.

Browser-terminal E2E coverage now includes:

  • Esc Insert→Normal without echoing ^[;
  • Insert-mode spaces preserved in saved text;
  • Normal Space leader paths, including save/quit and dirty discard;
  • cursor movement with marker evidence, including arrows, Home/End, PageUp/PageDown, digit counts, %, ragged vertical preferred-column motion, and horizontal cursor scroll;
  • select mode entry/exit and selection color artifact evidence;
  • panel focus/directory workflow;
  • semantic transcripts, visible-control artifacts, screenshots/SVG, and keystroke receipts.

Verification on clean tree 2277ed2:

  • zig build terminal-e2e
  • zig build test

Recent broader gates also passed in this build stream:

  • zig build
  • zig build run -- --help
  • redgate lint /opt/repositories/mim/REQUIREMENTS.md && redgate health /opt/repositories/mim/REQUIREMENTS.md
Closing receipt for #71. Acceptance note: the original `Space-n` mobile escape text is superseded by the current product/keymap rule from this build: Insert-mode Space is always literal, and mobile SSH clients commonly expose Esc/Ctrl, so Esc is the durable mobile/attached Insert→Normal path. The issue body has been updated accordingly to avoid reintroducing a Space-prefix ambiguity that corrupts ordinary Insert-mode spaces. Browser-terminal E2E coverage now includes: - Esc Insert→Normal without echoing `^[`; - Insert-mode spaces preserved in saved text; - Normal Space leader paths, including save/quit and dirty discard; - cursor movement with marker evidence, including arrows, Home/End, PageUp/PageDown, digit counts, `%`, ragged vertical preferred-column motion, and horizontal cursor scroll; - select mode entry/exit and selection color artifact evidence; - panel focus/directory workflow; - semantic transcripts, visible-control artifacts, screenshots/SVG, and keystroke receipts. Verification on clean tree `2277ed2`: - `zig build terminal-e2e` ✅ - `zig build test` ✅ Recent broader gates also passed in this build stream: - `zig build` ✅ - `zig build run -- --help` ✅ - `redgate lint /opt/repositories/mim/REQUIREMENTS.md && redgate health /opt/repositories/mim/REQUIREMENTS.md` ✅
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: tmk241/mim#71