← Back to PRs

#11711: feat(webui): add terminal-style input history navigation

by stephenschoettler open 2026-02-08 06:39 View on GitHub →
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