Skip to content

feat(mobile): add an autocorrect-aware prompt composer #359

Description

@DodgyBadger

Problem

Mobile terminal input sends text to the PTY as it is typed. Once a typo has been sent, the device keyboard cannot replace it, so accepting an autocorrection appends the corrected word instead.

The existing Paste modal avoids this by retaining text in a normal textarea until Send. It provides a much better mobile typing experience and can be promoted into a proper prompt composer.

Proposed first slice

Rename the agent-session Paste action to Compose and provide a normal multiline editor with:

  • Autocorrect, spellcheck, and sentence capitalization
  • Explicit Send button
  • Enter always inserts a newline; it never submits
  • Image attachment
  • In-memory, per-session draft preservation
  • Use terminal keyboard escape hatch

Add a per-device Mobile prompt entry setting:

  • Composer — tapping an editable agent prompt opens the composer
  • Direct terminal — preserves the current behavior

The Compose accessory-bar action remains available in either mode.

Automatic-opening rules

When Composer is selected, open it only:

  • On handheld devices
  • For agent sessions, never shell sessions
  • When a tap is classified as editable prompt input

Do not open it for terminal history, links, tool output, readbacks, menus, permission dialogs, or other modals.

Acceptance criteria

  • Autocorrect replacements do not duplicate previously typed text.
  • Enter creates multiline input without submitting.
  • Send delivers the complete prompt once and preserves intended line breaks.
  • Cancel or backdrop dismissal preserves the session in-memory draft.
  • Drafts do not cross between sessions and clear after successful Send.
  • The per-device preference controls prompt-tap behavior.
  • Direct terminal input and shell sessions retain their current behavior.
  • Compose remains manually accessible regardless of the preference.
  • Add mobile coverage for autocorrect replacement, multiline input, draft restoration, prompt-tap routing, dialogs, and shell sessions.

Out of scope

Synchronizing browser edits with text already present in the remote terminal composer, persistent drafts across browser restarts, and replacing direct terminal input entirely.

Activity

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

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions