Skip to content

feat(mobile): put the terminal keys you use on one row and the rest under ⋯ - #48529

Merged
AmoabaKelvin merged 1 commit into
mainfrom
terminal-key-rail
Nov 27, 2026
Merged

AmoabaKelvin merged 1 commit into
mainfrom
terminal-key-rail

Conversation

@AmoabaKelvin

@AmoabaKelvin AmoabaKelvin commented Nov 24, 2026 •

Copy link
Copy Markdown
Collaborator

ELI5

The row of keys above a phone terminal had about 26 keys, so the arrows were off screen and two of the first keys were toggles. Now the row shows the keys people reach for (Esc, Tab, Ctrl, Alt, the four arrows, ⌫, Paste, your own keys), with ⋯ always at the end for everything else. The typing field is just "Type into terminal".

Files Added Deleted Net
Test 0 0 0 0
Prod 30 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​717 $\color{#cf222e}{\Huge{\mathbf{−}}}$​1288 $\color{#cf222e}{\Huge{\mathbf{−}}}$​571

What Changed

Key row (MobileSessionAccessoryKeys):

  • Before: show/hide keyboard, desktop width, Paste, Esc, Tab, Shift, Ctrl, Alt, then about 20 more keys (arrows at slots 14–17, eight Ctrl+letter keys), then +.
  • After: Esc, Tab, Ctrl, Alt, one 112 pt key with all four arrows, ⌫, Paste, your visible custom keys; ⋯ pinned at the end. The row is fixed, not built from the Settings list, so it always fits Esc to → at 390 pt. Held ⌫ and arrows still repeat; Ctrl/Alt still latch (tap) and lock (double tap).

More keys sheet (opened by ⋯ on every phone, and by the Duo side rail as before):

  • Paste, Photo, File and Desktop width (a switch) as rows; the Ctrl combos as named shortcuts (Interrupt ⌃C, Clear screen ⌃L…); the rest of the keys (Enter, ⇧Tab, Space, Del, Ins, Home/End, PgUp/PgDn, F1–F12); your keys with Add. Keys the row already shows are left out.

Input field (MobileSessionCommandDock):

  • Before: keyboard icon + "Live input" caption + "Tap to show keyboard", an image button that attached a file only on long press, and a hide-keyboard key that pushed the whole key row 42 pt right when the keyboard opened.
  • After: placeholder "Type into terminal". + on the left opens Photos / Files (the chat composer's sheet). While the keyboard is up that same slot is the hide-keyboard key, so nothing on the row moves. "Uploading…" covers the field while a photo or file goes up, and + is disabled while dictating.
  • On native iOS the dock now eases with the keyboard (250 ms, the sheet curve) instead of jumping; Android and the page keep snapping, since they only learn the height once the keyboard has landed.

Add a key (CustomKeyModal, used from the sheet and from Settings):

  • One sheet: Cancel / "Add a key" (subtitle shows the key it will make, e.g. Ctrl+C) / Add, a Key combo | Text switch, then one grouped list (Ctrl, Alt, Shift switches and Key ›) or the text fields with Press Enter. Key › opens a picker page. Title Case, the explanations under each choice, the 30 pt back button and the filled Add in the middle of the sheet are gone.
  • Smart rail and Manage shortcuts are no longer in this sheet; they live in Settings › Terminal (the Settings page itself is reworked in a paired PR, which also drops the row's fixed keys from its list via the new TERMINAL_RAIL_KEY_IDS).

Also: custom keys hidden in Settings now stay off the row (the switch never applied before).

Why

From the phone UX audit: the arrows were the most used keys and the least reachable, the eight Ctrl+letter keys repeated the Ctrl latch, the first slot was a toggle whose icon showed the mode you'd switch to, and the settings for the row lived behind + in the row itself. A fixed row of the common keys plus one sheet for the rest keeps the row one line tall (Kelvin's rule for this rail) without hiding anything. The hide-keyboard key moved into +'s slot because the row has no room for it at 390 pt once the arrows fit.

Linked Issue

Part of the phone UX round (approved audit page); no issue.

Visual Proof

Rendered from the real components in Chromium at 393 × 852 (same data both sides).

Before After
Row, dark
Row, light
Keyboard up, dark
Keyboard up, light
⋯ sheet, dark
⋯ sheet, light
Add a key, dark
Add a key, light
Uploading, dark
Uploading, light

Add a key, the other pages (after):

Text, dark Text, light Key picker, dark Key picker, light

Testing

  • Rendered the real dock, sheets and Add a key in Chromium (react-native-web build of the page bundle) at 393 pt, dark and light, keyboard down, keyboard opening after mount, uploading, long custom keys, and tapped through ⋯, Text and Key ›.

  • pnpm check:changed passes; mobile typecheck passes; verify:mobile-localization passes.

  • Page bundle: eager bytes 8,296,905 → 8,290,213 (−6,692).

  • I manually tested these changes locally

  • Automated tests added/updated, or explained why not below — UI only; no test pins this layout, and the key encodings it sends are the existing, tested ones.

  • Every added test fails without this change and avoids the test anti-patterns

Performance

None, because the row renders fewer keys than before, the sheet only mounts its content when opened, and the dock's keyboard ease runs on the UI thread through Reanimated (one shared value per dock). Page eager bytes go down 6.7 KB.

Risk

The riskiest part is the dock now always mounting the More keys sheet and the arrows living in one cluster: if a press path were wrong, a held arrow or ⌫ would stop repeating or a key would go to the wrong terminal. Both use the same press code as before (prepareAccessoryPress, touch.fire). The Duo side rail still opens the same sheet with its own key list. Older paired desktops are unaffected (no RPC change). Stored layouts keep working: the Settings list still controls which keys show in ⋯. Back out with a plain revert.

Level: Medium

Review

Two review rounds (Codex + Claude). Fixed: the dock's animated style now names its shared value (the page build has no worklet plugin), the 250 ms ease is native-iOS only, the hide-keyboard key wins over the upload spinner, and + is disabled while dictating. Left: Settings still listing Esc/Tab/arrows/⌫ is handled in the paired Settings PR; a Shift lock set on the Duo rail isn't shown if the rail goes away mid-session (rare, follow-up).

Agent skill upstream boundary

  • Not applicable, or this change copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Notes

Mobile only; no desktop, SSH or platform-specific paths. 27 localization keys that nothing reads any more were removed from every mobile catalog; new strings are English-only for now.

Checklist

  • This PR is small and focused
  • I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
  • I stated the risk: what could break, for whom, and how to back it out
  • Before/after screenshots or videos attached for UI changes, or N/A with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
  • pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred)

@coderabbitai

coderabbitai Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The mobile terminal UI now has a two-kind custom-key editor, a fixed accessory rail, and a revised more-keys sheet. The command dock adds keyboard-lift animation on iOS and separates attachment controls from dictation controls. Chat attachment callbacks are grouped in an optional argument. Localization files update corresponding labels and remove empty translation objects.

Merge Risk: Low · up to e25ca

The terminal key row changes look mergeable. One minor edge case remains: a Shift lock set on the Duo rail can stay active after the smart rail is turned off, with no visible way to release it. It clears when the tab changes. The author already knows about it, so it needs owner awareness or a small follow-up.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title "feat(mobile): put the terminal keys you use on one row and the rest under ⋯" matches the main change. The PR reshapes the mobile terminal key row into a fixed row of common keys with the re…
Description check Passed The description follows the repository template. It includes ELI5, What Changed, Why, Linked Issue, Visual Proof, Testing, Performance, Risk, AI Disclosure, Review, Agent skill upstream boundary, Note…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title "feat(mobile): put the terminal keys you use on one row and the rest under ⋯" matches the main change. The PR reshapes the mobile terminal key row into a fixed row of common keys with the remaining keys moved into a ⋯ sheet. It is specific and describes the primary change, so it passes.

Full details: Description check

Explanation

The description follows the repository template. It includes ELI5, What Changed, Why, Linked Issue, Visual Proof, Testing, Performance, Risk, AI Disclosure, Review, Agent skill upstream boundary, Notes, and Checklist sections. It explains the before and after behavior, the mechanism, the rationale, and the risk with a rollback plan. It also has before and after visuals, testing notes, and a performance line. Minor gaps: the Linked Issue section says there is no issue, which the template asks outside contributors to avoid, and the Risk level is set to Medium, which is filled in. The AI Disclosure section is left empty, but the template says to skip it for internal contributors, so this is acceptable. The description is mostly complete.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 3bf19091-f274-4063-85af-a00c91245cc1
Commits

Reviewing files that changed from the base of the PR and between d4c58dd and e25cae1.

Files selected for processing: 11

  • mobile/src/i18n/locales/de.json
  • mobile/src/i18n/locales/en.json
  • mobile/src/i18n/locales/es.json
  • mobile/src/i18n/locales/fr.json
  • mobile/src/i18n/locales/ja.json
  • mobile/src/i18n/locales/ko.json
  • mobile/src/i18n/locales/pt.json
  • mobile/src/i18n/locales/ru.json
  • mobile/src/i18n/locales/tr.json
  • mobile/src/i18n/locales/zh-Hant.json
  • mobile/src/i18n/locales/zh.json
Files skipped from review as they are similar to previous changes: 10

  • mobile/src/i18n/locales/en.json
  • mobile/src/i18n/locales/es.json
  • mobile/src/i18n/locales/fr.json
  • mobile/src/i18n/locales/ja.json
  • mobile/src/i18n/locales/ko.json
  • mobile/src/i18n/locales/pt.json
  • mobile/src/i18n/locales/ru.json
  • mobile/src/i18n/locales/tr.json
  • mobile/src/i18n/locales/zh-Hant.json
  • mobile/src/i18n/locales/zh.json

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 0 remain after this review.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 185e568d-f451-4d62-905c-8878d7559bb7
Commits

Reviewing files that changed from the base of the PR and between b3996c2 and e0161d1.

Files selected for processing: 30

  • config/mobile-localization-coverage-allowlist.json
  • mobile/src/i18n/locales/de.json
  • mobile/src/i18n/locales/en.json
  • mobile/src/i18n/locales/es.json
  • mobile/src/i18n/locales/fr.json
  • mobile/src/i18n/locales/ja.json
  • mobile/src/i18n/locales/ko.json
  • mobile/src/i18n/locales/pt.json
  • mobile/src/i18n/locales/ru.json
  • mobile/src/i18n/locales/tr.json
  • mobile/src/i18n/locales/zh-Hant.json
  • mobile/src/i18n/locales/zh.json
  • mobile/src/session/MobileSessionCommandDock.tsx
  • mobile/src/session/MobileSessionSheets.tsx
  • mobile/src/session/native-chat/composer/attachments/MobileNativeChatComposerAttachButton.tsx
  • mobile/src/session/native-chat/composer/attachments/mobile-native-chat-attach-actions.ts
  • mobile/src/session/use-mobile-session-lifecycle.ts
  • mobile/src/terminal/key-input/terminal-accessory-layout.ts
  • mobile/src/terminal/key-input/terminal-key-definitions.ts
  • mobile/src/terminal/session/accessory-keys/MobileSessionAccessoryKeys.tsx
  • mobile/src/terminal/session/accessory-keys/MobileSessionLatchKeys.tsx
  • mobile/src/terminal/session/accessory-keys/MobileTerminalMoreKeysSheet.tsx
  • mobile/src/terminal/session/accessory-keys/TerminalMoreKeysSheet.tsx
  • mobile/src/terminal/session/accessory-keys/terminal-dock-styles.ts
  • mobile/src/terminal/session/accessory-keys/use-session-terminal-key-rail.ts
  • mobile/src/terminal/session/input-controls/MobileTerminalInputActions.tsx
  • mobile/src/terminal/session/input-controls/MobileTerminalLiveInputStatus.tsx
  • mobile/src/terminal/session/input-controls/use-mobile-session-keyboard-state.ts
  • mobile/src/terminal/shortcuts/settings/CustomKeyModal.styles.ts
  • mobile/src/terminal/shortcuts/settings/CustomKeyModal.tsx
Files with no reviewable changes: 1

  • mobile/src/session/MobileSessionSheets.tsx

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 3 remain after this review.

const LATCHES: readonly { id: TerminalShortcutModifier; label: string }[] = [
{ id: 'shift', label: 'Shift' },
// Shift is on the keyboard itself; ⇧Tab and the rest of the Shift combos sit under ⋯.
const LATCHES: readonly { id: 'ctrl' | 'alt'; label: string }[] = [

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor · Functional Correctness · Quick win

Clear a locked Shift when its rail control is removed.

A Shift lock set on the Duo rail survives key presses. Turning the smart rail off removes the only visible Shift control, but the dock modifier state keeps Shift locked in the same tab. Arrow keys and typed letters then keep receiving Shift with no visible way to release it. Only a tab change clears it.

Release the Shift lock when the smart rail stops showing Shift, or keep a reachable release control for it. The inspected code does not establish which of these behaviors the product should use.

…t under ⋯

The key row now shows Esc, Tab, Ctrl, Alt, one arrow key, ⌫, Paste and the
user's own keys, with ⋯ pinned at the end. Everything else (desktop width,
named Ctrl shortcuts, F-keys, Del/Home/End, adding a key) moves to the More
keys sheet. The field is just "Type into terminal" with + for a photo or
file, and the hide-keyboard key takes +'s slot while typing so nothing on
the row moves. The dock follows the keyboard's curve on iOS. Adding a key is
one sheet with Cancel/Add, a Key combo / Text switch and a grouped list;
Smart rail and Manage shortcuts now live only in Settings.
@AmoabaKelvin
AmoabaKelvin merged commit c2aaca9 into main Nov 27, 2026
58 checks passed
AmethystLiang added a commit that referenced this pull request Nov 29, 2026
… More

The phone key row from #48529 left Enter only under More and scrolled Paste
off screen, or hid it with an empty clipboard. On native phones the key row
is now a fixed bar of five 48 pt keys with no overlapping hit slop: Up, Down,
Paste, Enter (taking the spare width) and More. Paste keeps its slot and dims
when the clipboard reports nothing. More opens the existing sheet, which gains
a Close button and starts with the rest of the key row (Esc, Tab, Ctrl, Alt,
arrows, Backspace and Smart Rail keys) so repeat and latches work as before;
custom keys and Paste stay in its close-first rows. More is outlined while a
Ctrl or Alt latch waits. Tablets, the page build and the Duo rail are
unchanged.

Fixes #51790. Reference: #51793.

Co-authored-by: ASH <[email protected]>
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