[PR #1202] [MERGED] Fix bare speaker tag rendering #4978

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

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/1202
Author: @cha1latte
Created: 5/25/2026
Status: ✅ Merged
Merged: 5/25/2026
Merged by: @cha1latte

Base: refactor ← Head: fix/refactor-issue-1126-speaker-tags


📝 Commits (1)

  • d65a703 Fix bare speaker tag rendering

📊 Changes

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

View changed files

📝 src/features/modes/shared/chat-ui/components/ChatMessage.tsx (+6 -5)

📄 Description

What?

Fixes bare <speaker>...</speaker> wrappers rendering as literal text in the refactor chat message UI.

The shared ChatMessage speaker-tag renderer now accepts both bare and named speaker wrappers, so bare tags are stripped consistently while named speaker coloring still works.

Fixes #1126

Why?

The pre-HTML detection path already treated the speaker name as optional, but the actual plain-text renderer only matched <speaker="Name">...</speaker>. That mismatch let existing or newly generated bare speaker tags leak into chat bubbles.

How?

  • Updated the shared speaker tag regex to match <speaker>...</speaker> and <speaker="Name">...</speaker>.
  • Treated unnamed speaker tags as default-color dialogue.
  • Kept named speaker color lookup intact for group/merged chat rendering.

Machine Verification

  • pnpm exec vitest run --config scratch/vitest.issue-1126.config.ts
    • Before fix on clean upstream/refactor: bare tag cases failed and leaked literal markup.
    • After fix: 5/5 passed.
    • Covered single bare wrapper, named wrapper regression, multiple bare wrappers, mixed bare/named wrappers, and negative control <speakerish>...</speakerish>.
  • pnpm check passed:
    • architecture check
    • frontend typecheck
    • Rust cargo check
    • docs check
  • node C:\Users\celia\.codex\tools\marinara-proof-gate.mjs scratch\bugfix-verification.json passed.
  • Bunny review passed before PR open.

Evidence

Issue 1126 before/after proof

Evidence URL verified with curl.exe -I returning 200 OK.

Manual Verification

None required for the core claim. The changed path was exercised directly with a component render harness against ChatMessage.

Notes

Targeting refactor because this issue was requested for the refactor lane and the relevant renderer has moved from packages/client/... to src/features/modes/shared/chat-ui/components/ChatMessage.tsx.


🔄 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/1202 **Author:** [@cha1latte](https://github.com/cha1latte) **Created:** 5/25/2026 **Status:** ✅ Merged **Merged:** 5/25/2026 **Merged by:** [@cha1latte](https://github.com/cha1latte) **Base:** `refactor` ← **Head:** `fix/refactor-issue-1126-speaker-tags` --- ### 📝 Commits (1) - [`d65a703`](https://github.com/Pasta-Devs/Marinara-Engine/commit/d65a703de62d8a0af28c643030085c5c528e4746) Fix bare speaker tag rendering ### 📊 Changes **1 file changed** (+6 additions, -5 deletions) <details> <summary>View changed files</summary> 📝 `src/features/modes/shared/chat-ui/components/ChatMessage.tsx` (+6 -5) </details> ### 📄 Description ## What? Fixes bare `<speaker>...</speaker>` wrappers rendering as literal text in the refactor chat message UI. The shared `ChatMessage` speaker-tag renderer now accepts both bare and named speaker wrappers, so bare tags are stripped consistently while named speaker coloring still works. Fixes #1126 ## Why? The pre-HTML detection path already treated the speaker name as optional, but the actual plain-text renderer only matched `<speaker="Name">...</speaker>`. That mismatch let existing or newly generated bare speaker tags leak into chat bubbles. ## How? - Updated the shared speaker tag regex to match `<speaker>...</speaker>` and `<speaker="Name">...</speaker>`. - Treated unnamed speaker tags as default-color dialogue. - Kept named speaker color lookup intact for group/merged chat rendering. ## Machine Verification - `pnpm exec vitest run --config scratch/vitest.issue-1126.config.ts` - Before fix on clean `upstream/refactor`: bare tag cases failed and leaked literal markup. - After fix: 5/5 passed. - Covered single bare wrapper, named wrapper regression, multiple bare wrappers, mixed bare/named wrappers, and negative control `<speakerish>...</speakerish>`. - `pnpm check` passed: - architecture check - frontend typecheck - Rust `cargo check` - docs check - `node C:\Users\celia\.codex\tools\marinara-proof-gate.mjs scratch\bugfix-verification.json` passed. - Bunny review passed before PR open. ## Evidence ![Issue 1126 before/after proof](https://gist.githubusercontent.com/cha1latte/e10fd7fcaa941533e64fce067277d0e6/raw/issue-1126-proof.svg) Evidence URL verified with `curl.exe -I` returning `200 OK`. ## Manual Verification None required for the core claim. The changed path was exercised directly with a component render harness against `ChatMessage`. ## Notes Targeting `refactor` because this issue was requested for the refactor lane and the relevant renderer has moved from `packages/client/...` to `src/features/modes/shared/chat-ui/components/ChatMessage.tsx`. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-22 04:12:11 +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#4978
No description provided.