[PR #5322] [MERGED] Feat/inlinecolorednames #6728

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

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/5322
Author: @ylli-selmani
Created: 8/20/2026
Status: ✅ Merged
Merged: 8/20/2026
Merged by: @SpicyMarinara

Base: staging ← Head: feat/inlinecolorednames


📝 Commits (10+)

  • f1ce947 UI and database groundwork for using nameColors to color names in Chats, inline. For both Personas and Characters for now.
  • aa76713 Removal of everything Persona Related -> moved to a different branch. Now only for characters and coloring logic
  • 0b07106 Character Names + Aliases colored in Text with their set nameColor, but not inside quotes/dialogue, protecting dialogue color
  • bae1068 added force solid Color subtoggle (uses brightest color of gradient array) and fixed gradient rendering
  • 0be7218 added a subtle shadow to gradient names to visually match other text. Solid color names inherit shadow from parent.
  • 9a6bc83 fixed en.json inaccuracy about 'force solid colors' subtoggle
  • ec65fed split main function into two (markdown and html) to preserve paragraph spacing when active. I wont pretend to understand why.
  • 18d7c9e ran prettier on all documents i touched, and fixed minor code visuals
  • 50fd470 restored and expanded upon a comment inside function renderContent in ChatMessage.tsx
  • 83c984d Merge branch 'staging' into feat/inlinecolorednames

📊 Changes

10 files changed (+686 additions, -10 deletions)

View changed files

📝 CHANGELOG.md (+1 -0)
📝 packages/client/src/components/characters/CharacterEditor.tsx (+8 -0)
📝 packages/client/src/components/chat/ChatArea.tsx (+6 -0)
📝 packages/client/src/components/chat/ChatMessage.tsx (+451 -9)
📝 packages/client/src/components/chat/chat-area.types.ts (+2 -0)
📝 packages/client/src/components/panels/SettingsPanel.tsx (+36 -1)
➕ packages/client/src/components/ui/NameAliasesSection.tsx (+153 -0)
📝 packages/client/src/localization/locales/en.json (+11 -0)
📝 packages/client/src/stores/ui.store.ts (+14 -0)
📝 packages/shared/src/types/character.ts (+4 -0)

📄 Description

Disclaimer

This was truthfully, fully vibe-coded with Professor Mari using Glm 5.2 Thinking, manual copy and pasting, and as much human (me) testing as i could manage. If the code is therefore trash, but you like the idea, feel free to toss it out and code it yourself. I'd COMPLETELY understand.

also, as stated below, for some reason my pnpm check always fails on prettier, but it fails in the same place as it does in an unmodified Staging, so... i don't know why. Maybe someone could run it for me.

This is a draft for now, because I think i still need a changelog.md

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 #5321

Why this change

In multi-character roleplays, it's hard to tell who's being referred to in the prose at a glance. The speaker header already shows each character's name color (including gradients), but that visual anchor disappears the moment you start reading the body text. This PR brings that coloring inline into the message text itself, so names pop visually without needing to look up at the header.

Inspired by the AI Dungeon extension "Dungeon Extension v2", which does exactly this and makes multi-character stories way more readable. I full-on stole the idea because it's just good.

What changed

Added an opt-in toggle under Text Rules: "Color Character Names in Text" (off by default)
Added a sub-toggle: "Force Solid Colors for Inline Names" which replaces gradient name colors with the brightest single color stop (by perceived luminance) for better readability in inline contexts. The speaker header is unaffected and always uses the full gradient.
Only characters added to the chat are eligible for name coloring. Works whether they're enabled or disabled in the chat's character list, as long as they're present.
Supports name aliases: all aliases get colored, not just the primary name.
Quote-aware: names inside dialogue quotes are NOT colored, since they're spoken dialogue, already colored and not narrative prose. Includes a safety valve for unmatched/stray quotes.
Works in both the markdown and HTML rendering paths without interfering with paragraph spacing, text stroke, or the existing text shadow/halo.
Gradient name spans use filter: drop-shadow() instead of text-shadow (which breaks with background-clip: text), and zero out the inherited WebkitTextStroke to avoid a visible inward border artifact.

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 - i think.

Manual verification notes

pnpm check does NOT pass locally, not on staging, not on my branch. It fails on Prettier formatting issues in the same spot everywhere. I don't know why, it was happening before my changes too. Someone else should verify this one.

Everything else I tested manually:

Toggled the feature on/off, confirmed names color and uncolor correctly
Tested gradient name colors inline — they render with the gradient, match the speaker header style
Tested the "Force Solid Colors" sub-toggle — gradients get replaced with the brightest extracted solid color, speaker header keeps its gradient
Tested name aliases: all aliases for a character get colored, not just the primary name.
Tested quote-awareness: names inside "" are NOT colored
Tested unmatched/stray quotes: the safety valve kicks in and coloring doesn't break partway through
Tested both markdown and HTML rendering paths — names color correctly in both
Tested paragraph spacing: no difference with the feature on or off (the HTML path detection checks the original text, not the name-colored text)
Tested text stroke: gradient names don't have the weird inward border anymore
Tested text shadow/halo: gradient names use filter: drop-shadow() matching the existing halo, solid names inherit the container's text-shadow naturally
Tested light mode on desktop AND mobile: gradient drop-shadows on light mode stand out a bit more than on dark mode, but it's not broken. Worth noting for future polish.
Tested dark mode on desktop and mobile: looks great
Tested with characters disabled in the chat but still present: names still get colored
Tested with Names of characters added to the chat: nothing breaks, no coloring happens

Known limitation: if multiple characters share the same alias or name, one character's color is chosen over the other. I don't know which one gets picked (probably whichever comes first in the map iteration). Should probably look into this in the future, but it's an edge case and doesn't break anything.

Docs and release impact

  • No docs changes needed
  • Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) 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)

UI evidence (if applicable)

gradient names + 1 solid color name + Alias support no effect when turned off force Solid colors showcase name aliases ui light mode gradient mobile dark mode gradient mobile

Summary by CodeRabbit

  • New Features
    • Added optional inline coloring for character names in chat messages, with gradient or solid-color options.
    • Name coloring supports aliases across supported message formats while excluding code, preformatted text, and dialogue-colored content.
    • Added settings to enable name coloring and disable gradients.
    • Added alias management in the Colors tab, including adding, removing, and styling aliases.
  • Documentation
    • Documented the new text-rules colorization settings and behavior in the unreleased changelog.

🔄 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/5322 **Author:** [@ylli-selmani](https://github.com/ylli-selmani) **Created:** 8/20/2026 **Status:** ✅ Merged **Merged:** 8/20/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `staging` ← **Head:** `feat/inlinecolorednames` --- ### 📝 Commits (10+) - [`f1ce947`](https://github.com/Pasta-Devs/Marinara-Engine/commit/f1ce947f486c3a83ccd749bea6c31653e97a3d7b) UI and database groundwork for using nameColors to color names in Chats, inline. For both Personas and Characters for now. - [`aa76713`](https://github.com/Pasta-Devs/Marinara-Engine/commit/aa76713c9c3a391bd33ebd1399271597f55b2073) Removal of everything Persona Related -> moved to a different branch. Now only for characters and coloring logic - [`0b07106`](https://github.com/Pasta-Devs/Marinara-Engine/commit/0b07106a9e4630f88927beab0be174521bec2ce4) Character Names + Aliases colored in Text with their set nameColor, but not inside quotes/dialogue, protecting dialogue color - [`bae1068`](https://github.com/Pasta-Devs/Marinara-Engine/commit/bae1068a93315ec09db278e2bd2d85d4e5ff09c1) added force solid Color subtoggle (uses brightest color of gradient array) and fixed gradient rendering - [`0be7218`](https://github.com/Pasta-Devs/Marinara-Engine/commit/0be7218b5e5aaa04bf017ba01e78ff445ca1ff1e) added a subtle shadow to gradient names to visually match other text. Solid color names inherit shadow from parent. - [`9a6bc83`](https://github.com/Pasta-Devs/Marinara-Engine/commit/9a6bc8373bc57563d517b80761df6deb1e4d95da) fixed en.json inaccuracy about 'force solid colors' subtoggle - [`ec65fed`](https://github.com/Pasta-Devs/Marinara-Engine/commit/ec65fed94355aecb1db72e9d7c510ad9441b2ee2) split main function into two (markdown and html) to preserve paragraph spacing when active. I wont pretend to understand why. - [`18d7c9e`](https://github.com/Pasta-Devs/Marinara-Engine/commit/18d7c9e79a5d891ed08c28c32ab9c1b2ee8d0f55) ran prettier on all documents i touched, and fixed minor code visuals - [`50fd470`](https://github.com/Pasta-Devs/Marinara-Engine/commit/50fd4700224b7ce43f88dc5dab85770d48c3f36c) restored and expanded upon a comment inside function renderContent in ChatMessage.tsx - [`83c984d`](https://github.com/Pasta-Devs/Marinara-Engine/commit/83c984d4a36ed12e60867ca7772b77f425dd0237) Merge branch 'staging' into feat/inlinecolorednames ### 📊 Changes **10 files changed** (+686 additions, -10 deletions) <details> <summary>View changed files</summary> 📝 `CHANGELOG.md` (+1 -0) 📝 `packages/client/src/components/characters/CharacterEditor.tsx` (+8 -0) 📝 `packages/client/src/components/chat/ChatArea.tsx` (+6 -0) 📝 `packages/client/src/components/chat/ChatMessage.tsx` (+451 -9) 📝 `packages/client/src/components/chat/chat-area.types.ts` (+2 -0) 📝 `packages/client/src/components/panels/SettingsPanel.tsx` (+36 -1) ➕ `packages/client/src/components/ui/NameAliasesSection.tsx` (+153 -0) 📝 `packages/client/src/localization/locales/en.json` (+11 -0) 📝 `packages/client/src/stores/ui.store.ts` (+14 -0) 📝 `packages/shared/src/types/character.ts` (+4 -0) </details> ### 📄 Description ## Disclaimer This was truthfully, fully vibe-coded with Professor Mari using Glm 5.2 Thinking, manual copy and pasting, and as much human (me) testing as i could manage. If the code is therefore trash, but you like the idea, feel free to toss it out and code it yourself. I'd COMPLETELY understand. also, as stated below, for some reason my pnpm check always fails on prettier, but it fails in the same place as it does in an unmodified Staging, so... i don't know why. Maybe someone could run it for me. This is a draft for now, because I think i still need a changelog.md > [!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 #5321 ## Why this change In multi-character roleplays, it's hard to tell who's being referred to in the prose at a glance. The speaker header already shows each character's name color (including gradients), but that visual anchor disappears the moment you start reading the body text. This PR brings that coloring inline into the message text itself, so names pop visually without needing to look up at the header. Inspired by the AI Dungeon extension "Dungeon Extension v2", which does exactly this and makes multi-character stories way more readable. I full-on stole the idea because it's just good. - ## What changed Added an opt-in toggle under Text Rules: "Color Character Names in Text" (off by default) Added a sub-toggle: "Force Solid Colors for Inline Names" which replaces gradient name colors with the brightest single color stop (by perceived luminance) for better readability in inline contexts. The speaker header is unaffected and always uses the full gradient. Only characters added to the chat are eligible for name coloring. Works whether they're enabled or disabled in the chat's character list, as long as they're present. Supports name aliases: all aliases get colored, not just the primary name. Quote-aware: names inside dialogue quotes are NOT colored, since they're spoken dialogue, already colored and not narrative prose. Includes a safety valve for unmatched/stray quotes. Works in both the markdown and HTML rendering paths without interfering with paragraph spacing, text stroke, or the existing text shadow/halo. Gradient name spans use filter: drop-shadow() instead of text-shadow (which breaks with background-clip: text), and zero out the inherited WebkitTextStroke to avoid a visible inward border artifact. - ## Validation <!-- Required: include commands run and/or manual checks performed --> - [ ] `pnpm check` passes locally - [ ] Container (Docker / Podman) built and ran without issue - [X] Ran the app, clicked through the changes manually - [X] Checked edge cases (light + dark mode, mobile viewport, empty states, error paths) - [X] Above manual verification completed (describe below) - [x] Read and followed `CONTRIBUTING.md` - i think. ### Manual verification notes pnpm check does NOT pass locally, not on staging, not on my branch. It fails on Prettier formatting issues in the same spot everywhere. I don't know why, it was happening before my changes too. Someone else should verify this one. Everything else I tested manually: Toggled the feature on/off, confirmed names color and uncolor correctly Tested gradient name colors inline — they render with the gradient, match the speaker header style Tested the "Force Solid Colors" sub-toggle — gradients get replaced with the brightest extracted solid color, speaker header keeps its gradient Tested name aliases: all aliases for a character get colored, not just the primary name. Tested quote-awareness: names inside "" are NOT colored Tested unmatched/stray quotes: the safety valve kicks in and coloring doesn't break partway through Tested both markdown and HTML rendering paths — names color correctly in both Tested paragraph spacing: no difference with the feature on or off (the HTML path detection checks the original text, not the name-colored text) Tested text stroke: gradient names don't have the weird inward border anymore Tested text shadow/halo: gradient names use filter: drop-shadow() matching the existing halo, solid names inherit the container's text-shadow naturally Tested light mode on desktop AND mobile: gradient drop-shadows on light mode stand out a bit more than on dark mode, but it's not broken. Worth noting for future polish. Tested dark mode on desktop and mobile: looks great Tested with characters disabled in the chat but still present: names still get colored Tested with Names of characters added to the chat: nothing breaks, no coloring happens Known limitation: if multiple characters share the same alias or name, one character's color is chosen over the other. I don't know which one gets picked (probably whichever comes first in the map iteration). Should probably look into this in the future, but it's an edge case and doesn't break anything. - ## Docs and release impact - [ ] No docs changes needed - [X] Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) 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) ## UI evidence (if applicable) <img width="1681" height="237" alt="gradient names + 1 solid color name + Alias support" src="https://github.com/user-attachments/assets/b749bc37-ceb5-40ed-af94-fa8224d8a902" /> <img width="1503" height="510" alt="no effect when turned off" src="https://github.com/user-attachments/assets/3e17b801-0155-4c36-b8ba-8ca0558da6b7" /> <img width="1503" height="512" alt="force Solid colors showcase" src="https://github.com/user-attachments/assets/2972f399-65c8-43a7-9e24-dd36e9cb23d6" /> <img width="1764" height="1506" alt="name aliases ui" src="https://github.com/user-attachments/assets/92f8641c-b49e-4ab5-b51b-c3b3ae410a48" /> <img width="1080" height="1606" alt="light mode gradient mobile" src="https://github.com/user-attachments/assets/73d34ae9-0c6f-4cdd-a532-13509082a7a1" /> <img width="1080" height="1615" alt="dark mode gradient mobile" src="https://github.com/user-attachments/assets/1bb57121-001d-4276-b44c-5a706b0ca162" /> <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Added optional inline coloring for character names in chat messages, with gradient or solid-color options. * Name coloring supports aliases across supported message formats while excluding code, preformatted text, and dialogue-colored content. * Added settings to enable name coloring and disable gradients. * Added alias management in the Colors tab, including adding, removing, and styling aliases. * **Documentation** * Documented the new text-rules colorization settings and behavior in the unreleased changelog. <!-- 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:13:07 +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#6728
No description provided.