Skip to content

harness: arrow keys navigate prior user messages into the composer #406

Description

@btipling

Summary

Operators often want to reuse or tweak a previous user prompt without scrolling the transcript and retyping. The Wasm composer should support arrow-key navigation through prior user messages (shell/readline-style history), loading them into the composer for edit + resend.

Motivation

  • Re-run a prompt with a small edit after a bad tool path or wrong model.
  • Faster than scroll → select → copy → paste into composer.
  • Matches muscle memory from terminals and many chat UIs (↑ / ↓ history).

Proposed UX (sketch — not a locked plan)

Input When Behavior
Composer focused, caret at start of input or empty/single-line policy (product choice) Step to older user message; load text into composer
After having stepped up Step to newer user message; at “present” restore the draft that was being typed
Edit after load Always Composer text is a normal draft — edit freely; Send submits a new user turn (does not rewrite history unless a separate edit-sent-message feature exists)
Scope User messages only Skip assistant / thinking / tool_run / system / error rows
Window Ring + session Prefer messages visible in the host session window / ring; document if Load earlier is required for older prompts

Caret vs history (open product choice)

Many UIs only bind ↑/↓ to history when the composer is empty or the caret is on the first/last line of a multi-line draft, so multi-line editing still uses arrows inside the text. That policy should be explicit in the plan so it does not fight multi-line composer behavior (Enter = newline, Ctrl/Cmd+Enter = send).

Acceptance ideas

  • With composer focused, ↑ cycles older user prompts into the field; ↓ moves forward and can restore the in-progress draft.
  • Assistant / thinking / tool_run rows are never loaded as history entries.
  • Multi-line composer: arrow keys do not break normal caret movement inside a multi-line draft (documented policy).
  • Send after history load creates a normal new user message; transcript order stays correct.
  • Works on desktop keyboard; document mobile limitations (no physical arrows).
  • Living docs: docs/harness-limits.md keyboard table (alongside Enter / Ctrl+Enter).

Non-goals (v1)

Related

Issue / surface Role
docs/harness-limits.md Composer keys: Enter newline, Ctrl/Cmd+Enter send
#349 Accessibility / keyboard scoping
#339 Sticky last-user chip (scroll-to); complementary, not a substitute
#405 Message queue (future prompts) — this issue is past user prompts

What good looks like

Operator hits ↑ twice, lands on an earlier user step list, tweaks one line, Ctrl+Enter — new turn runs with the edited prompt; ↓ after partial ↑ restores the draft they had started typing.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestharnessHarness / agent UIui

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions