#11711: feat(webui): add terminal-style input history navigation
app: web-ui
stale
## Summary
Press ArrowUp/ArrowDown in the chat input to cycle through previously sent messages, like a terminal.
## Changes
- Added history state tracking to app view state
- Modified chat textarea keydown handler for ArrowUp/ArrowDown
- History persisted to localStorage (max 100 entries)
- **Includes slash commands** in history (useful for re-running commands)
- Skips duplicate consecutive entries
- Works on single-line input or when cursor at start/end for multiline
## Testing
1. Send a few messages in the web UI chat
2. Press ↑ to cycle back through history
3. Press ↓ to cycle forward or clear
Tested locally on OpenClaw 2026.2.6.
<!-- greptile_comment -->
<h2>Greptile Overview</h2>
<h3>Greptile Summary</h3>
Adds terminal-style chat input history navigation in the web UI (ArrowUp/ArrowDown), with history stored in app state and persisted to `localStorage` (bounded to 100 entries and skipping consecutive duplicates). Rendering wires new state (`chatInputHistory`, `chatInputHistoryIndex`) and a navigate handler through `renderApp` into the chat textarea keydown handler so history traversal only triggers on single-line drafts or when the cursor is at the start/end of a multiline draft.
<h3>Confidence Score: 3/5</h3>
- Safe to merge after addressing two user-visible behavior issues in chat input history handling.
- Core changes are localized to chat input handling and state wiring, but there are two definite functional mismatches: slash commands are excluded from history despite the stated requirement, and navigating back to the end of history clears any pre-existing draft text.
- ui/src/ui/app.ts
<!-- greptile_other_comments_section -->
<!-- /greptile_comment -->
Most Similar PRs
#7528: feat: Adds slash command suggestions to chat
by JohnnyD1776 · 2026-02-02
81.0%
#9218: Fix Control UI chat resync on gaps and terminal events
by figitaki · 2026-02-05
76.7%
#19754: feat(webchat): add cursor-based pagination to chat.history
by aleiby · 2026-02-18
74.7%
#22798: feat(webchat): ChatGPT-style multi-chat threads with generated titles
by opnsec · 2026-02-21
73.7%
#3721: fix(ui): webchat not displaying chat responses
by maxmaxrouge-rgb · 2026-01-29
72.6%
#14966: fix(webchat): preserve user message visibility after chat.send
by BenediktSchackenberg · 2026-02-12
71.9%
#14309: fix(ui): resolve chat event session key mismatch
by justonlyforyou · 2026-02-11
71.1%
#19343: Refactor chat state management: reset chat messages and queue on se...
by saurav470 · 2026-02-17
71.1%
#7522: fix(webchat): auto-scroll when message queue changes
by alsoknownasfoo · 2026-02-02
70.9%
#13548: feat(control-ui): Add quote reply and send message to session features
by Annaxiebot · 2026-02-10
70.1%