[PR #7750] [MERGED] feat(roleplay): render illustrate command images in-line #7912

Closed
opened 2026-10-24 04:08:46 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/7750
Author: @ylli-selmani
Created: 10/16/2026
Status: ✅ Merged
Merged: 10/16/2026
Merged by: @ylli-selmani

Base: staging ← Head: feat/inline-illustrations


📝 Commits (3)

  • 6b9b155 feat(roleplay): render illustrate command images in-line (#7748)
  • 63a9834 fix(roleplay): keep the Render in-line switch from being squeezed
  • a1dd54e fix(roleplay): keep image remove button on touch, distinct prompts in test

📊 Changes

10 files changed (+407 additions, -54 deletions)

View changed files

📝 docs/roleplay/getting-started.md (+6 -0)
📝 e2e/roleplay-commands.e2e.ts (+220 -0)
📝 packages/client/src/components/chat/ChatMessage.tsx (+119 -48)
📝 packages/client/src/components/chat/RoleplayCommandsSettings.tsx (+16 -0)
📝 packages/client/src/localization/locales/en.json (+2 -0)
📝 packages/server/src/routes/generate.routes.ts (+25 -5)
📝 packages/server/src/services/generation/roleplay-commands.ts (+4 -1)
📝 packages/shared/src/types/chat-preset.ts (+1 -0)
📝 packages/shared/src/types/chat.ts (+2 -0)
📝 scripts/regressions/roleplay-commands.regression.ts (+12 -0)

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

Docs translation follow-up: #7749

Why this change

  • A character can already write [illustrate: ...] between paragraphs, right where a moment happens, but every image lands below the message. A reply with three illustrations shows all three stacked at the bottom, away from the moments they show.

What changed

  • Render in-line sub-toggle under the Illustrations command (Chat Settings → Agents → Commands), stored as roleplayIllustrateInline and kept in chat setting profiles. Off keeps today's behaviour.
  • When it is on, each [illustrate] command saves its place in the reply the same way whispers do (contentOffset + contentAnchor), so edits and split replies keep it next to the same text through the existing reanchoring.
  • Each command image records roleplayCommandIndex, the index of the command that made it, so a failed command or several variants can't mismatch images.
  • The message slots those images into its text at the command's place via the existing inline-command markers, scaled to fit. Clicking opens the viewer with the prompt and the X removes the image. The image tile is now one shared renderer for the inline and below-message spots, and its remove button stays visible on touch screens.
  • The illustrate prompt line gains: "The image appears exactly where you write the command, so place it where the picture belongs: at the start, between paragraphs, or at the end."
  • Only new images are affected. Automatic Illustrator runs, retries and the Visual Novel layout keep showing images below or on their stage.
  • Docs: new "Illustrations in the message" section in docs/roleplay/getting-started.md.
  • Tests: the prompt sentence is pinned in roleplay-commands.regression.ts, and a new e2e test in roleplay-commands.e2e.ts covers placement, each image's own prompt in the viewer, remove, and the setting.

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

Manual verification notes

Run in the cloud container:

  • Client and server tsc --noEmit, ESLint on the changed client files, pnpm localization:check, pnpm format:check and pnpm impeccable:check pass.
  • Full node regression suite: 909/909 pass (two first failed on module-loading errors while running next to the e2e servers, and passed when rerun alone).
  • The new e2e test passes on desktop-chromium and mobile-chromium.

Still to verify by hand:

  • With a real Illustrator connection, ask for illustrations between paragraphs and check each image lands at its place.
  • Edit the message text around an image and check it stays with its paragraph.
  • Turn Render in-line off and check new images go below the message again.

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)

UI evidence (if applicable)

Images from the e2e fixture (solid colours stand in for illustrations); screenshots to be added to the PR.

image

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features

    • Added a chat setting to render roleplay-command illustrations inline at the command’s position in the message. Inline images retain their controls and can be opened or removed individually.
    • Documented how to enable inline illustrations in chat settings.
  • Bug Fixes

    • Inline illustrations now appear alongside the corresponding message content, while other attachments and existing image behavior remain unchanged.

🔄 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/7750 **Author:** [@ylli-selmani](https://github.com/ylli-selmani) **Created:** 10/16/2026 **Status:** ✅ Merged **Merged:** 10/16/2026 **Merged by:** [@ylli-selmani](https://github.com/ylli-selmani) **Base:** `staging` ← **Head:** `feat/inline-illustrations` --- ### 📝 Commits (3) - [`6b9b155`](https://github.com/Pasta-Devs/Marinara-Engine/commit/6b9b1555f43fed4f2344e7cb6b25a27d0bea4e2d) feat(roleplay): render illustrate command images in-line (#7748) - [`63a9834`](https://github.com/Pasta-Devs/Marinara-Engine/commit/63a98348c0a4c77dc6cad1661132aab9ec137313) fix(roleplay): keep the Render in-line switch from being squeezed - [`a1dd54e`](https://github.com/Pasta-Devs/Marinara-Engine/commit/a1dd54e89bd9cbf26351c006e6ac708468e63448) fix(roleplay): keep image remove button on touch, distinct prompts in test ### 📊 Changes **10 files changed** (+407 additions, -54 deletions) <details> <summary>View changed files</summary> 📝 `docs/roleplay/getting-started.md` (+6 -0) 📝 `e2e/roleplay-commands.e2e.ts` (+220 -0) 📝 `packages/client/src/components/chat/ChatMessage.tsx` (+119 -48) 📝 `packages/client/src/components/chat/RoleplayCommandsSettings.tsx` (+16 -0) 📝 `packages/client/src/localization/locales/en.json` (+2 -0) 📝 `packages/server/src/routes/generate.routes.ts` (+25 -5) 📝 `packages/server/src/services/generation/roleplay-commands.ts` (+4 -1) 📝 `packages/shared/src/types/chat-preset.ts` (+1 -0) 📝 `packages/shared/src/types/chat.ts` (+2 -0) 📝 `scripts/regressions/roleplay-commands.regression.ts` (+12 -0) </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 #7748 Docs translation follow-up: #7749 ## Why this change - A character can already write `[illustrate: ...]` between paragraphs, right where a moment happens, but every image lands below the message. A reply with three illustrations shows all three stacked at the bottom, away from the moments they show. ## What changed - **Render in-line** sub-toggle under the Illustrations command (Chat Settings → Agents → Commands), stored as `roleplayIllustrateInline` and kept in chat setting profiles. Off keeps today's behaviour. - When it is on, each `[illustrate]` command saves its place in the reply the same way whispers do (`contentOffset` + `contentAnchor`), so edits and split replies keep it next to the same text through the existing reanchoring. - Each command image records `roleplayCommandIndex`, the index of the command that made it, so a failed command or several variants can't mismatch images. - The message slots those images into its text at the command's place via the existing inline-command markers, scaled to fit. Clicking opens the viewer with the prompt and the X removes the image. The image tile is now one shared renderer for the inline and below-message spots, and its remove button stays visible on touch screens. - The illustrate prompt line gains: "The image appears exactly where you write the command, so place it where the picture belongs: at the start, between paragraphs, or at the end." - Only new images are affected. Automatic Illustrator runs, retries and the Visual Novel layout keep showing images below or on their stage. - Docs: new "Illustrations in the message" section in `docs/roleplay/getting-started.md`. - Tests: the prompt sentence is pinned in `roleplay-commands.regression.ts`, and a new e2e test in `roleplay-commands.e2e.ts` covers placement, each image's own prompt in the viewer, remove, and the setting. ## 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` ### Manual verification notes Run in the cloud container: - Client and server `tsc --noEmit`, ESLint on the changed client files, `pnpm localization:check`, `pnpm format:check` and `pnpm impeccable:check` pass. - Full node regression suite: 909/909 pass (two first failed on module-loading errors while running next to the e2e servers, and passed when rerun alone). - The new e2e test passes on desktop-chromium and mobile-chromium. Still to verify by hand: - With a real Illustrator connection, ask for illustrations between paragraphs and check each image lands at its place. - Edit the message text around an image and check it stays with its paragraph. - Turn Render in-line off and check new images go below the message again. ## 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) ## UI evidence (if applicable) Images from the e2e fixture (solid colours stand in for illustrations); screenshots to be added to the PR. <img width="857" height="1250" alt="image" src="https://github.com/user-attachments/assets/2ed1a69a-cc7f-4c47-be49-998f2a518c0c" /> 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Added a chat setting to render roleplay-command illustrations inline at the command’s position in the message. Inline images retain their controls and can be opened or removed individually. - Documented how to enable inline illustrations in chat settings. - **Bug Fixes** - Inline illustrations now appear alongside the corresponding message content, while other attachments and existing image behavior remain unchanged. <!-- 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-24 04:08:46 +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#7912
No description provided.