[PR #703] [MERGED] fix(chat): make Up-Arrow recall always available and edit any role #4733

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

📋 Pull Request Information

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

Base: main ← Head: fix/up-arrow-edit-decouple-toggle


📝 Commits (1)

  • a86f189 fix(chat): make Up-Arrow recall work on its own toggle and edit any role

📊 Changes

5 files changed (+91 additions, -40 deletions)

View changed files

📝 packages/client/src/components/chat/ChatArea.tsx (+66 -34)
📝 packages/client/src/components/chat/ChatMessage.tsx (+2 -2)
📝 packages/client/src/components/chat/ConversationMessage.tsx (+2 -2)
📝 packages/client/src/components/panels/SettingsPanel.tsx (+10 -1)
📝 packages/client/src/stores/ui.store.ts (+11 -1)

📄 Description

Why

PR #639 introduced an Up-Arrow shortcut to recall the last message for inline editing, but two problems made it look broken after merge:

  1. The shortcut was gated behind the existing Intuitive swipe navigation toggle, which defaults to false. Anyone who hadn't already opted into swipe nav pressed Up Arrow and saw nothing happen.
  2. The help-text update describing the new behavior was attached to that same disabled toggle, so the discoverability hint was hidden behind the off switch too.

It also only ever recalled the most recent user message, which surprised users who expected "edit the last thing in the chat" to mean the last bubble period — including the AI's response.

What this changes

  • Adds a dedicated "Up Arrow edits last message" toggle in Settings, defaulted on, with its own help text. UI store version bumped 27 -> 28 so existing users pick up the new default.
  • Splits the keydown handler in ChatArea so the Up-Arrow recall runs in its own effect, independent of the swipe-nav toggle and effect.
  • Targets the most recent visible message regardless of role — user or assistant — skipping hiddenFromUser system messages and bailing while a generation is streaming or an agent is processing.
  • Drops the user-only guard from the per-message event listeners in ChatMessage and ConversationMessage so any role responds to the recall event, matching the existing Pencil button behavior.
  • Reverts the Intuitive swipe navigation help text to swipe-only wording now that Up Arrow lives in its own setting.

Linked issue

No GitHub issue was opened for this — it's a follow-up to the merged PR #639. One should be filed if we want to track the regression formally.

Summary by CodeRabbit

  • New Features
    • Added "Up Arrow edits last message" setting toggle in Settings to quickly edit the most recent message with keyboard shortcut
    • Up Arrow now supports editing both user and assistant messages in Conversation and Roleplay modes
    • Setting is configurable and persists across sessions

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/703 **Author:** [@LukaTheHero](https://github.com/LukaTheHero) **Created:** 5/11/2026 **Status:** ✅ Merged **Merged:** 5/11/2026 **Merged by:** [@LukaTheHero](https://github.com/LukaTheHero) **Base:** `main` ← **Head:** `fix/up-arrow-edit-decouple-toggle` --- ### 📝 Commits (1) - [`a86f189`](https://github.com/Pasta-Devs/Marinara-Engine/commit/a86f1890913f0f0594acbf864fed547aa1d515f1) fix(chat): make Up-Arrow recall work on its own toggle and edit any role ### 📊 Changes **5 files changed** (+91 additions, -40 deletions) <details> <summary>View changed files</summary> 📝 `packages/client/src/components/chat/ChatArea.tsx` (+66 -34) 📝 `packages/client/src/components/chat/ChatMessage.tsx` (+2 -2) 📝 `packages/client/src/components/chat/ConversationMessage.tsx` (+2 -2) 📝 `packages/client/src/components/panels/SettingsPanel.tsx` (+10 -1) 📝 `packages/client/src/stores/ui.store.ts` (+11 -1) </details> ### 📄 Description ## Why PR #639 introduced an Up-Arrow shortcut to recall the last message for inline editing, but two problems made it look broken after merge: 1. The shortcut was gated behind the existing **Intuitive swipe navigation** toggle, which defaults to `false`. Anyone who hadn't already opted into swipe nav pressed Up Arrow and saw nothing happen. 2. The help-text update describing the new behavior was attached to that same disabled toggle, so the discoverability hint was hidden behind the off switch too. It also only ever recalled the most recent **user** message, which surprised users who expected "edit the last thing in the chat" to mean the last bubble period — including the AI's response. ## What this changes - Adds a dedicated **"Up Arrow edits last message"** toggle in Settings, defaulted **on**, with its own help text. UI store version bumped `27 -> 28` so existing users pick up the new default. - Splits the keydown handler in `ChatArea` so the Up-Arrow recall runs in its own effect, independent of the swipe-nav toggle and effect. - Targets the most recent visible message regardless of role — user or assistant — skipping `hiddenFromUser` system messages and bailing while a generation is streaming or an agent is processing. - Drops the user-only guard from the per-message event listeners in `ChatMessage` and `ConversationMessage` so any role responds to the recall event, matching the existing Pencil button behavior. - Reverts the **Intuitive swipe navigation** help text to swipe-only wording now that Up Arrow lives in its own setting. ## Linked issue No GitHub issue was opened for this — it's a follow-up to the merged PR #639. One should be filed if we want to track the regression formally. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Added "Up Arrow edits last message" setting toggle in Settings to quickly edit the most recent message with keyboard shortcut * Up Arrow now supports editing both user and assistant messages in Conversation and Roleplay modes * Setting is configurable and persists across sessions [![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/703) <!-- 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:12 +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#4733
No description provided.