mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[PR #1748] [MERGED] feat: creator notes CSS injection with tri-state mode #5258
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#5258
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/1748
Author: @kolacheee
Created: 5/31/2026
Status: ✅ Merged
Merged: 5/31/2026
Merged by: @cha1latte
Base:
refactor← Head:feat/creator-notes-css📝 Commits (8)
5e66284feat: creator notes CSS injection with tri-state mode8d5b2b8feat: @chat-mode query system for mode-aware card CSS94c595afix: add data-card-css to grouped conversation message wrapperbeefe14fix: treat [data-card-css] as scope-root in CSS scoping58823b3security: harden CSS sanitizer and regex import against malicious cardsa7ebc68docs: add card CSS theming guide for character creators7f0b8b3fix: resolve architecture violations and unused export19726d3Prepare creator notes CSS PR for review📊 Changes
20 files changed (+1052 additions, -5 deletions)
View changed files
➕
docs/card-css-theming-guide.md(+345 -0)📝
src/engine/contracts/types/chat.ts(+4 -0)📝
src/features/modes/conversation/components/ConversationMessage.tsx(+2 -0)📝
src/features/modes/conversation/components/ConversationModeRoute.tsx(+13 -0)📝
src/features/modes/conversation/components/ConversationView.tsx(+1 -1)📝
src/features/modes/game/components/GameConversationView.tsx(+13 -0)📝
src/features/modes/game/components/GameNarration.tsx(+10 -2)📝
src/features/modes/game/components/GameSurface.tsx(+1 -1)📝
src/features/modes/roleplay/components/ChatRoleplaySurface.tsx(+1 -1)📝
src/features/modes/roleplay/components/RoleplayModeRoute.tsx(+13 -0)📝
src/features/modes/shared/chat-ui/components/ChatMessage.tsx(+3 -0)📝
src/features/modes/shared/chat-ui/components/ChatSettingsDrawer.tsx(+95 -0)➕
src/features/modes/shared/chat-ui/components/CreatorNotesCssInjector.test.tsx(+81 -0)➕
src/features/modes/shared/chat-ui/components/CreatorNotesCssInjector.tsx(+100 -0)📝
src/features/modes/shared/chat-ui/hooks/use-chat-surface-data.ts(+1 -0)📝
src/features/modes/shared/chat-ui/index.ts(+2 -0)➕
src/shared/lib/chat-css.test.ts(+83 -0)➕
src/shared/lib/chat-css.ts(+259 -0)➕
src/shared/lib/creator-notes-css.test.ts(+13 -0)➕
src/shared/lib/creator-notes-css.ts(+12 -0)📄 Description
Linked issue
Closes #1757
Why this change
Character card creators should be able to embed custom CSS in their cards to give characters a unique visual identity across roleplay, conversation, and game surfaces. This brings the refactored Tauri architecture a clean client-side version of the card theming idea that was partially explored in old-engine PR #1058.
What changed
<style>blocks.@chat-mode roleplay,@chat-mode conversation, and@chat-mode game.CreatorNotesCssInjectorfor chat-wide, character-exclusive, and disabled card CSS modes.cardCssModeto chat metadata and a Card Theming section in chat settings.mari-card-css/data-chat-modesurface attributes anddata-card-cssmessage attributes across roleplay, conversation, and game surfaces.docs/card-css-theming-guide.md.CreatorNotesCssInjectorthrough the shared chat-ui barrel so mode routes no longer import a private component path.contentdeclarations even when the declaration omits a trailing semicolon.Refactor impact
Primary owner: shared mode UI, with consumer changes in roleplay, conversation, and game mode surfaces.
Impact areas reviewed:
src/engine/contracts/types/chat.tsadds optionalChatMetadata.cardCssMode.src/shared/lib/creator-notes-css.tsextracts card CSS from creator notes.src/shared/lib/chat-css.tsfilters, sanitizes, and scopes card CSS.src/features/modes/shared/chat-ui/owns the injector, settings UI, metadata access, and shared exports.src/features/modes/roleplay/,src/features/modes/conversation/, andsrc/features/modes/game/render the injector and expose targetable surface/message attributes.docs/card-css-theming-guide.mddocuments author-facing usage and limits.Boundary notes:
Pressure points touched:
ChatRoleplaySurface,ConversationView, andGameSurfacesurface attributes.ChatMessage,ConversationMessage, andGameNarrationmessage wrapper attributes.ChatSettingsDrawerCard Theming controls.Validation
pnpm typecheck,pnpm build,pnpm check:architecture,pnpm check:docs, or fullpnpm checkwhen warranted)pnpm checkpasses locally before PR push/handoff, including the unused-code checkpnpm typecheckpasses locallypnpm buildpasses locallypnpm check:architecturepasses locallypnpm check:docspasses locallycargo check --manifest-path src-tauri/Cargo.toml --workspacepasses locallyManual verification notes
Codex machine proof:
pnpm test -- src/shared/lib/creator-notes-css.test.ts src/shared/lib/chat-css.test.ts src/features/modes/shared/chat-ui/components/CreatorNotesCssInjector.test.tsxpassed: 3 files, 11 tests.pnpm checkpassed after the final diff.Human/manual note:
Docs and release impact
README.mdCONTRIBUTING.mddocs/developer/AGENTS.mdDocs note: added
docs/card-css-theming-guide.md.UI evidence (if applicable)
No GitHub-hosted screenshots or recordings were uploaded in this pass. The visible UI behavior is supported by focused jsdom injector coverage plus full local validation; a reviewer can add screenshots later if they want reviewer-visible visual evidence before merge.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.