[PR #7301] [MERGED] fix(gallery): Background works when Illustrator is installed but not added #7672

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

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/7301
Author: @SpicyMarinara
Created: 10/8/2026
Status: ✅ Merged
Merged: 10/8/2026
Merged by: @SpicyMarinara

Base: staging ← Head: fix/gallery-background-one-off


📝 Commits (1)

  • aac1dca fix(gallery): offer Roleplay Background when Illustrator is installed but not added

📊 Changes

7 files changed (+95 additions, -8 deletions)

View changed files

📝 CHANGELOG.md (+1 -0)
📝 docs/media/scene-backgrounds.md (+2 -0)
📝 docs/roleplay/backgrounds.md (+1 -1)
📝 e2e/illustrator-manual-cadence.e2e.ts (+22 -1)
📝 packages/client/src/components/chat/ChatGalleryPanel.tsx (+4 -4)
📝 packages/server/src/routes/generate/retry-agents-route.ts (+4 -1)
📝 scripts/regressions/illustrator-message-range.regression.ts (+61 -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 #7300

Why this change

In a Roleplay chat where Illustrator is installed but not added, the Gallery offered a one-off Illustrate (added in #6885) but not Background. To get a one-off generated scene background, people had to add Illustrator to the chat, which also turns on its automatic runs. Mari asked for Background to be available whenever Illustrate is.

Root cause: two gates. The Gallery passed the background action only when Illustrator was added to the chat, and the retry route only treated a one-off request as allowed without the agent when its target was "illustration", so a background request would have been refused even with the button shown.

What changed

  • ChatGalleryPanel.tsx: Illustrate and Background share one condition, manualIllustratorAvailable (Illustrator installed, and either a Roleplay chat or Illustrator enabled for the chat). Game and Conversation are unchanged: in Game it equals the old condition, and Conversation has no Background action.
  • retry-agents-route.ts: a request for exactly ["illustrator"] with retry targets exactly ["background"] now counts as a one-off manual run, like Illustrate. Illustrator is resolved for that request even when it isn't added to the chat or agents are off. It never writes enableAgents or activeAgentIds. Requests with both targets, ordinary retries and an uninstalled package still go through the active-agent check. The other gates on the path (no config row, connection resolution, the auto-backgrounds switch, applying the background) were traced and already allow a manual background request.
  • scripts/regressions/illustrator-message-range.regression.ts: with agents off, and with agents on but Illustrator not added, a background-only request makes one plan and one image, applies the background and leaves chat activation unchanged. A request with both targets, and a request with the package uninstalled, fail without calling the provider.
  • e2e/illustrator-manual-cadence.e2e.ts: Background shows with agents off, is hidden when the package is uninstalled, and sends the background payload without changing activation. Existing assertions are unchanged; only the first test's title now mentions background.
  • Docs: docs/media/scene-backgrounds.md and docs/roleplay/backgrounds.md. CHANGELOG entry under [Unreleased].

Known side effect, the same as Illustrate since #6885: a background-only retry, such as the one offered after an automatic background run fails, also runs after Illustrator has been removed from the chat. It still needs a click and an installed package.

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

Agent-run checks (not a substitute for the boxes above):

  • pnpm check on the final head: exit 0.
  • Regressions illustrator-message-range, illustrator-manual-cadence, manual-agent-retry-resolution, agent-connection-parameters, agent-retry-batching, docs-language: all pass. With retry-agents-route.ts reverted to staging, illustrator-message-range fails at the new background assertion (no background_change).
  • e2e/illustrator-manual-cadence.e2e.ts + e2e/illustration-arrival.e2e.ts on desktop-chromium: 8 passed. illustrator-manual-cadence on mobile-webkit: 2 passed. With the client change reverted, the first test fails at expect(background).toBeVisible().
  • An independent reviewer found no defects and no spec gaps. A separate verifier traced the client and server paths again and agreed.
  • Local CodeRabbit (coderabbit review --agent --committed): 0 findings.

Manual verification notes

  • Manually verify in a browser: with Illustrator installed but not added to a Roleplay chat (agents off), the chat Gallery shows Illustrate and Background.
  • Manually verify that Background generates a scene background and applies it, and that Illustrator is still not added and agents stay off afterwards.
  • Manually verify the same with Illustrator added (unchanged), and that Game and Conversation Galleries look as before.
  • Manually verify with Illustrator uninstalled: neither button shows.
  • Manually verify with Review image prompts before send on: Background opens the prompt review, and Continue makes and applies the background without Illustrator added.
  • Manually verify at phone width that Illustrate and Background fit side by side.

Docs and release impact

  • No docs changes needed
  • Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) 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)

Translation follow-up: #7302.

  • Version/release files updated (only if this PR includes a version bump)

UI evidence (if applicable)

None yet.


🔄 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/7301 **Author:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Created:** 10/8/2026 **Status:** ✅ Merged **Merged:** 10/8/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `staging` ← **Head:** `fix/gallery-background-one-off` --- ### 📝 Commits (1) - [`aac1dca`](https://github.com/Pasta-Devs/Marinara-Engine/commit/aac1dca47eab5d0c3949e6de9e9e471210fa18d3) fix(gallery): offer Roleplay Background when Illustrator is installed but not added ### 📊 Changes **7 files changed** (+95 additions, -8 deletions) <details> <summary>View changed files</summary> 📝 `CHANGELOG.md` (+1 -0) 📝 `docs/media/scene-backgrounds.md` (+2 -0) 📝 `docs/roleplay/backgrounds.md` (+1 -1) 📝 `e2e/illustrator-manual-cadence.e2e.ts` (+22 -1) 📝 `packages/client/src/components/chat/ChatGalleryPanel.tsx` (+4 -4) 📝 `packages/server/src/routes/generate/retry-agents-route.ts` (+4 -1) 📝 `scripts/regressions/illustrator-message-range.regression.ts` (+61 -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`. <!-- See CONTRIBUTING.md § Branches. --> ## Linked issue Closes #7300 ## Why this change In a Roleplay chat where Illustrator is installed but not added, the Gallery offered a one-off **Illustrate** (added in #6885) but not **Background**. To get a one-off generated scene background, people had to add Illustrator to the chat, which also turns on its automatic runs. Mari asked for **Background** to be available whenever **Illustrate** is. Root cause: two gates. The Gallery passed the background action only when Illustrator was added to the chat, and the retry route only treated a one-off request as allowed without the agent when its target was "illustration", so a background request would have been refused even with the button shown. ## What changed - `ChatGalleryPanel.tsx`: **Illustrate** and **Background** share one condition, `manualIllustratorAvailable` (Illustrator installed, and either a Roleplay chat or Illustrator enabled for the chat). Game and Conversation are unchanged: in Game it equals the old condition, and Conversation has no Background action. - `retry-agents-route.ts`: a request for exactly `["illustrator"]` with retry targets exactly `["background"]` now counts as a one-off manual run, like Illustrate. Illustrator is resolved for that request even when it isn't added to the chat or agents are off. It never writes `enableAgents` or `activeAgentIds`. Requests with both targets, ordinary retries and an uninstalled package still go through the active-agent check. The other gates on the path (no config row, connection resolution, the auto-backgrounds switch, applying the background) were traced and already allow a manual background request. - `scripts/regressions/illustrator-message-range.regression.ts`: with agents off, and with agents on but Illustrator not added, a background-only request makes one plan and one image, applies the background and leaves chat activation unchanged. A request with both targets, and a request with the package uninstalled, fail without calling the provider. - `e2e/illustrator-manual-cadence.e2e.ts`: Background shows with agents off, is hidden when the package is uninstalled, and sends the background payload without changing activation. Existing assertions are unchanged; only the first test's title now mentions background. - Docs: `docs/media/scene-backgrounds.md` and `docs/roleplay/backgrounds.md`. CHANGELOG entry under `[Unreleased]`. Known side effect, the same as Illustrate since #6885: a background-only retry, such as the one offered after an automatic background run fails, also runs after Illustrator has been removed from the chat. It still needs a click and an installed package. ## 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` Agent-run checks (not a substitute for the boxes above): - `pnpm check` on the final head: exit 0. - Regressions `illustrator-message-range`, `illustrator-manual-cadence`, `manual-agent-retry-resolution`, `agent-connection-parameters`, `agent-retry-batching`, `docs-language`: all pass. With `retry-agents-route.ts` reverted to staging, `illustrator-message-range` fails at the new background assertion (no `background_change`). - `e2e/illustrator-manual-cadence.e2e.ts` + `e2e/illustration-arrival.e2e.ts` on desktop-chromium: 8 passed. `illustrator-manual-cadence` on mobile-webkit: 2 passed. With the client change reverted, the first test fails at `expect(background).toBeVisible()`. - An independent reviewer found no defects and no spec gaps. A separate verifier traced the client and server paths again and agreed. - Local CodeRabbit (`coderabbit review --agent --committed`): 0 findings. ### Manual verification notes - Manually verify in a browser: with Illustrator installed but not added to a Roleplay chat (agents off), the chat Gallery shows **Illustrate** and **Background**. - Manually verify that **Background** generates a scene background and applies it, and that Illustrator is still not added and agents stay off afterwards. - Manually verify the same with Illustrator added (unchanged), and that Game and Conversation Galleries look as before. - Manually verify with Illustrator uninstalled: neither button shows. - Manually verify with **Review image prompts before send** on: Background opens the prompt review, and Continue makes and applies the background without Illustrator added. - Manually verify at phone width that Illustrate and Background fit side by side. ## Docs and release impact - [ ] No docs changes needed - [ ] Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) 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) Translation follow-up: #7302. - [ ] Version/release files updated (only if this PR includes a version bump) ## UI evidence (if applicable) None yet. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-24 04:06:22 +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#7672
No description provided.