[PR #8720] [MERGED] feat(roleplay): optional name-colour borders on Narrator avatars #8767

Closed
opened 2026-11-07 17:39:33 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/8720
Author: @SpicyMarinara
Created: 11/3/2026
Status: ✅ Merged
Merged: 11/3/2026
Merged by: @SpicyMarinara

Base: staging ← Head: feat/8712-portrait-name-color-borders


📝 Commits (4)

  • d75ae1e feat(roleplay): optional name-color borders on Narrator avatars (#8712)
  • a9f7738 fix(roleplay): outline each side-by-side Narrator avatar on its own (#8712)
  • f3dd554 fix(roleplay): split the round Narrator avatar ring between characters (#8712)
  • 7d48ab4 Merge branch 'staging' into feat/8712-portrait-name-color-borders

📊 Changes

9 files changed (+226 additions, -2 deletions)

View changed files

📝 packages/client/src/components/chat/ChatMessage.tsx (+51 -1)
📝 packages/client/src/components/panels/SettingsPanel.tsx (+9 -0)
📝 packages/client/src/lib/omnibar-settings-toggle-bindings.ts (+4 -0)
📝 packages/client/src/lib/settings-registry.ts (+11 -0)
📝 packages/client/src/lib/utils.ts (+14 -0)
📝 packages/client/src/localization/locales/en.json (+3 -0)
📝 packages/client/src/stores/ui.store.ts (+9 -0)
➕ scripts/regressions/narrator-avatar-borders.regression.ts (+123 -0)
📝 scripts/regressions/tsconfig.client-lanes.json (+2 -1)

📄 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 #8712

Why this change

A user asked for data attributes and CSS variables on merged Roleplay portraits, so CSS themes could add name labels and borders in each character's colour. The maintainer declined to expose anything to CSS ("Anything that exposes CSS can be a security vulnerability, so we avoid it"). They offered instead: "I can add borders colored like the character's name. Just on our end." This PR is that Engine-side option.

What changed

  • Setting: a new "Narrator's Avatar Borders" toggle, off by default. Saved settings migrate to off, so the default look is unchanged.
    • It sits beside "Narrator's Cycling Avatars" in the Settings panel, with an entry in the settings registry and an omnibar binding.
    • English copy lives in en.json.
  • What it draws: on merged group Roleplay Narrator messages, each character's avatar is outlined in that character's name colour. The shape depends on the frame:
    • Glued Side Panel: each avatar gets its own full outline. The bottom edge fades with the panel's existing mask, as the portrait does.
    • Compact frame (both "Small Circles" and "Small Rectangles"): the avatars sit side by side, and the frame's ring is split into one arc per character.
      • Both styles get the ring because the merged compact frame is round in both: the existing .rpg-avatar-glow { border-radius: 50% } beats rounded-xl, so "rectangles" renders as an oval.
      • Separate rectangle outlines would have been cut by the curve.
    • Cycling or a single avatar: one whole outline, fading with the cycle.
  • Colours:
    • A gradient name colour uses its first stop, through the existing getCssColorFallback.
    • A character with no name colour gets the same fallback palette colour as their part of the "Narrator" label, so border and label match.
  • No hooks: nothing is exposed to themes. There are no data-character-* attributes and no theme-facing CSS variables.

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

What the agent ran:

  • pnpm check passes (exit 0), and pnpm localization:check passes.
  • Client tsc --noEmit and the client-lanes typecheck pass.
  • scripts/regressions/narrator-avatar-borders.regression.ts covers the helper colours (name colour, gradient first stop, fallback) and the layout per frame: the per-avatar outline in the side panel, split ring segments in the compact frame, and the whole outline when cycling. It fails on staging. A mutation check shows it catches a return to the earlier single clipped outline.
  • Related regressions pass: command-center (omnibar bindings must point at registry toggles), avatar-crop-contract, omnibar-settings-sync, chat-widget-style-persistence, seasonal-themes.
  • Headless Chromium mock-ups against the built CSS checked:
    • the split ring follows the circle and the oval for 2 and 3 characters;
    • each side-panel avatar gets its own outline;
    • with the setting off, nothing is drawn.
  • CodeRabbit raised one finding on the first commit, the same one the review confirmed: side-by-side avatars didn't each get a full border. It is fixed.
  • A second review confirmed the round frames needed a ring rather than rectangles, and that is fixed as well.

Manual verification notes

  • Manually verify in a merged group Roleplay chat whose characters have distinct name colours: turn on Settings → "Narrator's Avatar Borders" and check each avatar style.
    • Small Circles and Small Rectangles: one ring split into each character's colour.
    • Glued Side Panel: a full outline around each portrait.
    • Each with cycling on and off.
  • Manually verify that a gradient name colour uses its first colour, and that a character with no name colour matches their part of the Narrator label.
  • Manually verify that with the setting off, avatars look exactly as before.

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/appearance-settings.md doesn't list the sibling "Narrator's Cycling Avatars" toggle either, so it isn't changed here. Adding both would need a [docs-i18n] follow-up.

🤖 Generated with Claude Code


🔄 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/8720 **Author:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Created:** 11/3/2026 **Status:** ✅ Merged **Merged:** 11/3/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `staging` ← **Head:** `feat/8712-portrait-name-color-borders` --- ### 📝 Commits (4) - [`d75ae1e`](https://github.com/Pasta-Devs/Marinara-Engine/commit/d75ae1e96bab9ac56026615eca8379763a1e98ef) feat(roleplay): optional name-color borders on Narrator avatars (#8712) - [`a9f7738`](https://github.com/Pasta-Devs/Marinara-Engine/commit/a9f77387d8e8c4d322f4b6207ee57418edd297e5) fix(roleplay): outline each side-by-side Narrator avatar on its own (#8712) - [`f3dd554`](https://github.com/Pasta-Devs/Marinara-Engine/commit/f3dd554182d3adc75b433b98d3aa40a82741f5ec) fix(roleplay): split the round Narrator avatar ring between characters (#8712) - [`7d48ab4`](https://github.com/Pasta-Devs/Marinara-Engine/commit/7d48ab4d904abc01b3f8d82ced64531d84a0a895) Merge branch 'staging' into feat/8712-portrait-name-color-borders ### 📊 Changes **9 files changed** (+226 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `packages/client/src/components/chat/ChatMessage.tsx` (+51 -1) 📝 `packages/client/src/components/panels/SettingsPanel.tsx` (+9 -0) 📝 `packages/client/src/lib/omnibar-settings-toggle-bindings.ts` (+4 -0) 📝 `packages/client/src/lib/settings-registry.ts` (+11 -0) 📝 `packages/client/src/lib/utils.ts` (+14 -0) 📝 `packages/client/src/localization/locales/en.json` (+3 -0) 📝 `packages/client/src/stores/ui.store.ts` (+9 -0) ➕ `scripts/regressions/narrator-avatar-borders.regression.ts` (+123 -0) 📝 `scripts/regressions/tsconfig.client-lanes.json` (+2 -1) </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`. ## Linked issue Closes #8712 ## Why this change A user asked for data attributes and CSS variables on merged Roleplay portraits, so CSS themes could add name labels and borders in each character's colour. The maintainer declined to expose anything to CSS ("Anything that exposes CSS can be a security vulnerability, so we avoid it"). They offered instead: "I can add borders colored like the character's name. Just on our end." This PR is that Engine-side option. ## What changed - **Setting:** a new "Narrator's Avatar Borders" toggle, off by default. Saved settings migrate to off, so the default look is unchanged. - It sits beside "Narrator's Cycling Avatars" in the Settings panel, with an entry in the settings registry and an omnibar binding. - English copy lives in `en.json`. - **What it draws:** on merged group Roleplay Narrator messages, each character's avatar is outlined in that character's name colour. The shape depends on the frame: - **Glued Side Panel:** each avatar gets its own full outline. The bottom edge fades with the panel's existing mask, as the portrait does. - **Compact frame (both "Small Circles" and "Small Rectangles"):** the avatars sit side by side, and the frame's ring is split into one arc per character. - Both styles get the ring because the merged compact frame is round in both: the existing `.rpg-avatar-glow { border-radius: 50% }` beats `rounded-xl`, so "rectangles" renders as an oval. - Separate rectangle outlines would have been cut by the curve. - **Cycling or a single avatar:** one whole outline, fading with the cycle. - **Colours:** - A gradient name colour uses its first stop, through the existing `getCssColorFallback`. - A character with no name colour gets the same fallback palette colour as their part of the "Narrator" label, so border and label match. - **No hooks:** nothing is exposed to themes. There are no `data-character-*` attributes and no theme-facing CSS variables. ## 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` What the agent ran: - `pnpm check` passes (exit 0), and `pnpm localization:check` passes. - Client `tsc --noEmit` and the client-lanes typecheck pass. - `scripts/regressions/narrator-avatar-borders.regression.ts` covers the helper colours (name colour, gradient first stop, fallback) and the layout per frame: the per-avatar outline in the side panel, split ring segments in the compact frame, and the whole outline when cycling. It fails on `staging`. A mutation check shows it catches a return to the earlier single clipped outline. - Related regressions pass: command-center (omnibar bindings must point at registry toggles), avatar-crop-contract, omnibar-settings-sync, chat-widget-style-persistence, seasonal-themes. - Headless Chromium mock-ups against the built CSS checked: - the split ring follows the circle and the oval for 2 and 3 characters; - each side-panel avatar gets its own outline; - with the setting off, nothing is drawn. - CodeRabbit raised one finding on the first commit, the same one the review confirmed: side-by-side avatars didn't each get a full border. It is fixed. - A second review confirmed the round frames needed a ring rather than rectangles, and that is fixed as well. ### Manual verification notes - Manually verify in a merged group Roleplay chat whose characters have distinct name colours: turn on Settings → "Narrator's Avatar Borders" and check each avatar style. - Small Circles and Small Rectangles: one ring split into each character's colour. - Glued Side Panel: a full outline around each portrait. - Each with cycling on and off. - Manually verify that a gradient name colour uses its first colour, and that a character with no name colour matches their part of the Narrator label. - Manually verify that with the setting off, avatars look exactly as before. ## 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/appearance-settings.md` doesn't list the sibling "Narrator's Cycling Avatars" toggle either, so it isn't changed here. Adding both would need a `[docs-i18n]` follow-up. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-07 17:39:33 +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#8767
No description provided.