[PR #3241] [MERGED] fix: use mari-message-content styles for File Browser markdown preview #5858

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

📋 Pull Request Information

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

Base: staging ← Head: fix/file-editor-markdown-preview-styles


📝 Commits (1)

  • 7f32fea fix: use mari-message-content styles for File Browser markdown preview

📊 Changes

1 file changed (+1 additions, -1 deletions)

View changed files

📝 packages/client/src/components/game-assets/FileEditorModal.tsx (+1 -1)

📄 Description

Fixes #3240

Summary

One-line class swap in FileEditorModal.tsx: the markdown preview wrapper used Tailwind prose prose-sm max-w-none classes, but @tailwindcss/typography is not installed anywhere in the client, so those classes were inert and the preview rendered as unstyled plain text. The wrapper now uses mari-message-content whitespace-pre-wrap break-words text-sm, the same pattern every working markdown consumer uses (ChatMessage, GameJournal, HomeProfessorMariChat).

Why

Users previewing .md files in the Game Assets file browser see headings, lists, and tables collapse into undifferentiated plain text, while the exact same markdown renders correctly in chat. All of the markdown renderer's output styles (.mari-md-heading, .mari-md-ul, .mari-md-table, …) are scoped under .mari-message-content in globals.css, so the wrapper must carry that class for any styling to apply. The renderer also joins paragraph runs with \n, which is why the wrapper additionally needs whitespace-pre-wrap — without it, paragraph spacing collapses.

Test plan

  • Manually verify in browser: open a .md file in the Game Assets file browser, switch to Preview, and confirm headings, bullet lists, and tables are styled (matching how the same markdown looks in a chat message)
  • Manually verify paragraph spacing: a file with multiple paragraphs separated by blank lines shows visible spacing between them
  • Manually verify in both light and dark mode
  • Manually verify at a narrow/mobile viewport (~400px) that long lines wrap instead of overflowing the modal

pnpm check passes locally.

UI Evidence

image image

Summary by CodeRabbit

  • Style
    • Updated the Markdown preview appearance in the file editor to use consistent message content styling while preserving wrapping, text sizing, and color behavior.

🔄 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/3241 **Author:** [@kolacheee](https://github.com/kolacheee) **Created:** 7/5/2026 **Status:** ✅ Merged **Merged:** 7/5/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `staging` ← **Head:** `fix/file-editor-markdown-preview-styles` --- ### 📝 Commits (1) - [`7f32fea`](https://github.com/Pasta-Devs/Marinara-Engine/commit/7f32fea003d405371e3e5e4f99c062b02dc387d2) fix: use mari-message-content styles for File Browser markdown preview ### 📊 Changes **1 file changed** (+1 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `packages/client/src/components/game-assets/FileEditorModal.tsx` (+1 -1) </details> ### 📄 Description Fixes #3240 ## Summary One-line class swap in `FileEditorModal.tsx`: the markdown preview wrapper used Tailwind `prose prose-sm max-w-none` classes, but `@tailwindcss/typography` is not installed anywhere in the client, so those classes were inert and the preview rendered as unstyled plain text. The wrapper now uses `mari-message-content whitespace-pre-wrap break-words text-sm`, the same pattern every working markdown consumer uses (`ChatMessage`, `GameJournal`, `HomeProfessorMariChat`). ## Why Users previewing `.md` files in the Game Assets file browser see headings, lists, and tables collapse into undifferentiated plain text, while the exact same markdown renders correctly in chat. All of the markdown renderer's output styles (`.mari-md-heading`, `.mari-md-ul`, `.mari-md-table`, …) are scoped under `.mari-message-content` in `globals.css`, so the wrapper must carry that class for any styling to apply. The renderer also joins paragraph runs with `\n`, which is why the wrapper additionally needs `whitespace-pre-wrap` — without it, paragraph spacing collapses. ## Test plan - [x] Manually verify in browser: open a `.md` file in the Game Assets file browser, switch to Preview, and confirm headings, bullet lists, and tables are styled (matching how the same markdown looks in a chat message) - [x] Manually verify paragraph spacing: a file with multiple paragraphs separated by blank lines shows visible spacing between them - [x] Manually verify in both light and dark mode - [x] Manually verify at a narrow/mobile viewport (~400px) that long lines wrap instead of overflowing the modal `pnpm check` passes locally. ## UI Evidence <img width="1027" height="820" alt="image" src="https://github.com/user-attachments/assets/989a27c9-b6d5-45e0-8b2c-50051f8c654a" /> <img width="389" height="587" alt="image" src="https://github.com/user-attachments/assets/3339b388-5f9f-493c-a9f5-faf4ae060ff2" /> <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Style** * Updated the Markdown preview appearance in the file editor to use consistent message content styling while preserving wrapping, text sizing, and color behavior. <!-- 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:20:14 +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#5858
No description provided.