Title: Recall previously-sent prompts in the composer with the Up / Down arrows · Issue #52 · modelstudioai/openwork · GitHub
Open Graph Title: Recall previously-sent prompts in the composer with the Up / Down arrows · Issue #52 · modelstudioai/openwork
X Title: Recall previously-sent prompts in the composer with the Up / Down arrows · Issue #52 · modelstudioai/openwork
Description: Problem or Motivation Terminal shells, the Claude Code CLI, and the Codex desktop composer all let you recall a prompt you already sent by pressing the Up arrow in the composer — Codex documents it explicitly ("cancel the current run and...
Open Graph Description: Problem or Motivation Terminal shells, the Claude Code CLI, and the Codex desktop composer all let you recall a prompt you already sent by pressing the Up arrow in the composer — Codex documents it...
X Description: Problem or Motivation Terminal shells, the Claude Code CLI, and the Codex desktop composer all let you recall a prompt you already sent by pressing the Up arrow in the composer — Codex documents it...
Opengraph URL: https://github.com/modelstudioai/openwork/issues/52
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Recall previously-sent prompts in the composer with the Up / Down arrows","articleBody":"## Problem or Motivation\n\nTerminal shells, the **Claude Code CLI**, and the **Codex desktop** composer all\nlet you recall a prompt you already sent by pressing the **Up arrow** in the\ncomposer — Codex documents it explicitly (\"cancel the current run and recover\nyour previous prompt by pressing the up arrow key in the composer\"), and it's the\nsame muscle-memory as a shell's history (`↑`/`↓`).\n\nOpenWork's chat composer (`FreeFormInput`) has **no prompt history**. Once you\nsend a message it's gone from the input; to re-run or tweak a previous prompt you\nhave to retype it or scroll up and copy it out of the transcript. `ArrowUp` /\n`ArrowDown` in the composer today only drive the inline mention / slash / label\nmenus — outside those menus they just move the caret.\n\n## Proposed Solution\n\nAdd **shell-style prompt history recall** to the composer:\n\n- Each **sent** prompt is appended to a history list (newest last), persisted in\n the renderer's `localStorage` (global, like a shell history file), trimmed,\n with immediate-duplicate collapse, capped at 100 entries.\n- Pressing **Up** in an **empty** composer (or while already recalling) walks\n **backwards** through history (newest → oldest), clamping at the oldest.\n- Pressing **Down** while recalling walks **forwards** (older → newer); paging\n past the newest entry **restores the draft** you started from and exits recall.\n- Any real edit, submitting, or switching sessions **exits** recall mode.\n- When the composer already has a draft and you aren't recalling, `Up`/`Down`\n keep their normal caret-movement behaviour — so recall never hijacks editing.\n\n## Feasibility\n\n**Classification: pure frontend — candidate.** No qwen-code backend involvement.\n\n- The composer's imperative handle (`RichTextInputHandle`) already exposes\n `value` / `setValue` / `setSelectionRange`, and recall drives the existing\n controlled `value` prop (via `setInput`) — the same mechanism `@mention`\n selection already uses. No new IPC, no main-process change.\n- Persistence reuses the existing `lib/local-storage.ts` `KEYS`/`get`/`set`\n helper (one new key, `craft-prompt-history`), exactly as the recent\n reduce-motion work did.\n- The navigation model (push / prev / next / entry-at) is a small pure module,\n so it is fully unit-testable without a DOM.\n- **No new i18n keys** — the feature has no visible labels.\n\n## Alternatives Considered\n\n- **Per-session history** instead of global: closer to some apps, but a global\n history matches shell / Codex behaviour and is simpler; can be scoped later.\n- **A visible history dropdown**: heavier and less discoverable than the\n universally-expected `↑` affordance; could be layered on later.\n\n## Additional Context\n\n### Acceptance criteria (CDP e2e assertion)\n\nA new `e2e/assertions/prompt-history.assert.ts` drives the real built app over CDP\nentirely in the draft (no-session) state — no seeded conversation, no backend. The\ncomposer reads its history fresh from `localStorage`, so the assertion seeds three\nprior prompts there and walks them:\n\n1. The composer renders and starts **empty**.\n2. Seed `localStorage['craft-prompt-history'] = ['alpha one','beta two','gamma three']`.\n3. `ArrowUp` recalls the newest (`gamma three`); further Ups walk older\n (`beta two`, `alpha one`) and **clamp** at the oldest.\n4. `ArrowDown` walks newer again (`beta two`, `gamma three`) and, once **past** the\n newest, **restores the original empty draft**.\n\nReading the composer's actual text after each keypress proves the arrows really\nchange the composer contents, not merely toggle state. In addition, the pure\nhistory module ships with unit tests (`prompt-history.test.ts`) covering push\nsemantics (trim, immediate-repeat collapse, cap) and the Up/Down navigation\nround-trip.\n\nPart of the autonomous desktop-feature loop (`loop-bot`).","author":{"url":"https://github.com/DragonnZhang","@type":"Person","name":"DragonnZhang"},"datePublished":"2026-07-04T01:33:12.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/52/openwork/issues/52"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:05c8cfc1-61e1-8de2-aa11-43507ff5a255 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9528:223B79:91C88F:C39E18:6A52763A |
| html-safe-nonce | 108ee7f8f083fa153440024357ba13bd97557cffb989def17248bdab91d1a343 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5NTI4OjIyM0I3OTo5MUM4OEY6QzM5RTE4OjZBNTI3NjNBIiwidmlzaXRvcl9pZCI6IjU5MzYzMDQ1MDc1Mzc0ODc0MTgiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | bf81cd050fa69a412321232d0ec32727c762d68dbd1d040297cce21a7ff255ea |
| hovercard-subject-tag | issue:4807194454 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/modelstudioai/openwork/52/issue_layout |
| twitter:image | https://opengraph.githubassets.com/e481fb05459aea72b5527ec5a43735acb71ad30cc8f6461d3176ab1b126678b1/modelstudioai/openwork/issues/52 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/e481fb05459aea72b5527ec5a43735acb71ad30cc8f6461d3176ab1b126678b1/modelstudioai/openwork/issues/52 |
| og:image:alt | Problem or Motivation Terminal shells, the Claude Code CLI, and the Codex desktop composer all let you recall a prompt you already sent by pressing the Up arrow in the composer — Codex documents it... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | DragonnZhang |
| hostname | github.com |
| expected-hostname | github.com |
| None | b9a586c06a05a7a86fc7e3f4dbd03e42f6869085879aa184aa6369456dbd50fb |
| turbo-cache-control | no-preview |
| go-import | github.com/modelstudioai/openwork git https://github.com/modelstudioai/openwork.git |
| octolytics-dimension-user_id | 283556804 |
| octolytics-dimension-user_login | modelstudioai |
| octolytics-dimension-repository_id | 1256697754 |
| octolytics-dimension-repository_nwo | modelstudioai/openwork |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 1256697754 |
| octolytics-dimension-repository_network_root_nwo | modelstudioai/openwork |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 07a982c1d40157c619b364352b704c3ce66bb332 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width