[PR #7514] [MERGED] fix(client): preset prompts and Example Dialogue follow the app font #7771

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

📋 Pull Request Information

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

Base: staging ← Head: fix/7438-custom-font-preset-editor


📝 Commits (2)

  • 0b398a8 fix(client): preset prompts and Example Dialogue follow the app font (#7438)
  • f4873de fix(client): keep straight quotes in prompt fields and match Expand window to the field

📊 Changes

8 files changed (+119 additions, -9 deletions)

View changed files

📝 docs/appearance/fonts.md (+2 -0)
➕ e2e/prompt-field-font.e2e.ts (+90 -0)
📝 packages/client/src/App.tsx (+6 -2)
📝 packages/client/src/components/characters/CharacterEditor.tsx (+1 -1)
📝 packages/client/src/components/presets/PresetEditor.tsx (+3 -3)
📝 packages/client/src/components/presets/PresetVariablesEditor.tsx (+2 -2)
📝 packages/client/src/components/ui/MacroTextarea.tsx (+8 -1)
📝 packages/client/src/styles/globals.css (+7 -0)

📄 Description

Important

Contributions target staging. Only SpicyMarinara may promote this repository's staging branch or a same-repository hotfix/* branch to main.
Outside and first-time contributors also require an approving review from SpicyMarinara.

Linked issue

Closes #7438

Why this change

  • The font picked in Settings > Appearance > Text & Scale > Font reaches almost every editable field, but not the preset editor's prompt fields or a character's Example Dialogue. Those fields hard-coded Tailwind's font-mono, so they stayed monospace whatever font you picked. Users who choose a font for readability had to write a custom theme to get it there.

What changed

Nothing that worked before stops working. With the default font selected, every field looks exactly as it did.

  • With a font picked in Appearance, these fields now use it, like the rest of the app:
    • Preset editor: section content, the Conversation and Game prompts, and choice option values (inline and in their expanded editor).
    • Character editor: Example Dialogue (including its Markdown preview).
    • The Expand editor window of these fields.
  • These fields use the same font stack as the rest of the app, including its "Straight Quotes" face. Typed " and ' stay straight even when the picked font draws curly quotes, so you can still see which quote is stored.
  • With the default font, they stay monospace as before.
  • Every other field's Expand editor window stays monospace, as before. This includes fields kept monospace on purpose, such as an agent's Prompt Template, the Storyboard and Secret Plot templates, the chat summary fields, and the Custom Parameters and Custom Headers JSON.
  • Fields that are code-like keep monospace in every case: variable names, the multi-select separator, code blocks, regex, JSON and IDs.
  • A custom CSS theme that sets a textarea font still overrides these fields, as it did before. The new mari-prompt-font rule is a Tailwind utility, in the same cascade layer as the font-mono it replaces. A theme that changes the app font through --font-y2k changes these fields too.
  • Some prompt fields outside the preset and character editors were out of scope and stay monospace. These include the per-chat Conversation prompt, Game extra prompt and impersonate template in Chat Settings. They can switch to the same class in a follow-up if wanted.
  • docs/appearance/fonts.md now says which fields follow the picked font, and that other prompt fields stay monospace. Translation follow-up: #7515.

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

Commands run by the agent (not a substitute for the boxes above):

  • New e2e/prompt-field-font.e2e.ts. It creates a preset with one section and a character with Example Dialogue and First Message, and reads getComputedStyle().fontFamily.
    • With the default font, the section content and Conversation/Game prompts start with ui-monospace.
    • After setFontFamily("Prompt Font Fixture"), those three fields, the section's Expand editor window and Example Dialogue start with "Straight Quotes", "Prompt Font Fixture".
    • First Message, which was never monospace inline, still opens a monospace Expand editor window.
    • playwright test e2e/prompt-field-font.e2e.ts passed with the fix on desktop-chromium, mobile-chromium and mobile-webkit (head f4873de7a).
    • Same test against origin/staging client code: failed as expected. It received ui-monospace, SFMono-Regular, …, monospace after the font was set.
    • Same test against the first PR commit 0b398a861: failed as expected. Prompt fields read "Prompt Font Fixture", "Straight Quotes", …, so the picked font's quote glyphs won. With only the Expand window change reverted, First Message's Expand window read Straight Quotes, Prompt Font Fixture, … instead of monospace.
  • pnpm check: passed (exit 0). The built CSS has .mari-prompt-font{font-family:var(--font-prompt,var(--font-mono))} inside @layer utilities. App.tsx sets --font-prompt: var(--font-y2k) only while a font is picked.
  • node ./scripts/run-regressions.mjs --filter <name>, each passed: chat-widget-style-persistence, frozen-server-client-timeouts, prompt.regression (7/7), prompt-token-counters, roleplay-streaming, tracker-gallery-ui, floating-window, mobile-tracker-help-layout, mobile-safe-area-inset, persona-client-contract, avatar-crop-contract, music-dj-and-floating-ui, onboarding-s1, mari-polish, assigned-issue-sweep, character-bulk-tags, capability-package-chat-controls, and the source-scan guards open-issues, agent-activation and spatial-context.
  • Local CodeRabbit (coderabbit review --agent --committed --base-commit <merge-base>) at f4873de7a: 1 trivial finding, not applied. It asked the e2e to load a real fixture font and check the rendered glyphs. The fix only changes which font-family declaration applies, which is exactly what the computed font-family shows. A real font file would add a test asset without proving more.

Manual verification notes

Still to do in a browser:

  • Leave Settings > Appearance > Text & Scale > Font on Default. Open a preset and check that its section content, Conversation prompt and Game prompt still look monospace. Do the same for a character's Dialogue > Example Dialogue.
  • Pick another font (a Google Font such as Lora works well). Check that the same fields, plus a choice option's value and its expanded editor, switch to it. Check that Expand editor on a preset section opens in that font too.
  • Pick a script font with curly quotes (for example Apple Chancery on macOS). Type He said "hi" and 'bye' in a preset section. Check that the quotes look as straight as in the preset title field.
  • With the custom font still set, check that variable names, the multi-select Separator field and code blocks in chat messages stay monospace.
  • With the custom font still set, open an agent's Prompt Template and the preset Parameters > Custom Parameters field, then click Expand editor on each. Check that the expanded window is monospace. Do the same for a character's Description.
  • Repeat with the SillyTavern visual theme, in light and dark mode, and on a mobile viewport. Check the quick preset editor inside Chat Settings as well.
  • With a custom CSS theme that sets textarea { font-family: … }, check that the theme still wins on these fields.

Docs and release impact

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

Docs: docs/appearance/fonts.md gained one paragraph. Translation follow-up: #7515. No version bump. Per policy, CHANGELOG.md is untouched.

UI evidence (if applicable)

None attached. The e2e above checks the computed font family.

Summary by CodeRabbit

  • Improvements
    • Preset prompt fields and character Example Dialogue use the default prompt font when no app font is selected, and follow the selected app font when one is configured.
    • Expanded prompt editors follow the same font behavior. Other prompt fields, including expanded first-message editors, remain monospace.
  • Documentation
    • Updated the font guide to describe prompt-field font 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/7514 **Author:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Created:** 10/13/2026 **Status:** ✅ Merged **Merged:** 10/13/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `staging` ← **Head:** `fix/7438-custom-font-preset-editor` --- ### 📝 Commits (2) - [`0b398a8`](https://github.com/Pasta-Devs/Marinara-Engine/commit/0b398a86126df9b71a54c3accf38a94d39ee1ba4) fix(client): preset prompts and Example Dialogue follow the app font (#7438) - [`f4873de`](https://github.com/Pasta-Devs/Marinara-Engine/commit/f4873de7a00c467f9dd1324c4deaa206651b5376) fix(client): keep straight quotes in prompt fields and match Expand window to the field ### 📊 Changes **8 files changed** (+119 additions, -9 deletions) <details> <summary>View changed files</summary> 📝 `docs/appearance/fonts.md` (+2 -0) ➕ `e2e/prompt-field-font.e2e.ts` (+90 -0) 📝 `packages/client/src/App.tsx` (+6 -2) 📝 `packages/client/src/components/characters/CharacterEditor.tsx` (+1 -1) 📝 `packages/client/src/components/presets/PresetEditor.tsx` (+3 -3) 📝 `packages/client/src/components/presets/PresetVariablesEditor.tsx` (+2 -2) 📝 `packages/client/src/components/ui/MacroTextarea.tsx` (+8 -1) 📝 `packages/client/src/styles/globals.css` (+7 -0) </details> ### 📄 Description > [!IMPORTANT] > Contributions target `staging`. Only `SpicyMarinara` may promote this repository's `staging` branch or a same-repository `hotfix/*` branch to `main`. > Outside and first-time contributors also require an approving review from `SpicyMarinara`. <!-- See CONTRIBUTING.md § Branches. --> ## Linked issue Closes #7438 ## Why this change - The font picked in **Settings > Appearance > Text & Scale > Font** reaches almost every editable field, but not the preset editor's prompt fields or a character's **Example Dialogue**. Those fields hard-coded Tailwind's `font-mono`, so they stayed monospace whatever font you picked. Users who choose a font for readability had to write a custom theme to get it there. ## What changed Nothing that worked before stops working. With the default font selected, every field looks exactly as it did. - With a font picked in Appearance, these fields now use it, like the rest of the app: - Preset editor: section content, the **Conversation** and **Game** prompts, and choice option values (inline and in their expanded editor). - Character editor: **Example Dialogue** (including its Markdown preview). - The **Expand editor** window of these fields. - These fields use the same font stack as the rest of the app, including its "Straight Quotes" face. Typed `"` and `'` stay straight even when the picked font draws curly quotes, so you can still see which quote is stored. - With the default font, they stay monospace as before. - Every other field's **Expand editor** window stays monospace, as before. This includes fields kept monospace on purpose, such as an agent's Prompt Template, the Storyboard and Secret Plot templates, the chat summary fields, and the Custom Parameters and Custom Headers JSON. - Fields that are code-like keep monospace in every case: variable names, the multi-select separator, code blocks, regex, JSON and IDs. - A custom CSS theme that sets a textarea font still overrides these fields, as it did before. The new `mari-prompt-font` rule is a Tailwind utility, in the same cascade layer as the `font-mono` it replaces. A theme that changes the app font through `--font-y2k` changes these fields too. - Some prompt fields outside the preset and character editors were out of scope and stay monospace. These include the per-chat Conversation prompt, Game extra prompt and impersonate template in Chat Settings. They can switch to the same class in a follow-up if wanted. - `docs/appearance/fonts.md` now says which fields follow the picked font, and that other prompt fields stay monospace. Translation follow-up: #7515. ## 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` Commands run by the agent (not a substitute for the boxes above): - New `e2e/prompt-field-font.e2e.ts`. It creates a preset with one section and a character with Example Dialogue and First Message, and reads `getComputedStyle().fontFamily`. - With the default font, the section content and Conversation/Game prompts start with `ui-monospace`. - After `setFontFamily("Prompt Font Fixture")`, those three fields, the section's Expand editor window and Example Dialogue start with `"Straight Quotes", "Prompt Font Fixture"`. - First Message, which was never monospace inline, still opens a monospace Expand editor window. - `playwright test e2e/prompt-field-font.e2e.ts` passed with the fix on `desktop-chromium`, `mobile-chromium` and `mobile-webkit` (head `f4873de7a`). - Same test against `origin/staging` client code: **failed** as expected. It received `ui-monospace, SFMono-Regular, …, monospace` after the font was set. - Same test against the first PR commit `0b398a861`: **failed** as expected. Prompt fields read `"Prompt Font Fixture", "Straight Quotes", …`, so the picked font's quote glyphs won. With only the Expand window change reverted, First Message's Expand window read `Straight Quotes, Prompt Font Fixture, …` instead of monospace. - `pnpm check`: passed (exit 0). The built CSS has `.mari-prompt-font{font-family:var(--font-prompt,var(--font-mono))}` inside `@layer utilities`. `App.tsx` sets `--font-prompt: var(--font-y2k)` only while a font is picked. - `node ./scripts/run-regressions.mjs --filter <name>`, each passed: chat-widget-style-persistence, frozen-server-client-timeouts, prompt.regression (7/7), prompt-token-counters, roleplay-streaming, tracker-gallery-ui, floating-window, mobile-tracker-help-layout, mobile-safe-area-inset, persona-client-contract, avatar-crop-contract, music-dj-and-floating-ui, onboarding-s1, mari-polish, assigned-issue-sweep, character-bulk-tags, capability-package-chat-controls, and the source-scan guards open-issues, agent-activation and spatial-context. - Local CodeRabbit (`coderabbit review --agent --committed --base-commit <merge-base>`) at `f4873de7a`: 1 trivial finding, not applied. It asked the e2e to load a real fixture font and check the rendered glyphs. The fix only changes which `font-family` declaration applies, which is exactly what the computed `font-family` shows. A real font file would add a test asset without proving more. ### Manual verification notes Still to do in a browser: - [ ] Leave **Settings > Appearance > Text & Scale > Font** on **Default**. Open a preset and check that its section content, Conversation prompt and Game prompt still look monospace. Do the same for a character's **Dialogue > Example Dialogue**. - [ ] Pick another font (a Google Font such as `Lora` works well). Check that the same fields, plus a choice option's value and its expanded editor, switch to it. Check that **Expand editor** on a preset section opens in that font too. - [ ] Pick a script font with curly quotes (for example `Apple Chancery` on macOS). Type `He said "hi" and 'bye'` in a preset section. Check that the quotes look as straight as in the preset title field. - [ ] With the custom font still set, check that variable names, the multi-select **Separator** field and code blocks in chat messages stay monospace. - [ ] With the custom font still set, open an agent's **Prompt Template** and the preset **Parameters > Custom Parameters** field, then click **Expand editor** on each. Check that the expanded window is monospace. Do the same for a character's **Description**. - [ ] Repeat with the **SillyTavern** visual theme, in light and dark mode, and on a mobile viewport. Check the quick preset editor inside Chat Settings as well. - [ ] With a custom CSS theme that sets `textarea { font-family: … }`, check that the theme still wins on these fields. ## Docs and release impact - [ ] No docs changes needed - [ ] Updated docs (README / CONTRIBUTING / android/README) as needed - [ ] Translated docs on the `docs-i18n` branch updated to match, or a `[docs-i18n]` follow-up issue opened (see CONTRIBUTING.md § Translated documentation) - [ ] Version/release files updated (only if this PR includes a version bump) Docs: `docs/appearance/fonts.md` gained one paragraph. Translation follow-up: #7515. No version bump. Per policy, `CHANGELOG.md` is untouched. ## UI evidence (if applicable) None attached. The e2e above checks the computed font family. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Improvements** * Preset prompt fields and character Example Dialogue use the default prompt font when no app font is selected, and follow the selected app font when one is configured. * Expanded prompt editors follow the same font behavior. Other prompt fields, including expanded first-message editors, remain monospace. * **Documentation** * Updated the font guide to describe prompt-field font 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-24 04:07:21 +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#7771
No description provided.