[PR #8939] [MERGED] fix(music-dj): a chat's Game Assets music folder applies to that chat only #8895

Closed
opened 2026-11-07 20:43:05 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

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

Base: staging ← Head: fix/chat-music-folder


📝 Commits (2)

  • 8772fd7 fix(music-dj): a chat's Game Assets music folder applies to that chat only (#8916)
  • 984cf78 fix(client): clearing This chat's Game Assets folder keeps Apply to on This chat

📊 Changes

10 files changed (+261 additions, -46 deletions)

View changed files

📝 docs/media/music.md (+2 -0)
📝 packages/client/src/components/chat/AgentAddSetupFields.tsx (+59 -7)
📝 packages/client/src/components/chat/ChatSettingsDrawer.tsx (+43 -29)
📝 packages/client/src/localization/locales/en.json (+1 -0)
📝 packages/shared/src/types/chat-preset.ts (+2 -2)
📝 packages/shared/src/types/chat.ts (+5 -0)
📝 packages/shared/src/utils/music-dj-folder.ts (+11 -3)
📝 scripts/regressions/capability-gm-verbs.regression.ts (+8 -5)
📝 scripts/regressions/illustrator-manual-cadence.regression.ts (+62 -0)
📝 scripts/regressions/music-dj-local-library.regression.ts (+68 -0)

📄 Description

Linked issue

Closes #8916

Why this change

A chat's Game Assets music folder was saved but never used.

  • The drawer wrote the chat's value to chat metadata customMusicFolder and copied it into the global Music DJ setting.
  • The server read only the global setting, so every chat followed whatever was saved last.
  • The two client readers disagreed: the drawer preferred the chat's value, the add window the agent's.

Since #8901 (#8914), a folder on this device can be set per chat. A Game Assets subfolder couldn't.

What changed

  • A chat's own Game Assets subfolder lives under a new chat metadata key, customMusicGameAssetsFolder. Only an explicit edit under Apply to: This chat writes it.
    • Staging wrote the old customMusicFolder key into nearly every chat when Music DJ was added, copied from the default. Those old copies are ignored and keep following the default, so existing chats don't silently freeze on an old value.
  • Server: applyMusicDjChatFolder (packages/shared/src/utils/music-dj-folder.ts) overlays the chat's subfolder onto the Music DJ settings in every path that runs the Music DJ (generate, retry, agent resolution, Game mode). A device folder still wins, and ../ paths are clamped as before.
  • Client, in the drawer and the add window (the add window is also used by the chat wizard):
    • All chats (default) edits the default subfolder again, as before.
    • This chat shows a Game Assets Music Folder field while the chat plays Game Assets. Its placeholder is the default, its hint reads "Saved for this chat only. Leave it empty to use the default." It saves only to this chat, and clearing it goes back to the default.
    • It opens on This chat when the chat has its own subfolder.
    • Saving from a chat no longer touches the global setting.
  • The new key is excluded from settings profiles and wizard defaults, like the chat's device folder.
  • docs/media/music.md: one paragraph on the per-chat Game Assets folder.

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 by the agent (not a substitute for the boxes above):

  • pnpm check and pnpm localization:check: pass.
  • Regressions:
    • music-dj-local-library:
      • two chats resolve different folders;
      • an old copied customMusicFolder follows the default;
      • blank falls back to the default;
      • ../outside is clamped;
      • a device folder wins.
    • illustrator-manual-cadence: the save targets for This chat and All chats, opening on This chat, and clearing back to the default.
    • capability-gm-verbs, chat-profile-*, chat-wizard-defaults, music-dj-* and others: pass.
  • The overlay test fails when the old key is read as a fallback.

Still to verify by hand:

  • Manually verify in Chat Settings → Music DJ (Custom, Game Assets) that under All chats (default), typing music/combat changes the default in the Music DJ editor.
  • Manually verify that under This chat it changes only this chat, and that another chat keeps the default.
  • Manually verify that a chat created before this change still follows the default.

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)

🤖 Generated with Claude Code


🔄 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/8939 **Author:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Created:** 11/7/2026 **Status:** ✅ Merged **Merged:** 11/7/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `staging` ← **Head:** `fix/chat-music-folder` --- ### 📝 Commits (2) - [`8772fd7`](https://github.com/Pasta-Devs/Marinara-Engine/commit/8772fd70aba73afd607abe62bd6f83a982b74166) fix(music-dj): a chat's Game Assets music folder applies to that chat only (#8916) - [`984cf78`](https://github.com/Pasta-Devs/Marinara-Engine/commit/984cf78b00f19759979fe9e277a0199fd510452f) fix(client): clearing This chat's Game Assets folder keeps Apply to on This chat ### 📊 Changes **10 files changed** (+261 additions, -46 deletions) <details> <summary>View changed files</summary> 📝 `docs/media/music.md` (+2 -0) 📝 `packages/client/src/components/chat/AgentAddSetupFields.tsx` (+59 -7) 📝 `packages/client/src/components/chat/ChatSettingsDrawer.tsx` (+43 -29) 📝 `packages/client/src/localization/locales/en.json` (+1 -0) 📝 `packages/shared/src/types/chat-preset.ts` (+2 -2) 📝 `packages/shared/src/types/chat.ts` (+5 -0) 📝 `packages/shared/src/utils/music-dj-folder.ts` (+11 -3) 📝 `scripts/regressions/capability-gm-verbs.regression.ts` (+8 -5) 📝 `scripts/regressions/illustrator-manual-cadence.regression.ts` (+62 -0) 📝 `scripts/regressions/music-dj-local-library.regression.ts` (+68 -0) </details> ### 📄 Description ## Linked issue Closes #8916 ## Why this change A chat's Game Assets music folder was saved but never used. - The drawer wrote the chat's value to chat metadata `customMusicFolder` and copied it into the global Music DJ setting. - The server read only the global setting, so every chat followed whatever was saved last. - The two client readers disagreed: the drawer preferred the chat's value, the add window the agent's. Since #8901 (#8914), a folder on this device can be set per chat. A Game Assets subfolder couldn't. ## What changed - **A chat's own Game Assets subfolder** lives under a new chat metadata key, `customMusicGameAssetsFolder`. Only an explicit edit under **Apply to: This chat** writes it. - Staging wrote the old `customMusicFolder` key into nearly every chat when Music DJ was added, copied from the default. Those old copies are ignored and keep following the default, so existing chats don't silently freeze on an old value. - **Server:** `applyMusicDjChatFolder` (`packages/shared/src/utils/music-dj-folder.ts`) overlays the chat's subfolder onto the Music DJ settings in every path that runs the Music DJ (generate, retry, agent resolution, Game mode). A device folder still wins, and `../` paths are clamped as before. - **Client, in the drawer and the add window (the add window is also used by the chat wizard):** - **All chats (default)** edits the default subfolder again, as before. - **This chat** shows a **Game Assets Music Folder** field while the chat plays Game Assets. Its placeholder is the default, its hint reads "Saved for this chat only. Leave it empty to use the default." It saves only to this chat, and clearing it goes back to the default. - It opens on **This chat** when the chat has its own subfolder. - Saving from a chat no longer touches the global setting. - The new key is excluded from settings profiles and wizard defaults, like the chat's device folder. - `docs/media/music.md`: one paragraph on the per-chat Game Assets folder. ## 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 by the agent (not a substitute for the boxes above): - `pnpm check` and `pnpm localization:check`: pass. - Regressions: - `music-dj-local-library`: - two chats resolve different folders; - an old copied `customMusicFolder` follows the default; - blank falls back to the default; - `../outside` is clamped; - a device folder wins. - `illustrator-manual-cadence`: the save targets for **This chat** and **All chats**, opening on **This chat**, and clearing back to the default. - `capability-gm-verbs`, `chat-profile-*`, `chat-wizard-defaults`, `music-dj-*` and others: pass. - The overlay test fails when the old key is read as a fallback. Still to verify by hand: - Manually verify in Chat Settings → Music DJ (Custom, Game Assets) that under **All chats (default)**, typing `music/combat` changes the default in the Music DJ editor. - Manually verify that under **This chat** it changes only this chat, and that another chat keeps the default. - Manually verify that a chat created before this change still follows the default. ## Docs and release impact - [ ] No docs changes needed - [x] Updated docs (README / CONTRIBUTING / android/README) as needed - [x] 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) 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi changed title from [PR #8939] fix(music-dj): a chat's Game Assets music folder applies to that chat only to [PR #8939] [MERGED] fix(music-dj): a chat's Game Assets music folder applies to that chat only 2026-11-07 21:50:02 +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#8895
No description provided.