[PR #4185] [MERGED] Fix Roleplay input latency, Illustrator handoff, and settings controls #6274

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

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/4185
Author: @SpicyMarinara
Created: 7/27/2026
Status: ✅ Merged
Merged: 7/27/2026
Merged by: @SpicyMarinara

Base: staging ← Head: fix/roleplay-illustrator-settings-fixes


📝 Commits (4)

  • 697df67 fix roleplay composer editing latency
  • 8ef14a5 fix manual gallery illustrator prompt handoff
  • 70b6e20 add background controls and backup retention
  • 3e02242 address CodeRabbit review feedback

📊 Changes

20 files changed (+1256 additions, -172 deletions)

View changed files

📝 docs/data/backup-and-restore.md (+10 -8)
📝 docs/data/where-data-is-stored.md (+4 -3)
📝 e2e/core-flows.e2e.ts (+85 -4)
📝 package.json (+2 -1)
📝 packages/client/src/components/chat/ChatInput.tsx (+9 -24)
📝 packages/client/src/components/chat/ChatRoleplaySurface.tsx (+19 -7)
📝 packages/client/src/components/panels/SettingsPanel.tsx (+42 -3)
📝 packages/client/src/components/panels/settings/BackgroundPicker.tsx (+131 -68)
📝 packages/client/src/localization/locales/en.json (+7 -2)
📝 packages/client/src/localization/locales/pl.json (+1 -1)
📝 packages/client/src/stores/chat.store.ts (+11 -1)
📝 packages/server/src/routes/backup.routes.ts (+78 -22)
📝 packages/server/src/routes/generate/retry-agents-route.ts (+117 -5)
➕ packages/server/src/services/backup/automatic-backup-retention.ts (+93 -0)
📝 packages/server/src/services/game/game-asset-generation.ts (+22 -3)
📝 packages/server/src/services/generation/illustrator-background-generation.ts (+58 -14)
➕ packages/server/src/services/generation/illustrator-manual-prompt-generation.ts (+255 -0)
➕ scripts/regressions/automatic-backup-retention.regression.ts (+91 -0)
📝 scripts/regressions/prompt.regression.ts (+191 -1)
📝 scripts/regressions/roleplay-streaming.regression.ts (+30 -5)

📄 Description

Why

Live testing exposed four related usability and orchestration problems:

  • Roleplay text editing, especially repeated deletion, could stall because controlled composer updates and resize work were coupled too tightly to global state.
  • Manual Gallery Illustration and Background buttons still asked Illustrator to decide whether and what to generate, even though the button already made that decision. Auto style guidance could also replace the detailed semantic prompt, and some manual background runs stopped after prompt generation.
  • Long background tag lists overwhelmed Appearance settings, while the background title, action tray, and tag editor competed for too little horizontal space on desktop.
  • Automatic backups had no user-configurable retention limit.

No linked issue exists for this maintainer-requested live-testing bundle. A follow-up issue should be opened if further work is needed.

What changed

Roleplay composer

  • Keep local composer edits responsive while synchronizing the draft store outside the immediate keystroke path.
  • Reduce unnecessary Roleplay surface resize work during typing and deletion.
  • Extend the Roleplay streaming regression to cover editing and deletion behavior.
  • Route manual Illustration and Background button presses directly into prompt generation without a second generation-decision pass.
  • Preserve automatic every-X-message Illustrator decisions for agent-driven chat runs.
  • Include configured recent messages, character/persona context, optional references, and selected image-style guidance in the prompt-writing request.
  • Treat Auto style as prompt-writer guidance instead of replacing the detailed scene prompt.
  • Preserve the final detailed background prompt through provider handoff and force manual background rendering while retaining automatic cache reuse.

Appearance background controls

  • Collapse each background's tags behind an independent disclosure.
  • Give background titles the full text row and move the compact delete/favorite tray beside the Library metadata badge.
  • Match the disclosure to compact tag-chip density, widen the tag entry field, and use the configured accent for both action icons.
  • Add desktop/mobile layout assertions for title width, action density, tag disclosure size, input width, and action color parity.

Automatic backup retention

  • Add an Automatic backups kept setting with a validated range of 1 to 9999.
  • Keep the newest automatic backup at the existing compatibility filename, rotate older automatic archives, and prune only automatic-backup-owned files.
  • Apply retention immediately when settings change and preserve legacy previous-backup recovery.
  • Update English/Polish UI copy, user documentation, and regression coverage.

Root causes

  • Composer draft persistence and layout measurement were occurring too close to the native input event path.
  • Manual Gallery requests shared decision-oriented Illustrator orchestration with automatic agent cadence runs.
  • Auto style text was compiled as a provider prompt instead of an instruction for the prompt writer.
  • Background row layout permanently reserved title width for a hover-only action tray and displayed every tag inline.
  • Automatic backup storage used a single compatibility path without an owned archive-retention policy.

Validation

  • pnpm check
  • pnpm regression:prompt
  • pnpm regression:roleplay
  • pnpm regression:backup
  • pnpm regression:docs
  • Focused Playwright Settings suite: 4 passed across desktop and mobile
  • Full pnpm smoke:ui: 132 passed, 73 skipped; 11 baseline failures remain. The relevant Illustrator 404-console failure and Roleplay-background cleanup timeout reproduce unchanged on detached origin/staging. Another baseline test expects IndexedDB schema 84 while current staging reports 87.
  • git diff --check

Manual verification

  • Manually verify sustained typing and repeated deletion in a long Roleplay chat.
  • Manually generate both Illustration and Background assets from Gallery buttons with Auto and explicit styles.
  • Manually verify automatic every-X-message Illustrator runs still ask whether generation is warranted.
  • Manually verify background title, tag disclosure, tag editing, favorite, and delete controls on desktop.
  • Manually verify automatic backup rotation at retention values 1, 3, and 9999.

Summary by CodeRabbit

  • New Features
    • Configure automatic backup frequency and retain 1–9,999 archives.
    • Automatic backups now use timestamped archives while preserving manual backups.
    • Manually retry illustration and background generation with improved style handling.
    • Background tags are collapsed by default and can be expanded or hidden individually.
  • Bug Fixes
    • Improved chat input state updates and roleplay layout responsiveness.
  • Documentation
    • Updated backup storage, retention, and restore guidance.

🔄 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/4185 **Author:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Created:** 7/27/2026 **Status:** ✅ Merged **Merged:** 7/27/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `staging` ← **Head:** `fix/roleplay-illustrator-settings-fixes` --- ### 📝 Commits (4) - [`697df67`](https://github.com/Pasta-Devs/Marinara-Engine/commit/697df6772c115934762ca1c2ecc1a8b1c8ea103d) fix roleplay composer editing latency - [`8ef14a5`](https://github.com/Pasta-Devs/Marinara-Engine/commit/8ef14a53a7a8ae330da08442d6c4dee1805a91bc) fix manual gallery illustrator prompt handoff - [`70b6e20`](https://github.com/Pasta-Devs/Marinara-Engine/commit/70b6e2013565c400c6ba2690d85d32d611972f36) add background controls and backup retention - [`3e02242`](https://github.com/Pasta-Devs/Marinara-Engine/commit/3e02242c0981fbb88d20c72703f89d5ed5a3c8ee) address CodeRabbit review feedback ### 📊 Changes **20 files changed** (+1256 additions, -172 deletions) <details> <summary>View changed files</summary> 📝 `docs/data/backup-and-restore.md` (+10 -8) 📝 `docs/data/where-data-is-stored.md` (+4 -3) 📝 `e2e/core-flows.e2e.ts` (+85 -4) 📝 `package.json` (+2 -1) 📝 `packages/client/src/components/chat/ChatInput.tsx` (+9 -24) 📝 `packages/client/src/components/chat/ChatRoleplaySurface.tsx` (+19 -7) 📝 `packages/client/src/components/panels/SettingsPanel.tsx` (+42 -3) 📝 `packages/client/src/components/panels/settings/BackgroundPicker.tsx` (+131 -68) 📝 `packages/client/src/localization/locales/en.json` (+7 -2) 📝 `packages/client/src/localization/locales/pl.json` (+1 -1) 📝 `packages/client/src/stores/chat.store.ts` (+11 -1) 📝 `packages/server/src/routes/backup.routes.ts` (+78 -22) 📝 `packages/server/src/routes/generate/retry-agents-route.ts` (+117 -5) ➕ `packages/server/src/services/backup/automatic-backup-retention.ts` (+93 -0) 📝 `packages/server/src/services/game/game-asset-generation.ts` (+22 -3) 📝 `packages/server/src/services/generation/illustrator-background-generation.ts` (+58 -14) ➕ `packages/server/src/services/generation/illustrator-manual-prompt-generation.ts` (+255 -0) ➕ `scripts/regressions/automatic-backup-retention.regression.ts` (+91 -0) 📝 `scripts/regressions/prompt.regression.ts` (+191 -1) 📝 `scripts/regressions/roleplay-streaming.regression.ts` (+30 -5) </details> ### 📄 Description ## Why Live testing exposed four related usability and orchestration problems: - Roleplay text editing, especially repeated deletion, could stall because controlled composer updates and resize work were coupled too tightly to global state. - Manual Gallery Illustration and Background buttons still asked Illustrator to decide whether and what to generate, even though the button already made that decision. Auto style guidance could also replace the detailed semantic prompt, and some manual background runs stopped after prompt generation. - Long background tag lists overwhelmed Appearance settings, while the background title, action tray, and tag editor competed for too little horizontal space on desktop. - Automatic backups had no user-configurable retention limit. No linked issue exists for this maintainer-requested live-testing bundle. A follow-up issue should be opened if further work is needed. ## What changed ### Roleplay composer - Keep local composer edits responsive while synchronizing the draft store outside the immediate keystroke path. - Reduce unnecessary Roleplay surface resize work during typing and deletion. - Extend the Roleplay streaming regression to cover editing and deletion behavior. ### Manual Gallery Illustrator - Route manual Illustration and Background button presses directly into prompt generation without a second generation-decision pass. - Preserve automatic every-X-message Illustrator decisions for agent-driven chat runs. - Include configured recent messages, character/persona context, optional references, and selected image-style guidance in the prompt-writing request. - Treat Auto style as prompt-writer guidance instead of replacing the detailed scene prompt. - Preserve the final detailed background prompt through provider handoff and force manual background rendering while retaining automatic cache reuse. ### Appearance background controls - Collapse each background's tags behind an independent disclosure. - Give background titles the full text row and move the compact delete/favorite tray beside the Library metadata badge. - Match the disclosure to compact tag-chip density, widen the tag entry field, and use the configured accent for both action icons. - Add desktop/mobile layout assertions for title width, action density, tag disclosure size, input width, and action color parity. ### Automatic backup retention - Add an Automatic backups kept setting with a validated range of 1 to 9999. - Keep the newest automatic backup at the existing compatibility filename, rotate older automatic archives, and prune only automatic-backup-owned files. - Apply retention immediately when settings change and preserve legacy previous-backup recovery. - Update English/Polish UI copy, user documentation, and regression coverage. ## Root causes - Composer draft persistence and layout measurement were occurring too close to the native input event path. - Manual Gallery requests shared decision-oriented Illustrator orchestration with automatic agent cadence runs. - Auto style text was compiled as a provider prompt instead of an instruction for the prompt writer. - Background row layout permanently reserved title width for a hover-only action tray and displayed every tag inline. - Automatic backup storage used a single compatibility path without an owned archive-retention policy. ## Validation - `pnpm check` - `pnpm regression:prompt` - `pnpm regression:roleplay` - `pnpm regression:backup` - `pnpm regression:docs` - Focused Playwright Settings suite: 4 passed across desktop and mobile - Full `pnpm smoke:ui`: 132 passed, 73 skipped; 11 baseline failures remain. The relevant Illustrator 404-console failure and Roleplay-background cleanup timeout reproduce unchanged on detached `origin/staging`. Another baseline test expects IndexedDB schema 84 while current staging reports 87. - `git diff --check` ## Manual verification - [ ] Manually verify sustained typing and repeated deletion in a long Roleplay chat. - [ ] Manually generate both Illustration and Background assets from Gallery buttons with Auto and explicit styles. - [ ] Manually verify automatic every-X-message Illustrator runs still ask whether generation is warranted. - [ ] Manually verify background title, tag disclosure, tag editing, favorite, and delete controls on desktop. - [ ] Manually verify automatic backup rotation at retention values 1, 3, and 9999. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Configure automatic backup frequency and retain 1–9,999 archives. * Automatic backups now use timestamped archives while preserving manual backups. * Manually retry illustration and background generation with improved style handling. * Background tags are collapsed by default and can be expanded or hidden individually. * **Bug Fixes** * Improved chat input state updates and roleplay layout responsiveness. * **Documentation** * Updated backup storage, retention, and restore guidance. <!-- 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-23 04:08:50 +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#6274
No description provided.