mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[PR #2593] [MERGED] feat(chat): card-CSS theming hooks (typing indicator + message grouping) #5678
Labels
No labels
android
bug
bugfix
ci
client
code freeze pause
container
dependencies
docs
documentation
duplicate
enhancement
feature
feature
feature
feature-creep
fixed-in-refactor
fixed-in-staging
good first issue
help wanted
in-pr
in-pr
needs-codeowner-decision
normal-scope
old-codebase
old-codebase
pull-request
qol
question
refactor
regression
revisit later
roadmap
scope-risk
scope-risk
server
server
shared
soup
upstream
windows
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Pasta-Devs/Marinara-Engine#5678
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/2593
Author: @kolacheee
Created: 6/16/2026
Status: ✅ Merged
Merged: 6/16/2026
Merged by: @SpicyMarinara
Base:
staging← Head:feat/staging-cardcss-theming📝 Commits (10+)
e6fe37afix(chat): harden card CSS sanitizer against escape-sequence evasiond74d73ffeat(chat): apply character creator-notes CSS in chat (card theming)cff5399feat(chat): default card CSS mode to disabled (opt-in)0c75b45feat(chat): card-CSS theming hooks for typing + grouped messages6d024eadocs: card CSS theming + authoring guide6690c15Merge branch 'staging' into feat/staging-cardcss-theming10fd906fix(chat): inject card CSS unlayered so it can override message styling0ea9148docs: card CSS examples that actually apply (unlayered injection)52a1dd2docs: rewrite card CSS guide against staging's real DOM + add showcase15421fcfeat(chat): baseline card CSS support in game mode📊 Changes
14 files changed (+1246 additions, -12 deletions)
View changed files
➕
docs/card-css-theming-guide.md(+343 -0)📝
packages/client/src/components/chat/ChatArea.tsx(+21 -0)📝
packages/client/src/components/chat/ChatMessage.tsx(+42 -6)📝
packages/client/src/components/chat/ChatRoleplaySurface.tsx(+5 -1)📝
packages/client/src/components/chat/ChatSettingsDrawer.tsx(+82 -0)📝
packages/client/src/components/chat/ConversationMessage.tsx(+2 -0)📝
packages/client/src/components/chat/ConversationMessageGrouped.tsx(+2 -0)📝
packages/client/src/components/chat/ConversationView.tsx(+15 -4)➕
packages/client/src/components/chat/CreatorNotesCssInjector.tsx(+117 -0)📝
packages/client/src/components/game/GameSurface.tsx(+1 -1)➕
packages/client/src/lib/card-css.ts(+578 -0)➕
packages/client/src/lib/creator-notes-css.ts(+23 -0)📝
packages/client/src/styles/globals.css(+8 -0)📝
packages/shared/src/types/chat.ts(+7 -0)📄 Description
Linked issue
Closes #2580
Why this change
#2590 lets a character's creator-notes CSS style its messages, but two surfaces have no hooks for authors to target: the typing indicator and grouped (consecutive) messages. This adds the minimal markup hooks so card CSS can style those too — e.g. a custom "… is typing" treatment, or a distinct look for the first message in a run vs its continuations.
What changed
ConversationView, classic mode): the row now carries.mari-typing-indicator/.mari-typing-dots/.mari-typing-textclass hooks anddata-typing-name(usable ascontent: attr(data-typing-name)). When a single character is typing, the row also getsdata-card-css={characterId}so exclusive-mode CSS can target it via[data-card-css="<id>"] .mari-typing-*.ConversationMessage) and the grouped multi-speaker layout (ConversationMessageGrouped) carrydata-groupedon continuation messages, so authors can target first-in-group with[data-card-css]:not([data-grouped])and continuations with[data-grouped]. The grouped layout also gains thedata-card-cssscope it was previously missing..mari-card-css+data-chat-mode="game") and the injector mounts there, so Chat-mode card CSS reaches the game area and@chat-mode gametargets it. Game uses its own layout, so the message hooks don't apply there; per-character (Exclusive) narration scoping is a noted follow-up.docs/card-css-theming-guide.md, written against staging's real chat DOM (every selector verified), with a smoking-gun test, the[data-card-css]-for-the-element vs class-for-children convention,@chat-modetargeting, the sanitizer limits, and a full "Eldritch Grimoire" showcase.@layer card-csswrapper lost to the app's unlayered rules and silently neutered most theming.The hook changes are additive markup (no default-render change); the cascade fix is what makes card CSS visibly take effect.
Out of scope (intentionally):
.mari-message-group— staging renders grouped messages flat, and collapsing would change default rendering.Validation
pnpm checkpasses locallyCONTRIBUTING.mdManual verification notes
Already run (automated): client typecheck (
tsc -b) and client lint (eslint) pass. Fullpnpm checkand the in-app checks below still need a human.Please manually verify in the app (conversation mode, with a card that has creator-notes CSS and Card Theming enabled):
<style>.mari-typing-text { color: hotpink; font-weight: bold; }</style>in a card's Creator Notes, send a message and confirm the "… is typing" row restyles while the reply streams. Confirm a normal chat's typing row is unchanged when no card CSS targets it.<style>[data-grouped] { opacity: 0.6; }</style>, send two quick consecutive messages from the same character and confirm the continuation dims while the first stays full. Confirm[data-card-css]:not([data-grouped])targets only first-in-group.Docs and release impact
UI evidence (if applicable)
To be added: before/after of a card styling the typing indicator + grouped continuation messages.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.