[PR #3872] [MERGED] chore: simplify shared contracts and UI state #6137

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

📋 Pull Request Information

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

Base: staging ← Head: chore/simplification-audit-cleanup


📝 Commits (5)

  • 9168cc5 chore: simplify shared contracts and UI state
  • 026a4c9 Merge branch 'staging' into chore/simplification-audit-cleanup
  • e6c4bdf fix: harden preset settings sanitization
  • b4539c0 Merge remote-tracking branch 'origin/staging' into chore/simplification-audit-cleanup
  • b51eed1 Address Spotify source review feedback

📊 Changes

23 files changed (+207 additions, -428 deletions)

View changed files

📝 docs/development/frontend.md (+2 -2)
📝 packages/client/src/components/chat/AgentAddSetupFields.tsx (+1 -4)
📝 packages/client/src/components/chat/ChatRoleplaySurface.tsx (+0 -4)
📝 packages/client/src/components/chat/ChatSettingsDrawer.tsx (+3 -7)
📝 packages/client/src/components/chat/RoleplayHUD.tsx (+46 -106)
📝 packages/client/src/components/game/GameSetupWizard.tsx (+4 -8)
📝 packages/client/src/components/panels/SettingsPanel.tsx (+4 -5)
📝 packages/client/src/hooks/use-chat-summary-prompts.ts (+4 -43)
📝 packages/client/src/hooks/use-settings-sync.ts (+6 -4)
📝 packages/client/src/lib/utils.ts (+5 -24)
📝 packages/client/src/stores/ui.store.ts (+6 -114)
📝 packages/server/src/routes/chat-presets.routes.ts (+4 -6)
📝 packages/server/src/services/generation/roleplay-summary-runtime.ts (+2 -43)
📝 packages/server/src/services/spotify/game-spotify-music.service.ts (+7 -8)
📝 packages/server/src/services/spotify/spotify-dj-constraints.ts (+2 -7)
📝 packages/server/src/services/storage/chat-presets.storage.ts (+10 -33)
📝 packages/shared/src/index.ts (+2 -0)
📝 packages/shared/src/types/chat.ts (+4 -6)
📝 packages/shared/src/types/game.ts (+2 -1)
📝 packages/shared/src/types/persona.ts (+1 -3)

...and 3 more files

📄 Description

Linked issue

Closes #3870

Why this change

  • Reduce contract drift and obsolete persisted UI state found during a behavior-preserving simplification audit.
  • Keep shared client/server normalization rules in one owner so future changes cannot silently diverge.

What changed

  • Replaced duplicate client-only contracts with shared app-settings, avatar-crop, and Spotify source contracts.
  • Moved chat-summary template normalization into shared code used by both client hydration and server prompt assembly.
  • Simplified chat-preset sanitization and routed duplicate/import creation through the storage owner.
  • Removed verified inert UI settings/actions and the unused vertical Roleplay HUD layout while retaining the rendered horizontal behavior.
  • Removed the legacy groupScenarioOverride marker while preserving non-empty scenario text as the runtime signal.
  • Updated frontend development documentation for the retained HUD layout.

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

  • pnpm check: passed after rebasing onto current origin/staging (lint, shared/server/client production builds).
  • Browser pass: Roleplay HUD desktop/mobile layout and popovers; tracker rerun busy/recovery; group scenario save/clear; all four Spotify source values plus malformed fallback; current and legacy avatar crops; New Game wizard through Features.
  • pnpm regression:prompt: the changed chat-summary normalization case passed. The suite later failed its unrelated public-agent-reference assertion on this Windows CRLF checkout (Public agent reference is missing Prose Guardian), although that heading exists on current origin/staging.
  • pnpm smoke:ui: 71 passed, 46 skipped, 3 mobile checks failed outside this change (Noodle mention click intercepted by the sidebar, sidebar animation threshold missed by about 2 px, and touch-drag folder persistence).

Docs and release impact

  • No docs changes needed
  • Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed
  • Version/release files updated (only if this PR includes a version bump)

docs/development/frontend.md was updated for the retained horizontal Roleplay HUD contract. No release metadata changed.

UI evidence (if applicable)

No permanent screenshots or temporary proof artifacts are included. The targeted browser paths are listed above for human reproduction.

Summary by CodeRabbit

  • New Features

    • Added standardized Spotify source handling across chat and game music settings.
    • Improved chat summary prompt settings validation and normalization.
    • Added support for shared avatar crop and application settings contracts.
  • Improvements

    • Simplified roleplay HUD layout and widget popover positioning across desktop and mobile.
    • Streamlined persisted UI settings and music player preferences.
    • Updated group chat scenario configuration behavior.
  • Documentation

    • Updated frontend documentation for persisted chat display settings.

🔄 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/3872 **Author:** [@Xelvanis](https://github.com/Xelvanis) **Created:** 7/20/2026 **Status:** ✅ Merged **Merged:** 7/20/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `staging` ← **Head:** `chore/simplification-audit-cleanup` --- ### 📝 Commits (5) - [`9168cc5`](https://github.com/Pasta-Devs/Marinara-Engine/commit/9168cc5f0551d9c6f0f05754d22ae33cacafccb0) chore: simplify shared contracts and UI state - [`026a4c9`](https://github.com/Pasta-Devs/Marinara-Engine/commit/026a4c97d39793ba3dd5c9a05d338c414bd12ec5) Merge branch 'staging' into chore/simplification-audit-cleanup - [`e6c4bdf`](https://github.com/Pasta-Devs/Marinara-Engine/commit/e6c4bdf81e7638483f22f1faf89f9c4e4d2c6401) fix: harden preset settings sanitization - [`b4539c0`](https://github.com/Pasta-Devs/Marinara-Engine/commit/b4539c0d6b4217a89970644f3ec61ed1b964417c) Merge remote-tracking branch 'origin/staging' into chore/simplification-audit-cleanup - [`b51eed1`](https://github.com/Pasta-Devs/Marinara-Engine/commit/b51eed1abba9504dd6b81495994092d0844075c0) Address Spotify source review feedback ### 📊 Changes **23 files changed** (+207 additions, -428 deletions) <details> <summary>View changed files</summary> 📝 `docs/development/frontend.md` (+2 -2) 📝 `packages/client/src/components/chat/AgentAddSetupFields.tsx` (+1 -4) 📝 `packages/client/src/components/chat/ChatRoleplaySurface.tsx` (+0 -4) 📝 `packages/client/src/components/chat/ChatSettingsDrawer.tsx` (+3 -7) 📝 `packages/client/src/components/chat/RoleplayHUD.tsx` (+46 -106) 📝 `packages/client/src/components/game/GameSetupWizard.tsx` (+4 -8) 📝 `packages/client/src/components/panels/SettingsPanel.tsx` (+4 -5) 📝 `packages/client/src/hooks/use-chat-summary-prompts.ts` (+4 -43) 📝 `packages/client/src/hooks/use-settings-sync.ts` (+6 -4) 📝 `packages/client/src/lib/utils.ts` (+5 -24) 📝 `packages/client/src/stores/ui.store.ts` (+6 -114) 📝 `packages/server/src/routes/chat-presets.routes.ts` (+4 -6) 📝 `packages/server/src/services/generation/roleplay-summary-runtime.ts` (+2 -43) 📝 `packages/server/src/services/spotify/game-spotify-music.service.ts` (+7 -8) 📝 `packages/server/src/services/spotify/spotify-dj-constraints.ts` (+2 -7) 📝 `packages/server/src/services/storage/chat-presets.storage.ts` (+10 -33) 📝 `packages/shared/src/index.ts` (+2 -0) 📝 `packages/shared/src/types/chat.ts` (+4 -6) 📝 `packages/shared/src/types/game.ts` (+2 -1) 📝 `packages/shared/src/types/persona.ts` (+1 -3) _...and 3 more files_ </details> ### 📄 Description <!-- Target branch: `staging`. The default base in this UI is `main` (release branch). --> <!-- Change the base to `staging` before submitting unless this is a maintainer-approved mainline change. --> <!-- See CONTRIBUTING.md § Branches. --> ## Linked issue <!-- Every PR should reference a feature request or issue report. If there isn't one yet, open one first to gather opinions: --> <!-- https://github.com/Pasta-Devs/Marinara-Engine/issues/new/choose --> Closes #3870 ## Why this change <!-- What user problem, bug, or goal does this solve? --> - Reduce contract drift and obsolete persisted UI state found during a behavior-preserving simplification audit. - Keep shared client/server normalization rules in one owner so future changes cannot silently diverge. ## What changed <!-- List the key changes in this PR --> - Replaced duplicate client-only contracts with shared app-settings, avatar-crop, and Spotify source contracts. - Moved chat-summary template normalization into shared code used by both client hydration and server prompt assembly. - Simplified chat-preset sanitization and routed duplicate/import creation through the storage owner. - Removed verified inert UI settings/actions and the unused vertical Roleplay HUD layout while retaining the rendered horizontal behavior. - Removed the legacy `groupScenarioOverride` marker while preserving non-empty scenario text as the runtime signal. - Updated frontend development documentation for the retained HUD layout. ## Validation <!-- Required: include commands run and/or manual checks performed --> - [x] `pnpm check` passes locally - [ ] Container (Docker / Podman) built and ran without issue - [x] Ran the app, clicked through the changes manually - [ ] Checked edge cases (light + dark mode, mobile viewport, empty states, error paths) - [x] Above manual verification completed (describe below) - [x] Read and followed `CONTRIBUTING.md` ### Manual verification notes <!-- Describe exactly what you tested in a real browser/app, step by step. --> <!-- ⚠️ If an AI agent filled out or ticked these boxes for you, treat them --> <!-- as a TO-DO LIST, not as proof the work is done. Verify each item yourself --> <!-- before submitting. If you haven't verified it, untick the box. --> - `pnpm check`: passed after rebasing onto current `origin/staging` (lint, shared/server/client production builds). - Browser pass: Roleplay HUD desktop/mobile layout and popovers; tracker rerun busy/recovery; group scenario save/clear; all four Spotify source values plus malformed fallback; current and legacy avatar crops; New Game wizard through Features. - `pnpm regression:prompt`: the changed chat-summary normalization case passed. The suite later failed its unrelated public-agent-reference assertion on this Windows CRLF checkout (`Public agent reference is missing Prose Guardian`), although that heading exists on current `origin/staging`. - `pnpm smoke:ui`: 71 passed, 46 skipped, 3 mobile checks failed outside this change (Noodle mention click intercepted by the sidebar, sidebar animation threshold missed by about 2 px, and touch-drag folder persistence). ## Docs and release impact - [ ] No docs changes needed - [x] Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed - [ ] Version/release files updated (only if this PR includes a version bump) `docs/development/frontend.md` was updated for the retained horizontal Roleplay HUD contract. No release metadata changed. ## UI evidence (if applicable) <!-- Add before/after screenshots or recordings for UI changes --> No permanent screenshots or temporary proof artifacts are included. The targeted browser paths are listed above for human reproduction. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Added standardized Spotify source handling across chat and game music settings. * Improved chat summary prompt settings validation and normalization. * Added support for shared avatar crop and application settings contracts. * **Improvements** * Simplified roleplay HUD layout and widget popover positioning across desktop and mobile. * Streamlined persisted UI settings and music player preferences. * Updated group chat scenario configuration behavior. * **Documentation** * Updated frontend documentation for persisted chat display settings. <!-- 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:07:25 +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#6137
No description provided.