Skip to content

feat(mobile): add opt-in terminal controls - #185

Draft
Lint111 wants to merge 1 commit into
Ark0N:masterfrom
Lint111:agent/split-mobile-terminal-controls
Draft

feat(mobile): add opt-in terminal controls#185
Lint111 wants to merge 1 commit into
Ark0N:masterfrom
Lint111:agent/split-mobile-terminal-controls

Conversation

@Lint111

@Lint111 Lint111 commented Jul 29, 2026

Copy link
Copy Markdown

Summary

Add one opt-in mobile terminal control system with responsive surfaces for keyboard-open and keyboard-hidden states.

Controls

  • Keyboard hidden:
    • Esc at the left edge
    • Up, Enter, and Down centered
    • Tab at the right edge
    • vertical swipe on the surrounding band sends Up or Down
    • pressing Up and Down together sends one Enter without leaking arrow keys
  • Keyboard open:
    • compact accessory row with Esc, arrows, Option+Enter, Tab/Shift+Tab, paste, path insertion, clear input, CLI commands, and dismiss
    • fixed-height horizontal layout keeps primary actions inside narrow phone widths
  • Optional feedback:
    • short vibration when navigator.vibrate is available
    • short Web Audio tone when enabled

Interaction Safety

  • Pointer gestures claim the interaction before button activation, so a swipe that begins or ends on a button does not also click it.
  • Canceled pointers clear pressed state without dispatch.
  • Controls hide while Codeman dialogs are open and return afterward.
  • Terminal-control taps do not focus xterm or open the mobile keyboard.
  • Active web views suppress terminal controls.
  • Existing upstream path-picker and clear-input accessory actions are preserved.

Settings and Migration

  • Mobile Terminal Controls, haptics, and sound are available in App Settings on touch devices.
  • Controls and haptics default off.
  • Explicit canonical or legacy true preferences migrate to enabled.
  • Legacy extendedKeyboardBar: false and device detection alone do not enable the new controls.

Volume Keys

Codeman maps browser keydown events reported as volume up/down and applies the same simultaneous-direction Enter chord. This is progressive enhancement only: most mobile browsers reserve physical volume keys at the operating-system level and do not expose those events to web pages. The visible controls are the reliable interface.

Validation

  • npx vitest run --config config/vitest.config.ts test/mobile-navigation-pad.test.ts
    • 21 tests passed
  • npx vitest run --config test/mobile/vitest.config.ts test/mobile/navigation-pad.test.ts
    • 10 Playwright-backed tests passed
  • npx vitest run --config test/mobile/vitest.config.ts test/mobile/settings.test.ts
    • 20 Playwright-backed tests passed
  • npx vitest run --config test/mobile/vitest.config.ts test/mobile/keyboard.test.ts -t "control rows|unified terminal-control|unified controls|accessory bar"
    • 4 focused tests passed
  • npm run check:frontend-syntax
    • 26 frontend files passed
  • npm run build
    • passed

Scope

This PR does not change terminal tap classification, draft/IME/paste handling, PTY viewport ownership, or terminal-history streaming. Those are separate review slices.

Unify keyboard-open and keyboard-hidden terminal navigation behind one opt-in setting. Add swipe, simultaneous Up+Down Enter, exposed volume-key mapping, modal suppression, and optional haptic or sound feedback while preserving upstream path-picker actions.
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