[PR #5018] [MERGED] fix: preserve caret in expanded editors after quotes #6592

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

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/5018
Author: @SpicyMarinara
Created: 8/14/2026
Status: ✅ Merged
Merged: 8/14/2026
Merged by: @SpicyMarinara

Base: staging ← Head: agent/5017-expanded-editor-quote-caret


📝 Commits (2)

  • 71243ad chore: coordinate expanded editor caret fix
  • 3c8d76d fix: preserve expanded editor caret after quotes

📊 Changes

3 files changed (+54 additions, -4 deletions)

View changed files

📝 CHANGELOG.md (+1 -0)
📝 e2e/core-flows.e2e.ts (+49 -1)
📝 packages/client/src/components/ui/MacroTextarea.tsx (+4 -3)

📄 Description

Linked issue

Closes #4656

Why this change

  • Typing an ASCII single or double quote in the middle of text in an expanded Character or Persona editor could move the caret to the end.
  • ExpandedMacroEditor stored the raw input before the parent synchronously applied typographic quote formatting, so React restored the raw value and defeated the pending caret restoration.

What changed

  • Let the parent formatter run first, then mirror the resulting textarea value into the expanded editor local state.
  • Added focused browser coverage for both quote characters at a mid-text caret position.
  • Added the user-facing fix to the Unreleased changelog.

Validation

  • pnpm check passes locally
  • Container (Docker / Podman) built and ran without issue
  • Ran the app, clicked through the changes manually
  • Checked edge cases (light + dark mode, mobile viewport, empty states, error paths)
  • Above manual verification completed (describe below)
  • Read and followed CONTRIBUTING.md

Manual verification notes

  • Automated desktop Chromium proof passes for both ASCII double quote and apostrophe in the middle of an expanded Character description with typographic quote formatting enabled.
  • The test asserts the normalized quote value and that selectionStart and selectionEnd remain immediately after the inserted quote.
  • pnpm check passes locally.

Docs and release impact

  • No docs changes needed
  • Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed
  • Translated docs on the docs-i18n branch updated to match, or a docs-i18n follow-up issue opened
  • Version/release files updated (only if this PR includes a version bump)

UI evidence (if applicable)

  • No visual layout or copy changes. This is a focused input-state and caret regression fix.

Summary by CodeRabbit

  • Bug Fixes

    • Preserved the caret position when typing single or double quotation marks in expanded Character and Persona editors.
    • Improved text editing so automatic quote formatting no longer moves the cursor unexpectedly.
  • Tests

    • Added end-to-end coverage for quote replacement and caret placement in expanded character description editors.

🔄 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/5018 **Author:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Created:** 8/14/2026 **Status:** ✅ Merged **Merged:** 8/14/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `staging` ← **Head:** `agent/5017-expanded-editor-quote-caret` --- ### 📝 Commits (2) - [`71243ad`](https://github.com/Pasta-Devs/Marinara-Engine/commit/71243ad1345a36d0874976f413564e5685fedda3) chore: coordinate expanded editor caret fix - [`3c8d76d`](https://github.com/Pasta-Devs/Marinara-Engine/commit/3c8d76dbb05b4980772327c6b879e561a0916db7) fix: preserve expanded editor caret after quotes ### 📊 Changes **3 files changed** (+54 additions, -4 deletions) <details> <summary>View changed files</summary> 📝 `CHANGELOG.md` (+1 -0) 📝 `e2e/core-flows.e2e.ts` (+49 -1) 📝 `packages/client/src/components/ui/MacroTextarea.tsx` (+4 -3) </details> ### 📄 Description ## Linked issue Closes #4656 ## Why this change - Typing an ASCII single or double quote in the middle of text in an expanded Character or Persona editor could move the caret to the end. - ExpandedMacroEditor stored the raw input before the parent synchronously applied typographic quote formatting, so React restored the raw value and defeated the pending caret restoration. ## What changed - Let the parent formatter run first, then mirror the resulting textarea value into the expanded editor local state. - Added focused browser coverage for both quote characters at a mid-text caret position. - Added the user-facing fix to the Unreleased changelog. ## Validation - [ ] pnpm check passes locally - [ ] Container (Docker / Podman) built and ran without issue - [ ] Ran the app, clicked through the changes manually - [ ] Checked edge cases (light + dark mode, mobile viewport, empty states, error paths) - [ ] Above manual verification completed (describe below) - [ ] Read and followed CONTRIBUTING.md ### Manual verification notes - Automated desktop Chromium proof passes for both ASCII double quote and apostrophe in the middle of an expanded Character description with typographic quote formatting enabled. - The test asserts the normalized quote value and that selectionStart and selectionEnd remain immediately after the inserted quote. - pnpm check passes locally. ## Docs and release impact - [ ] No docs changes needed - [ ] Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed - [ ] Translated docs on the docs-i18n branch updated to match, or a docs-i18n follow-up issue opened - [ ] Version/release files updated (only if this PR includes a version bump) ## UI evidence (if applicable) - No visual layout or copy changes. This is a focused input-state and caret regression fix. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Bug Fixes** * Preserved the caret position when typing single or double quotation marks in expanded Character and Persona editors. * Improved text editing so automatic quote formatting no longer moves the cursor unexpectedly. * **Tests** * Added end-to-end coverage for quote replacement and caret placement in expanded character description editors. <!-- 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-23 04:11:53 +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#6592
No description provided.