Skip to content

[Feature/Bug]: Mobile multi-row terminal shortcut bar, unified shortcut reordering, and fix arrow-key scroll tap #28679

Open

Description

@zhangxaochen

Summary

On Orca Mobile (Android / iOS), the terminal shortcut bar (MobileSessionCommandDock) and Manage Shortcuts settings (TerminalShortcutSettings) currently have three usability and interaction issues:

  1. Accidental arrow-key / repeatable-key trigger when scrolling the shortcut bar horizontally:
    • Touching a repeatable shortcut key (↑, ↓, ←, →, ⌫, Del) and swiping left/right to scroll the shortcut bar immediately triggers and sends that key to the terminal because handleAccessoryKey is invoked synchronously inside onPressIn before the parent horizontal ScrollView can claim the scroll gesture.
  2. Single-row overflow:
    • All shortcut keys live in a single horizontal row, forcing users to scroll back and forth continuously when multiple built-in and custom keys are enabled.
  3. Custom shortcuts cannot be ordered ahead of built-in shortcuts or moved across rows:
    • Built-in keys and custom shortcuts live in two separate lists (SHORTCUT BAR and CUSTOM SHORTCUTS), and MobileSessionCommandDock always renders built-in keys first and custom keys at the end.

Proposed Solution

  1. Fix repeatable key scroll-tap bug:
    • Do not fire handleAccessoryKey synchronously in onPressIn. Instead, onPressIn only starts the 400ms hold-repeat timer (startAccessoryRepeat), onScrollBeginDrag / onPressOut cancels the timer if the user scrolls or releases early, and a short tap (< 400ms without scrolling) sends a single key press in onPress.
  2. Multi-row shortcut bar stacking (1..4 rows):
    • Add a [-] / [+] row counter control in Manage Shortcuts (TerminalShortcutSettings) to configure 1..4 stacked shortcut rows (default 1), automatically merging trailing-row items into the last remaining row when decremented.
    • Render stacked horizontal ScrollView rows in MobileSessionCommandDock.
  3. Unified built-in + custom shortcut ordering & cross-row drag-and-drop:
    • Upgrade TerminalAccessoryLayoutPreference to version: 3 (rowCount, rows: string[][], visibleBuiltInIds) with lossless migration from v1/v2.
    • Unify built-in and custom shortcuts into a single DragReorderList with per-row section dividers (Row 1, Row 2, ...) so any shortcut (built-in or custom) can be reordered freely within a row or dragged across rows.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions