[PR #3899] [MERGED] Fix Prose Guardian swipe saves and fenced code overflow #6146

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

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/3899
Author: @SpicyMarinara
Created: 7/21/2026
Status: ✅ Merged
Merged: 7/21/2026
Merged by: @SpicyMarinara

Base: staging ← Head: fix/3897-3898-followups


📝 Commits (1)

  • aab4109 fix chat metadata swipe race and fenced code overflow

📊 Changes

6 files changed (+105 additions, -6 deletions)

View changed files

📝 packages/client/src/components/chat/ChatMessage.tsx (+1 -1)
📝 packages/client/src/components/chat/ChatSettingsDrawer.tsx (+20 -5)
📝 packages/client/src/hooks/use-generate.ts (+5 -0)
➕ packages/client/src/lib/chat-metadata-save-barrier.ts (+29 -0)
📝 packages/client/src/styles/globals.css (+9 -0)
📝 scripts/regressions/open-issues.regression.ts (+41 -0)

📄 Description

Why

Prose Guardian preferences saved on field blur could race a swipe/regeneration request, so the new swipe used the previous server-side settings even though the UI soon showed the update as saved. Fenced Markdown code blocks could still force iOS message bubbles wider than the viewport because their flex ancestors retained min-content sizing.

Closes #3897
Closes #3898

What changed

  • register Prose Guardian metadata saves synchronously and serialize them per chat
  • wait for those saves before normal generation and manual agent retry requests
  • constrain message body and bubble flex sizing
  • make fenced code blocks use a border-box, container-width scrolling surface
  • add regression coverage for the save barrier and fenced-code containment

Automated validation

  • pnpm regression:issues — passed
  • pnpm check — passed
  • git diff --check — passed
  • pnpm smoke:ui — 72 passed, 47 skipped, 3 unrelated failures in existing Roleplay setup/Noodle tests; the relevant Roleplay rewrite-streaming test passed

GitHub pnpm-validate did not reach validation because onnxruntime-node timed out downloading during pnpm install.

Manual verification

  • In an open Chat Settings drawer, edit a Prose Guardian preference and immediately create a new swipe; verify the agent prompt uses the edited value.
  • Repeat with a manual Prose Guardian retry.
  • On iOS Safari, render a fenced code block containing one very long unbroken line; verify the message stays inside the viewport and the code block scrolls horizontally.
  • Verify inline code still wraps without widening the message.

Summary by CodeRabbit

  • Bug Fixes

    • Improved chat message and code block sizing in constrained layouts to prevent overflow.
    • Ensured Prose Guardian settings are saved in order before chat generation or retries begin.
    • Prevented generation from starting while pending chat metadata updates remain incomplete.
  • Tests

    • Added regression coverage for metadata save ordering and markdown content sizing.

🔄 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/3899 **Author:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Created:** 7/21/2026 **Status:** ✅ Merged **Merged:** 7/21/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `staging` ← **Head:** `fix/3897-3898-followups` --- ### 📝 Commits (1) - [`aab4109`](https://github.com/Pasta-Devs/Marinara-Engine/commit/aab4109da455f5526189058fb75861bd8b34a7f1) fix chat metadata swipe race and fenced code overflow ### 📊 Changes **6 files changed** (+105 additions, -6 deletions) <details> <summary>View changed files</summary> 📝 `packages/client/src/components/chat/ChatMessage.tsx` (+1 -1) 📝 `packages/client/src/components/chat/ChatSettingsDrawer.tsx` (+20 -5) 📝 `packages/client/src/hooks/use-generate.ts` (+5 -0) ➕ `packages/client/src/lib/chat-metadata-save-barrier.ts` (+29 -0) 📝 `packages/client/src/styles/globals.css` (+9 -0) 📝 `scripts/regressions/open-issues.regression.ts` (+41 -0) </details> ### 📄 Description ## Why Prose Guardian preferences saved on field blur could race a swipe/regeneration request, so the new swipe used the previous server-side settings even though the UI soon showed the update as saved. Fenced Markdown code blocks could still force iOS message bubbles wider than the viewport because their flex ancestors retained min-content sizing. Closes #3897 Closes #3898 ## What changed - register Prose Guardian metadata saves synchronously and serialize them per chat - wait for those saves before normal generation and manual agent retry requests - constrain message body and bubble flex sizing - make fenced code blocks use a border-box, container-width scrolling surface - add regression coverage for the save barrier and fenced-code containment ## Automated validation - `pnpm regression:issues` — passed - `pnpm check` — passed - `git diff --check` — passed - `pnpm smoke:ui` — 72 passed, 47 skipped, 3 unrelated failures in existing Roleplay setup/Noodle tests; the relevant Roleplay rewrite-streaming test passed GitHub `pnpm-validate` did not reach validation because `onnxruntime-node` timed out downloading during `pnpm install`. ## Manual verification - [ ] In an open Chat Settings drawer, edit a Prose Guardian preference and immediately create a new swipe; verify the agent prompt uses the edited value. - [ ] Repeat with a manual Prose Guardian retry. - [ ] On iOS Safari, render a fenced code block containing one very long unbroken line; verify the message stays inside the viewport and the code block scrolls horizontally. - [ ] Verify inline code still wraps without widening the message. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Bug Fixes** * Improved chat message and code block sizing in constrained layouts to prevent overflow. * Ensured Prose Guardian settings are saved in order before chat generation or retries begin. * Prevented generation from starting while pending chat metadata updates remain incomplete. * **Tests** * Added regression coverage for metadata save ordering and markdown content sizing. <!-- 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:07:32 +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#6146
No description provided.