mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
Labels
No labels
android
bug
bugfix
ci
client
code freeze pause
container
dependencies
docs
documentation
duplicate
enhancement
feature
feature
feature
feature-creep
fixed-in-refactor
fixed-in-staging
good first issue
help wanted
in-pr
in-pr
needs-codeowner-decision
normal-scope
old-codebase
old-codebase
pull-request
qol
question
refactor
regression
revisit later
roadmap
scope-risk
scope-risk
server
server
shared
soup
upstream
windows
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Pasta-Devs/Marinara-Engine#7918
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/7766
Author: @ylli-selmani
Created: 10/17/2026
Status: ✅ Merged
Merged: 10/17/2026
Merged by: @ylli-selmani
Base:
staging← Head:feat/game-data-state-editor📝 Commits (5)
0b00f97feat(game): read-only Game data view in the State Editor (#7743 slice 1)3fa87f8feat(game): save hand edits of game data through a checked route (#7743 slice 2)f4f3281fix(game): keep ruleset sheets and party NPCs in game data edits (#7743)5225254fix(game): a saved game data edit stays saved when reading it back fails (#7743)bf67ac4fix(game): clear the Game data editor's notice once a save lands (#7743)📊 Changes
16 files changed (+1439 additions, -27 deletions)
View changed files
📝
packages/client/src/components/game/GameSurface.tsx(+8 -0)📝
packages/client/src/components/layout/ModalRenderer.tsx(+6 -0)➕
packages/client/src/components/modals/GameDataEditorModal.tsx(+234 -0)📝
packages/client/src/components/ui/state-editor/StateEditor.tsx(+22 -5)📝
packages/client/src/components/ui/state-editor/StateFieldsView.tsx(+28 -20)📝
packages/client/src/components/ui/state-editor/StateJsonField.tsx(+4 -0)➕
packages/client/src/lib/state-editor/game-data-editor-source.ts(+197 -0)📝
packages/client/src/lib/state-editor/state-editor-json.ts(+1 -0)📝
packages/client/src/lib/state-editor/state-editor.types.ts(+2 -0)📝
packages/client/src/localization/locales/en.json(+82 -2)📝
packages/server/src/routes/game.routes.ts(+47 -0)➕
packages/server/src/services/game/game-data-edit.service.ts(+293 -0)📝
packages/shared/src/index.ts(+1 -0)➕
packages/shared/src/utils/game-data-edit.ts(+95 -0)➕
scripts/regressions/game-data-edit.regression.ts(+309 -0)📝
scripts/regressions/state-editor.regression.ts(+110 -0)📄 Description
Linked issue
Part of #7743 (slices 1 and 2). Slices 3 to 6 (inventory, world, story script / party sheet / widgets, checkpoint + Load) come in a second PR, which closes the issue.
Why this change
Game Mode keeps most of its state in chat metadata: the party's cards, NPCs, journal, story, maps. When the model gets one of them wrong (an NPC with the wrong reputation, a quest stuck open), there's no screen to fix it. The only generic writer,
PATCH /api/chats/:id/metadata, merges any key unchecked and replaces lists likegameNpcswholesale, so it can quietly undo a turn that landed in between.What changed
PATCH /api/game/:chatId/data, never the generic metadata PATCH.GAME_DATA_EDITABLE_KEYSin shared) are accepted. New Game Mode keys stay read-only until someone adds them on purpose.normalizeCharacterLookupName). Party cards and arcs can't be added or removed.readRulesetSheetEnvelope). A sheet can't be removed.patchMetadataupdater).game*key, under Settings or Other, so data from future Game Mode work is never hidden.gameSetupConfig) and prompt and media settings stay editable only in Chat Settings, which already edits them. That leaves one save path per key.Commits
0b00f9746slice 1: read-only Game data view in the State Editor3fa87f86fslice 2: save hand edits of game data through a checked routef4f3281fakeep ruleset sheets and party NPCs; shorter warning (local CodeRabbit)Validation
pnpm checkpasses locallyCONTRIBUTING.mdRan on
f4f3281fa:pnpm checkpasses. The only lint warning isHomeProfessorMariChat.tsx:380, which is already on staging. Regressions:game-data-edit(new),state-editor,open-issuesandassigned-issue-sweeppass. On3fa87f86f, everycapability-*regression (19/19) and everygame-*regression (307/307) also passed. Negative controls: removing the read-only guard or the NPC rename check makes the regressions fail. Local CodeRabbit found 3 minor issues, all handled inf4f3281fa. The one partly declined: the stale notice keeps the game-state editor's wording.Manual verification notes
Checked in the browser (dark, default theme) on a seeded test game:
Still to do by hand:
Docs and release impact
docs-i18nbranch updated to match, or a[docs-i18n]follow-up issue opened (see CONTRIBUTING.md § Translated documentation)The second PR updates
docs/game/sessions-and-saves.mdwith the Load checkpoint button and opens the[docs-i18n]follow-up.UI evidence (if applicable)
Game controls → Edit game data:
Search across game data (taken in slice 1, when every section was still read-only):
A rename refused in review (taken before the warning was shortened):
🤖 Generated with Claude Code
Summary by CodeRabbit
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.