feat(chat): navigate prompt history with PageUp/PageDown#8
feat(chat): navigate prompt history with PageUp/PageDown#8dguerizec wants to merge 4 commits intotwidi:mainfrom
Conversation
Browse previous user messages in the current session using PageUp (older) and PageDown (newer). Current draft is preserved and restored when exiting history navigation. Typing resets history position.
Code reviewThanks for the feature — prompt history navigation is a great addition. After a thorough analysis, here are the issues and suggestions I found. Bugs1. Missing Every other code path in this file that programmatically sets twicc/frontend/src/components/MessageInput.vue Lines 99 to 106 in f77c104 2. Missing Web Component force-update for The file has extensive comments (around lines 835-848) explaining that setting twicc/frontend/src/components/MessageInput.vue Lines 85 to 106 in f77c104 3.
twicc/frontend/src/components/MessageInput.vue Lines 53 to 55 in f77c104 UX concerns4. Activates regardless of textarea content — no safeguard PageUp/PageDown triggers even when the user has typed text. The current content is replaced immediately without any visual cue. While the draft is technically saved in 5. No visual feedback for history navigation There's no indication that the user is in "history mode" — no way to know which message they're viewing, how many are available, or that they've reached the end. The text just silently changes in the textarea. 6. Consider a popup picker instead of inline replacement A popup similar to the existing slash command picker (
Performance7. The function iterates all session items, filters for twicc/frontend/src/components/MessageInput.vue Lines 60 to 80 in f77c104 Open question8. Attachments are silently dropped When recalling a message that had media attachments (images, files), only the text block is extracted. The attachments are lost without any indication. This needs a design decision: should these messages be excluded from history? Should the text be recalled with a note that attachments were omitted? Or should attachments be fully restored? twicc/frontend/src/components/MessageInput.vue Lines 71 to 78 in f77c104 🤖 Generated with Claude Code - If this code review was useful, please react with 👍. Otherwise, react with 👎. |
Replace inline prompt history navigation with a popup picker triggered by Alt+PageUp. Shows past user messages in chronological order with search filtering and two actions per item: insert at cursor (default, Enter) and replace (Tab+Enter). Insert button is visually pre-highlighted when navigating the list. Add Alt+PgUp hint to textarea placeholder.
Follow-up review (second commit)The second commit ( Two new issues to flag: 9. Prompt history only shows messages whose content has been loaded — non-deterministic results
When
The popup should either fetch all user message content from the API when it opens, or clearly indicate that only recent messages are available. Neither option is ideal — the first adds a potentially expensive API call for a secondary feature, while the second surfaces an internal implementation detail as a visible UX limitation. This may be worth a design discussion before settling on an approach. twicc/frontend/src/components/PromptHistoryPickerPopup.vue Lines 67 to 86 in 2f58d4e 10. Mobile support: the feature appears unreachable on touch devices A few questions about how this works on mobile:
twicc/frontend/src/components/PromptHistoryPickerPopup.vue Lines 476 to 500 in 2f58d4e twicc/frontend/src/components/PromptHistoryPickerPopup.vue Lines 583 to 594 in 2f58d4e
If this is intentionally desktop/keyboard-only, it might be worth documenting. If not, at minimum a tap on an item row should trigger the default action (insert), and there should be an alternative way to open the popup (e.g., a toolbar button). 🤖 Generated with Claude Code - If this code review was useful, please react with 👍. Otherwise, react with 👎. |
Add GET /api/.../user-messages/ endpoint that returns paginated user message texts with offset/limit, search filtering (q param), and both filtered index and original chronological index in the response. Rewrite the prompt history popup to use virtual scrolling: fixed-height items positioned absolutely in a sized viewport, pages of 100 fetched on demand as the user scrolls, with debounced server-side search.
Add a toolbar button (clock-rotate-left icon) to open the prompt history picker, making it accessible on touch devices without Alt+PageUp. Add tap-to-select interaction: first tap activates an item and shows action buttons, second tap inserts. Uses a confirmed index to prevent immediate insertion on first tap.
Summary
Test plan
🤖 Generated with Claude Code