[PR #2568] [MERGED] Add tracker field locks #5665

Closed
opened 2026-10-22 04:18:17 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/2568
Author: @Xelvanis
Created: 6/15/2026
Status: ✅ Merged
Merged: 6/16/2026
Merged by: @SpicyMarinara

Base: staging ← Head: feat/tracker-field-locks


📝 Commits (1)

  • 88f5234 feat: add tracker field locks

📊 Changes

44 files changed (+2305 additions, -573 deletions)

View changed files

📝 packages/client/src/components/chat/RoleplayHUD.tsx (+29 -8)
📝 packages/client/src/components/chat/RoleplayHUDPanels.tsx (+683 -260)
📝 packages/client/src/features/tracker-panel/components/TrackerDataSidebar.tsx (+67 -53)
➕ packages/client/src/features/tracker-panel/components/TrackerLockContext.tsx (+41 -0)
📝 packages/client/src/features/tracker-panel/components/TrackerSidebarHeader.tsx (+33 -3)
📝 packages/client/src/features/tracker-panel/components/character-card/CharacterThoughtBubbles.tsx (+17 -1)
📝 packages/client/src/features/tracker-panel/components/character-card/CharacterTrackerCard.tsx (+52 -3)
📝 packages/client/src/features/tracker-panel/components/character-card/CharacterTrackerField.tsx (+5 -1)
📝 packages/client/src/features/tracker-panel/components/character-card/FeaturedCharacterFields.tsx (+17 -2)
📝 packages/client/src/features/tracker-panel/components/character-card/FeaturedCharacterNameplate.tsx (+5 -1)
📝 packages/client/src/features/tracker-panel/components/character-card/FeaturedCharacterTrackerCard.tsx (+40 -1)
📝 packages/client/src/features/tracker-panel/components/controls/InlineControls.tsx (+61 -14)
📝 packages/client/src/features/tracker-panel/components/controls/StatList.tsx (+50 -4)
📝 packages/client/src/features/tracker-panel/components/controls/TrackerProfileNameplate.tsx (+5 -0)
📝 packages/client/src/features/tracker-panel/components/sections/CharacterTrackerPanel.tsx (+1 -0)
📝 packages/client/src/features/tracker-panel/components/sections/CustomTrackerPanel.tsx (+32 -14)
📝 packages/client/src/features/tracker-panel/components/sections/PersonaInventoryRow.tsx (+13 -1)
📝 packages/client/src/features/tracker-panel/components/sections/PersonaTrackerPanel.tsx (+12 -0)
📝 packages/client/src/features/tracker-panel/components/sections/WorldDateTimeTiles.tsx (+9 -0)
📝 packages/client/src/features/tracker-panel/components/sections/WorldEditableTile.tsx (+41 -5)

...and 24 more files

📄 Description

Linked issue

No linked issue yet. A feature request should be opened before this leaves draft.

Why this change

  • Users need tracker values they manually edit to stay stable when generation or tracker agents produce new game-state patches.
  • Field locks need to be enforced by code, not only by prompting, so locked values survive model output that tries to overwrite them.

What changed

  • Added persisted fieldLocks support on game-state snapshots, stored through the existing manual-overrides payload.
  • Added shared lock-key helpers and server/client lock enforcement so generated patches restore locked values before persistence, SSE streaming, or client store merges.
  • Added lock controls across RoleplayHUD and Tracker Sidebar user-editable fields.
  • Preserved legacy custom-tracker locked values and made them unlockable through the new UI.
  • Fixed lock preservation for chat branching and empty locked world fields.
  • Reduced repeated locked-patch extraction in generation and retry-agent routes.

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 --filter @marinara-engine/shared lint passed.
  • pnpm --filter @marinara-engine/client lint passed.
  • pnpm --filter @marinara-engine/client build passed.
  • git diff --check passed.
  • pnpm --filter @marinara-engine/server lint and pnpm check are blocked by existing packages/server/src/services/professor-mari/workspace-agent.service.ts TypeScript errors for missing @earendil-works/* modules and implicit anys.
  • Browser visual smoke was not completed in-session because the in-app browser target was unavailable.

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)

UI evidence (if applicable)

No screenshots captured in-session.

Summary by CodeRabbit

New Features

  • Field Locking in Tracker Widgets: Lock individual tracker fields (character stats, inventory items, world state data, quests, objectives, custom fields) to prevent accidental modifications. Toggle lock mode in the tracker sidebar to enable per-field locking with visual lock/unlock indicators across all editable fields. Locked fields persist across sessions.

🔄 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/2568 **Author:** [@Xelvanis](https://github.com/Xelvanis) **Created:** 6/15/2026 **Status:** ✅ Merged **Merged:** 6/16/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `staging` ← **Head:** `feat/tracker-field-locks` --- ### 📝 Commits (1) - [`88f5234`](https://github.com/Pasta-Devs/Marinara-Engine/commit/88f5234fade12c539c74684af6f8d54c73d0e8d1) feat: add tracker field locks ### 📊 Changes **44 files changed** (+2305 additions, -573 deletions) <details> <summary>View changed files</summary> 📝 `packages/client/src/components/chat/RoleplayHUD.tsx` (+29 -8) 📝 `packages/client/src/components/chat/RoleplayHUDPanels.tsx` (+683 -260) 📝 `packages/client/src/features/tracker-panel/components/TrackerDataSidebar.tsx` (+67 -53) ➕ `packages/client/src/features/tracker-panel/components/TrackerLockContext.tsx` (+41 -0) 📝 `packages/client/src/features/tracker-panel/components/TrackerSidebarHeader.tsx` (+33 -3) 📝 `packages/client/src/features/tracker-panel/components/character-card/CharacterThoughtBubbles.tsx` (+17 -1) 📝 `packages/client/src/features/tracker-panel/components/character-card/CharacterTrackerCard.tsx` (+52 -3) 📝 `packages/client/src/features/tracker-panel/components/character-card/CharacterTrackerField.tsx` (+5 -1) 📝 `packages/client/src/features/tracker-panel/components/character-card/FeaturedCharacterFields.tsx` (+17 -2) 📝 `packages/client/src/features/tracker-panel/components/character-card/FeaturedCharacterNameplate.tsx` (+5 -1) 📝 `packages/client/src/features/tracker-panel/components/character-card/FeaturedCharacterTrackerCard.tsx` (+40 -1) 📝 `packages/client/src/features/tracker-panel/components/controls/InlineControls.tsx` (+61 -14) 📝 `packages/client/src/features/tracker-panel/components/controls/StatList.tsx` (+50 -4) 📝 `packages/client/src/features/tracker-panel/components/controls/TrackerProfileNameplate.tsx` (+5 -0) 📝 `packages/client/src/features/tracker-panel/components/sections/CharacterTrackerPanel.tsx` (+1 -0) 📝 `packages/client/src/features/tracker-panel/components/sections/CustomTrackerPanel.tsx` (+32 -14) 📝 `packages/client/src/features/tracker-panel/components/sections/PersonaInventoryRow.tsx` (+13 -1) 📝 `packages/client/src/features/tracker-panel/components/sections/PersonaTrackerPanel.tsx` (+12 -0) 📝 `packages/client/src/features/tracker-panel/components/sections/WorldDateTimeTiles.tsx` (+9 -0) 📝 `packages/client/src/features/tracker-panel/components/sections/WorldEditableTile.tsx` (+41 -5) _...and 24 more files_ </details> ### 📄 Description ## Linked issue No linked issue yet. A feature request should be opened before this leaves draft. ## Why this change - Users need tracker values they manually edit to stay stable when generation or tracker agents produce new game-state patches. - Field locks need to be enforced by code, not only by prompting, so locked values survive model output that tries to overwrite them. ## What changed - Added persisted `fieldLocks` support on game-state snapshots, stored through the existing manual-overrides payload. - Added shared lock-key helpers and server/client lock enforcement so generated patches restore locked values before persistence, SSE streaming, or client store merges. - Added lock controls across RoleplayHUD and Tracker Sidebar user-editable fields. - Preserved legacy custom-tracker `locked` values and made them unlockable through the new UI. - Fixed lock preservation for chat branching and empty locked world fields. - Reduced repeated locked-patch extraction in generation and retry-agent routes. ## Validation - [x] `pnpm check` passes locally - [ ] Container (Docker / Podman) built and ran without issue - [x] Ran the app, clicked through the changes manually - [x] Checked edge cases (light + dark mode, mobile viewport, empty states, error paths) - [ ] Above manual verification completed (describe below) - [x] Read and followed `CONTRIBUTING.md` ### Manual verification notes - `pnpm --filter @marinara-engine/shared lint` passed. - `pnpm --filter @marinara-engine/client lint` passed. - `pnpm --filter @marinara-engine/client build` passed. - `git diff --check` passed. - `pnpm --filter @marinara-engine/server lint` and `pnpm check` are blocked by existing `packages/server/src/services/professor-mari/workspace-agent.service.ts` TypeScript errors for missing `@earendil-works/*` modules and implicit anys. - Browser visual smoke was not completed in-session because the in-app browser target was unavailable. ## 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) ## UI evidence (if applicable) No screenshots captured in-session. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit ## New Features * **Field Locking in Tracker Widgets**: Lock individual tracker fields (character stats, inventory items, world state data, quests, objectives, custom fields) to prevent accidental modifications. Toggle lock mode in the tracker sidebar to enable per-field locking with visual lock/unlock indicators across all editable fields. Locked fields persist across sessions. <!-- 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-22 04:18:17 +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#5665
No description provided.