[PR #2809] [MERGED] Preserve caret while formatting editor quotes #5742

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

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/2809
Author: @SpicyMarinara
Created: 6/22/2026
Status: ✅ Merged
Merged: 6/22/2026
Merged by: @SpicyMarinara

Base: staging ← Head: codex/preserve-quote-caret


📝 Commits (1)

  • 73ca09f Preserve caret while formatting quotes

📊 Changes

3 files changed (+66 additions, -34 deletions)

View changed files

📝 packages/client/src/hooks/use-quote-formatter.ts (+7 -31)
➕ packages/client/src/lib/text-selection.ts (+56 -0)
📝 packages/client/src/lib/textarea-quotes.ts (+3 -3)

📄 Description

Linked issue

No linked issue; maintainer-requested bug fix from direct editor report.

Why this change

  • Typing straight or typographic quote characters inside card and preset editor fields could push the caret to the end of the field after quote formatting.

What changed

  • Added a shared text-selection helper that captures and restores input/textarea selections across React controlled-value renders.
  • Updated textarea quote formatting to restore the caret after the DOM value and React state settle.
  • Reused the same post-render selection restoration in the quote formatter hook used by character and persona editors.

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

  • pnpm --filter @marinara-engine/client lint
  • pnpm --filter @marinara-engine/client exec tsc -b --pretty false
  • Browser manual verification not run in this pass.

Docs and release impact

  • No docs changes needed
  • Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed
  • Version/release files updated (only if this PR includes a version bump)

UI evidence (if applicable)

N/A - behavioral caret fix only.


🔄 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/2809 **Author:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Created:** 6/22/2026 **Status:** ✅ Merged **Merged:** 6/22/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `staging` ← **Head:** `codex/preserve-quote-caret` --- ### 📝 Commits (1) - [`73ca09f`](https://github.com/Pasta-Devs/Marinara-Engine/commit/73ca09f9c5a5221f7a054670e49063a213ec4aaf) Preserve caret while formatting quotes ### 📊 Changes **3 files changed** (+66 additions, -34 deletions) <details> <summary>View changed files</summary> 📝 `packages/client/src/hooks/use-quote-formatter.ts` (+7 -31) ➕ `packages/client/src/lib/text-selection.ts` (+56 -0) 📝 `packages/client/src/lib/textarea-quotes.ts` (+3 -3) </details> ### 📄 Description ## Linked issue No linked issue; maintainer-requested bug fix from direct editor report. ## Why this change - Typing straight or typographic quote characters inside card and preset editor fields could push the caret to the end of the field after quote formatting. ## What changed - Added a shared text-selection helper that captures and restores input/textarea selections across React controlled-value renders. - Updated textarea quote formatting to restore the caret after the DOM value and React state settle. - Reused the same post-render selection restoration in the quote formatter hook used by character and persona editors. ## 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 - `pnpm --filter @marinara-engine/client lint` - `pnpm --filter @marinara-engine/client exec tsc -b --pretty false` - Browser manual verification not run in this pass. ## Docs and release impact - [ ] No docs changes needed - [ ] Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed - [ ] Version/release files updated (only if this PR includes a version bump) ## UI evidence (if applicable) N/A - behavioral caret fix only. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-22 04:19:03 +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#5742
No description provided.