[PR #639] [MERGED] feat(chat): up-arrow recalls last user message for editing #4709

Closed
opened 2026-10-22 04:10:00 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/639
Author: @LukaTheHero
Created: 5/10/2026
Status: ✅ Merged
Merged: 5/10/2026
Merged by: @SpicyMarinara

Base: main ← Head: feat/intuitive-up-arrow-edit-last-message


📝 Commits (1)

  • af9409a feat(chat): up-arrow recalls last user message for editing

📊 Changes

4 files changed (+71 additions, -2 deletions)

View changed files

📝 packages/client/src/components/chat/ChatArea.tsx (+48 -1)
📝 packages/client/src/components/chat/ChatMessage.tsx (+10 -0)
📝 packages/client/src/components/chat/ConversationMessage.tsx (+12 -0)
📝 packages/client/src/components/panels/SettingsPanel.tsx (+1 -1)

📄 Description

Summary

Extends the existing Intuitive swipe navigation toggle so that, in Conversation and Roleplay modes, pressing the Up Arrow key opens the most recent user message in inline edit mode — shell/Discord style.

  • Recall only fires when the chat input is empty, so plain typing is unaffected (Up still moves the cursor inside non-empty textareas).
  • Inputs, single-line <input>s, selects, and contenteditable regions are skipped, so other text fields are not hijacked.
  • Modifier keys (Ctrl/Alt/Meta/Shift) and key-repeat are ignored.
  • Honors the same blockers as Left/Right swipe navigation (settings drawer, files drawer, gallery, wizard, multi-select, delete dialog, peek-prompt, encounter, etc.).
  • Help text on the Intuitive swipe navigation toggle (? tooltip in Settings) now mentions the new Up Arrow behavior.

Implementation

  • ChatArea.tsx — Adds latestUserMessageForEdit memo and an ArrowUp branch in the existing intuitive-swipe keydown effect. On a valid press it dispatches a marinara:start-edit-message window event with the user message id.
  • ChatMessage.tsx (Roleplay) — Listens for the event and calls startEditing() when the id matches and the message is from the user.
  • ConversationMessage.tsx (Conversation) — Same listener; defers to onEditClick when present so SplitMessageGroup's group-wide editor is used for split messages.
  • SettingsPanel.tsx — Updates the tooltip on the Intuitive swipe navigation toggle.

No new state, no new dependencies. The feature is gated behind the existing toggle and the same chatMode === "conversation" || isRoleplay check used for swipe navigation.

Notes

  • No linked issue/feature request — one should be opened to track this if the project's convention requires it.
  • No new automated tests; the project does not have a frontend test suite (per CLAUDE.md).
  • A separate, pre-existing build issue (GameSurface chunk over the 500 kB bundle-budget plugin limit) currently fails pnpm build on main. It is unrelated to this PR and should be addressed in its own change.

Summary by CodeRabbit

Release Notes

  • New Features

    • Added Up Arrow keyboard shortcut to edit your most recent message instantly when the chat input is empty, enabling quick corrections and refinements.
  • Documentation

    • Updated settings help text to document the new Up Arrow editing behavior alongside existing keyboard and touch navigation features.

Review Change Stack


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Pasta-Devs/Marinara-Engine/pull/639 **Author:** [@LukaTheHero](https://github.com/LukaTheHero) **Created:** 5/10/2026 **Status:** ✅ Merged **Merged:** 5/10/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `main` ← **Head:** `feat/intuitive-up-arrow-edit-last-message` --- ### 📝 Commits (1) - [`af9409a`](https://github.com/Pasta-Devs/Marinara-Engine/commit/af9409af207a3434bb44656bccb5e5cd1efadd61) feat(chat): up-arrow recalls last user message for editing ### 📊 Changes **4 files changed** (+71 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `packages/client/src/components/chat/ChatArea.tsx` (+48 -1) 📝 `packages/client/src/components/chat/ChatMessage.tsx` (+10 -0) 📝 `packages/client/src/components/chat/ConversationMessage.tsx` (+12 -0) 📝 `packages/client/src/components/panels/SettingsPanel.tsx` (+1 -1) </details> ### 📄 Description ## Summary Extends the existing **Intuitive swipe navigation** toggle so that, in Conversation and Roleplay modes, pressing the **Up Arrow** key opens the most recent user message in inline edit mode — shell/Discord style. - Recall only fires when the chat input is empty, so plain typing is unaffected (Up still moves the cursor inside non-empty textareas). - Inputs, single-line `<input>`s, selects, and `contenteditable` regions are skipped, so other text fields are not hijacked. - Modifier keys (Ctrl/Alt/Meta/Shift) and key-repeat are ignored. - Honors the same blockers as Left/Right swipe navigation (settings drawer, files drawer, gallery, wizard, multi-select, delete dialog, peek-prompt, encounter, etc.). - Help text on the **Intuitive swipe navigation** toggle (`?` tooltip in Settings) now mentions the new Up Arrow behavior. ## Implementation - `ChatArea.tsx` — Adds `latestUserMessageForEdit` memo and an `ArrowUp` branch in the existing intuitive-swipe keydown effect. On a valid press it dispatches a `marinara:start-edit-message` window event with the user message id. - `ChatMessage.tsx` (Roleplay) — Listens for the event and calls `startEditing()` when the id matches and the message is from the user. - `ConversationMessage.tsx` (Conversation) — Same listener; defers to `onEditClick` when present so `SplitMessageGroup`'s group-wide editor is used for split messages. - `SettingsPanel.tsx` — Updates the tooltip on the Intuitive swipe navigation toggle. No new state, no new dependencies. The feature is gated behind the existing toggle and the same `chatMode === "conversation" || isRoleplay` check used for swipe navigation. ## Notes - No linked issue/feature request — one should be opened to track this if the project's convention requires it. - No new automated tests; the project does not have a frontend test suite (per CLAUDE.md). - A separate, pre-existing build issue (`GameSurface` chunk over the 500 kB bundle-budget plugin limit) currently fails `pnpm build` on `main`. It is unrelated to this PR and should be addressed in its own change. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit ## Release Notes * **New Features** * Added Up Arrow keyboard shortcut to edit your most recent message instantly when the chat input is empty, enabling quick corrections and refinements. * **Documentation** * Updated settings help text to document the new Up Arrow editing behavior alongside existing keyboard and touch navigation features. [![Review Change Stack](https://storage.googleapis.com/coderabbit_public_assets/review-stack-in-coderabbit-ui.svg)](https://app.coderabbit.ai/change-stack/Pasta-Devs/Marinara-Engine/pull/639) <!-- end of auto-generated comment: release notes by coderabbit.ai --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-22 04:10:00 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Engine#4709
No description provided.