mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[PR #7739] [MERGED] feat(state-editor): edit values as fields, plus State Editor docs #7908
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#7908
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/7739
Author: @ylli-selmani
Created: 10/16/2026
Status: ✅ Merged
Merged: 10/16/2026
Merged by: @ylli-selmani
Base:
staging← Head:feat/state-editor-form-view📝 Commits (4)
4f47adefeat(state-editor): edit simple values as fields next to the JSON2efde1adocs(state-editor): explain the State Editor and where to open it35253c4fix(state-editor): keep text fields focused while they grow past one linea3ca2a8fix(state-editor): keep only the open view's search target📊 Changes
8 files changed (+404 additions, -27 deletions)
View changed files
📝
docs/agents/approvals-and-agent-suite.md(+3 -1)📝
docs/chats/chat-settings.md(+2 -0)📝
docs/roleplay/hud-and-trackers.md(+14 -0)📝
packages/client/src/components/ui/state-editor/StateEditor.tsx(+91 -25)➕
packages/client/src/components/ui/state-editor/StateFieldsView.tsx(+228 -0)📝
packages/client/src/lib/state-editor/state-editor-json.ts(+38 -1)📝
packages/client/src/localization/locales/en.json(+10 -0)📝
scripts/regressions/state-editor.regression.ts(+18 -0)📄 Description
Linked issue
Part of #7736 (State Editor). Follows #7737, which shipped slices 1–3.
Why this change
Before: the State Editor showed each section as raw JSON only. Fixing one mood or one HP number meant finding it in a wall of braces and keeping the commas right, which is fiddly on a phone.
After: each section opens as Fields: text, numbers and on/off values as boxes, grouped the way the data nests, with characters, items and quests as cards. JSON is one tap away for adding or removing entries. A search result jumps to its field and focuses it. The State Editor also has user docs now.
What changed
4f47adeStateFieldsViewrenders a section's simple values as inputs and writes the same JSON draft as the JSON view, so both views always show the same edit, review and save. Numbers only reach the draft once they parse.nulland structural changes stay in JSON. If the JSON draft doesn't parse, Fields offers a button back to JSON instead of guessing. Search results carry their path, so a click scrolls to and focuses the field.2efde1adocs/roleplay/hud-and-trackers.md(opening it, the turn line, sections, search, Fields/JSON, review/save, and the reload refusals). Pointers from Chat Variables indocs/chats/chat-settings.mdand from the Agent Suite blocks indocs/agents/approvals-and-agent-suite.md.35253c4<input>to<textarea>past 48 characters or on Enter, which dropped focus mid-typing.How:
setStateValueAtPathcopies only the containers on the edited path, so untouched entries keep their identity and keys keep their order;humanizeStateKeyturnscurrentMoodinto "Current mood" for labels while the raw key stays as a tooltip. Both are covered instate-editor.regression.ts.Slice 4 (game mode) is not in this PR. Game state already works in the editor through the trackers. Editing the game's own data (party, NPCs, inventory, world) needs a validating server route and a checkpoint before saving, so it will come as its own PR once the approach is agreed with the game mode maintainers.
Validation
pnpm checkpasses locallyCONTRIBUTING.mdRan:
pnpm lint,pnpm format:check,pnpm localization:check, clienttsc --noEmit, and thestate-editorandopen-issuesregressions. All pass. Local CodeRabbit found one issue (focus lost when a text field grew past one line), fixed in35253c4.Manual verification notes
mood, clicked a result: the Fields view scrolled to that character's Mood and focused it.Docs and release impact
docs-i18nbranch updated to match, or a[docs-i18n]follow-up issue opened (see CONTRIBUTING.md § Translated documentation): #7740UI evidence (if applicable)
Scene in Fields, and Present Characters as cards:
A search result focusing its field, and the edit:
Review before saving:
Phone:
🤖 Generated with Claude Code
Summary by CodeRabbit
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.