Skip to content

feat(mobile): terminal UI, ANSI stream buffer, accessory keys, and history (F005) - #6

Merged
nimat-dev merged 2 commits into
mainfrom
feat/F005
Oct 8, 2026
Merged

nimat-dev merged 2 commits into
mainfrom
feat/F005

Conversation

@nimat-dev

Copy link
Copy Markdown
Owner

F005: Mobile Terminal UI (emulator, accessory keys, scrollback, history)

Summary

Implements Phase 02 feature F005 (Mobile terminal UI):

  • Recorded ADR-0002 evaluating Native React Native ANSI Stream Buffer (TerminalBuffer) vs xterm.js in WebView, choosing Native RN ANSI buffer for zero input latency, native accessory key integration, and pure-TypeScript unit-testability without native webview binary overhead.
  • Implemented pure TypeScript TerminalBuffer (src/terminal/buffer.ts) handling ANSI 16/256/truecolor parsing, SGR styles, carriage returns (\r), backspaces (\b), line clear sequences, OSC sequence stripping, and a 2000-line scrollback buffer.
  • Added terminal client streaming methods (openTerminal, sendTerminalInput, resizeTerminal, onTerminalData, onTerminalExit) to AgentClient.
  • Implemented React Native components:
    • AccessoryBar.tsx: Mobile keyboard accessory row (Ctrl, Esc, Tab, ↑, ↓, ←, →, |, /, -, ~, Hist) with active Ctrl combo modifier handling.
    • HistoryModal.tsx: Command history list modal with tap-to-rerun.
    • TerminalScreen.tsx: Monospace terminal display, autoscrolling on output, responsive layout resize measurement, and offline banner.
    • StatusScreen.tsx: Added quick switch button to terminal.
    • App.tsx: Tab navigation between Terminal (default when paired) and Status views.
  • Added unit tests in src/terminal/buffer.test.ts (8/8 passing).
  • Added end-to-end integration test in src/mobile.test.ts driving live WebSocket connection and streaming lifecycle.
  • Created Maestro E2E flow specification at .maestro/terminal_flow.yaml.

Verification

  • pnpm typecheck: 0 errors.
  • pnpm lint: 0 errors, 0 warnings.
  • pnpm test: 49/49 tests passing across all packages (18 protocol, 10 agent, 21 mobile).
  • scripts/check-architecture.sh: 0 dependency violations (pure core and layer boundaries clean).
  • scripts/init.sh: clean baseline verified.

Checklist

  • ADR-0002 recorded and indexed in DECISIONS.md
  • Zero external native binary webview dependencies added
  • Architecture boundary verified via dependency-cruiser
  • Evidence captured under .harness/evidence/F005/

@nimat-dev
nimat-dev merged commit 1ba94c2 into main Oct 8, 2026
2 checks passed
@nimat-dev
nimat-dev deleted the feat/F005 branch October 8, 2026 03:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant