[PR #8104] [MERGED] fix(chat): wrap fenced code within the message column #8104

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

📋 Pull Request Information

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

Base: staging ← Head: fix/fenced-code-wrapping


📝 Commits (3)

  • b2fad0b test(chat): reproduce desktop fenced code overflow
  • c8b06dd fix(chat): wrap fenced code at every screen width
  • 42996e4 test(chat): align code block guard with shared wrapping

📊 Changes

3 files changed (+114 additions, -19 deletions)

View changed files

➕ e2e/code-block-wrapping.e2e.ts (+100 -0)
📝 packages/client/src/styles/globals.css (+4 -13)
📝 scripts/regressions/open-issues.regression.ts (+10 -6)

📄 Description

Linked issue

Closes #8103

Why this change

Long paragraphs inside triple-backtick code fences run horizontally beyond the readable message area on desktop. The shared stylesheet previously enabled wrapping only below 768px, so the same message behaved differently on a phone.

What changed

  • Reuse the existing wrapping rules at every width: long paragraphs and unbroken strings wrap inside fenced code blocks.
  • Update the existing CSS regression guard to require wrapping at the top level and inherited whitespace on the code child; bound the mobile-rule check to its actual media block.
  • Preserve literal indentation, blank lines and code text; nested code inherits the block's whitespace behavior.
  • Add browser regression coverage for Conversation and Roleplay, including plain Markdown and authored HTML content. Roleplay exercises both Markdown rendering paths; Conversation intentionally displays authored HTML literally.

Validation

  • pnpm install --frozen-lockfile: passed.
  • pnpm check: passed, including localization, formatting, types and production builds. An existing HomeProfessorMariChat.tsx:380 hook-dependency warning remains (no errors).
  • pnpm regression:ui e2e/code-block-wrapping.e2e.ts e2e/markdown-blocks.e2e.ts --project=desktop-chromium --project=mobile-chromium --project=mobile-webkit --workers=2: 12/12 passed, covering both themes, text equality, actual line wrapping, viewport containment and existing Markdown block spacing.
  • pnpm smoke:ui: 7/7 passed, including Game narration.
  • Fresh local CodeRabbit against 0eaca9efe3a1374733753c366a864abbd72796d7: 3 files reviewed, one trivial suggestion rejected with evidence. The suggestion asks for phone-width coverage; this spec was run on the configured mobile Chromium (390px) and mobile WebKit projects in both themes, as recorded above and shown in the screenshots.
  • Before-fix desktop Conversation control failed because the long paragraph occupied one visual line. Browser logs/traces and screenshots were preserved. An initial Game probe assumed ordinary message rows; inspection confirmed its separate narration formatter, so the focused test now targets the two modes that use this renderer. No application workaround, skip or timeout change was introduced.

Browser runs used disposable data, ports 7850–7853 and at most two workers. Screenshots were visually inspected.

  • node scripts/run-regressions.mjs --filter scripts/regressions/open-issues.regression.ts: 1/1 passed after reproducing its stale overflow-x: auto assertion. Final pnpm check also passed after this guard repair. The CSS and browser spec are unchanged from the 12/12 browser run above.

Manual verification still needed

  • Manually verify a long fenced message in your usual Conversation layout.
  • Manually verify selecting/copying indented code and blank lines.
  • Manually verify on a physical mobile device; local mobile checks use browser emulation.

Docs and release impact

No documentation, new UI copy or release metadata is needed for this layout correction.

UI evidence

Before/after screenshots are in a self-contained HTML proof file; download it to view the embedded PNGs. All four published PNGs were verified byte-for-byte against their local originals. Game narration uses a separate formatter and does not render these fenced-code message rows; its narration is outside this CSS fix.


🔄 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/8104 **Author:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Created:** 10/22/2026 **Status:** ✅ Merged **Merged:** 10/22/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `staging` ← **Head:** `fix/fenced-code-wrapping` --- ### 📝 Commits (3) - [`b2fad0b`](https://github.com/Pasta-Devs/Marinara-Engine/commit/b2fad0b2f6fe1076f66d5cfb10cd6fd8ee81ec96) test(chat): reproduce desktop fenced code overflow - [`c8b06dd`](https://github.com/Pasta-Devs/Marinara-Engine/commit/c8b06dd5e7e7fa3acfa0ab419d83907ea46e426d) fix(chat): wrap fenced code at every screen width - [`42996e4`](https://github.com/Pasta-Devs/Marinara-Engine/commit/42996e4c6e1d555bd302d81309f5bcfb5fbef8ac) test(chat): align code block guard with shared wrapping ### 📊 Changes **3 files changed** (+114 additions, -19 deletions) <details> <summary>View changed files</summary> ➕ `e2e/code-block-wrapping.e2e.ts` (+100 -0) 📝 `packages/client/src/styles/globals.css` (+4 -13) 📝 `scripts/regressions/open-issues.regression.ts` (+10 -6) </details> ### 📄 Description ## Linked issue Closes #8103 ## Why this change Long paragraphs inside triple-backtick code fences run horizontally beyond the readable message area on desktop. The shared stylesheet previously enabled wrapping only below 768px, so the same message behaved differently on a phone. ## What changed - Reuse the existing wrapping rules at every width: long paragraphs and unbroken strings wrap inside fenced code blocks. - Update the existing CSS regression guard to require wrapping at the top level and inherited whitespace on the code child; bound the mobile-rule check to its actual media block. - Preserve literal indentation, blank lines and code text; nested code inherits the block's whitespace behavior. - Add browser regression coverage for Conversation and Roleplay, including plain Markdown and authored HTML content. Roleplay exercises both Markdown rendering paths; Conversation intentionally displays authored HTML literally. ## Validation - `pnpm install --frozen-lockfile`: passed. - `pnpm check`: passed, including localization, formatting, types and production builds. An existing `HomeProfessorMariChat.tsx:380` hook-dependency warning remains (no errors). - `pnpm regression:ui e2e/code-block-wrapping.e2e.ts e2e/markdown-blocks.e2e.ts --project=desktop-chromium --project=mobile-chromium --project=mobile-webkit --workers=2`: **12/12 passed**, covering both themes, text equality, actual line wrapping, viewport containment and existing Markdown block spacing. - `pnpm smoke:ui`: **7/7 passed**, including Game narration. - Fresh local CodeRabbit against `0eaca9efe3a1374733753c366a864abbd72796d7`: **3 files reviewed, one trivial suggestion rejected with evidence**. The suggestion asks for phone-width coverage; this spec was run on the configured mobile Chromium (390px) and mobile WebKit projects in both themes, as recorded above and shown in the screenshots. - Before-fix desktop Conversation control failed because the long paragraph occupied one visual line. Browser logs/traces and screenshots were preserved. An initial Game probe assumed ordinary message rows; inspection confirmed its separate narration formatter, so the focused test now targets the two modes that use this renderer. No application workaround, skip or timeout change was introduced. Browser runs used disposable data, ports 7850–7853 and at most two workers. Screenshots were visually inspected. - `node scripts/run-regressions.mjs --filter scripts/regressions/open-issues.regression.ts`: **1/1 passed** after reproducing its stale `overflow-x: auto` assertion. Final `pnpm check` also passed after this guard repair. The CSS and browser spec are unchanged from the 12/12 browser run above. ### Manual verification still needed - [ ] Manually verify a long fenced message in your usual Conversation layout. - [ ] Manually verify selecting/copying indented code and blank lines. - [ ] Manually verify on a physical mobile device; local mobile checks use browser emulation. ## Docs and release impact No documentation, new UI copy or release metadata is needed for this layout correction. ## UI evidence [Before/after screenshots](https://gist.github.com/SpicyMarinara/79ba4fec67855c2bbaffda5333cbaffa) are in a self-contained HTML proof file; download it to view the embedded PNGs. All four published PNGs were verified byte-for-byte against their local originals. Game narration uses a separate formatter and does not render these fenced-code message rows; its narration is outside this CSS fix. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
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#8104
No description provided.