Skip to content

fix(mobile): keep terminal arrows accessible for TUI navigation - #10699

Closed
sameerr03 wants to merge 1 commit into
pingdotgg:mainfrom
sameerr03:fix/mobile-terminal-arrow-navigation
Closed

sameerr03 wants to merge 1 commit into
pingdotgg:mainfrom
sameerr03:fix/mobile-terminal-arrow-navigation

Conversation

@sameerr03

@sameerr03 sameerr03 commented Sep 8, 2026 •

Copy link
Copy Markdown
Contributor

What Changed

Pin four 44-point arrow buttons beside the mobile terminal's scrolling command buttons, and keep the toolbar available when the keyboard is hidden. Taps send one movement; holding repeats until release, navigation, session replacement, backgrounding, or a failed write. Repeats wait for writes to finish so a slow remote connection does not accumulate queued movements.

Encode the toolbar's Ctrl/Alt arrows as modified cursor keys and forward Android hardware arrows, including Shift/Alt/Ctrl combinations, to the terminal.

Why

The existing arrows were buried after six commands in a horizontal scroller and disappeared with the keyboard. This made TUI navigation difficult to discover and use on phones.

Validation

  • 22 focused tests pass for terminal input and key repeat, including cancellation during pending writes and failed connections.
  • Mobile TypeScript check passes. Targeted lint passes; the existing terminal screen still has React compiler warnings in unchanged code.
  • Independent code review completed; corrected canceled-touch handling for accessibility activation.
  • Uses the shared mobile terminal route for iOS and Android, with the existing environment-scoped terminal write transport. No provider, web/desktop, server, or wire-contract changes.
  • Production: +227 / -119 lines. Tests: +95 / -0 lines.

UI Changes

Device verification, before/after screenshots, and a short hold-to-repeat video are deferred at the requester's direction until an emulator is available. Native Android build and iOS runtime validation have not been performed. Shell history, TUI navigation, keyboard transitions, and screen-reader behavior still need an integrated device pass. Application cursor-key mode handling is unchanged and needs compatibility verification during that pass.

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • I included before/after screenshots for any UI changes
  • I included a video for animation/interaction changes

Implemented with GPT-6 in the Codex harness.

Note

Add press-and-hold arrow controls and hardware arrow-key support for terminal navigation

  • Adds a four-button TerminalArrowControls group that sends terminal arrow sequences on press and repeats while held, using createTerminalKeyRepeat (400ms initial delay, 80ms interval) with cancellation on release, unmount, or failed writes.
  • Adds Android hardware DPAD arrow-key handling in T3TerminalView that maps arrow presses to terminal cursor sequences with Shift/Alt/Ctrl modifier awareness, and bumps hardwareKeyRevision to 3.
  • Fixes resolveModifiedTerminalInput so pending Ctrl and Meta modifiers produce CSI cursor sequences (modifier params 5 and 3) for both CSI and SS3 arrow notation instead of generic control-byte transforms.
  • Reworks ThreadTerminalRouteScreen to always render the keyboard accessory with the toolbar, arrow controls, and a toggle button; arrow controls are disabled when the terminal is stopped or the route is unfocused.
  • Adds onPressIn/onPressOut props to ComposerToolbarButton to support the repeat lifecycle.
  • Behavioral Change: the terminal route no longer conditionally shows the accessory; it is always rendered and accounts for bottom safe-area inset when the keyboard is hidden. writeModifiedInput now returns Promise<boolean>.

Macroscope summarized 7eab49b.

@github-actions github-actions Bot added vouch:unvouched PR author is not yet trusted in the VOUCHED list. size:L 100-499 changed lines (additions + deletions). labels Sep 8, 2026
@sameerr03

Copy link
Copy Markdown
Contributor Author

Closing as requested: the mobile terminal already has all four arrow buttons, introduced in #2013 (commit b3e8c03).

This draft proposed pinning those controls, keeping them visible with the keyboard hidden, and adding hold-to-repeat and input fixes. We are not pursuing those additional changes in this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L 100-499 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant