[PR #3519] [MERGED] Add tracker custom fields #5975

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

📋 Pull Request Information

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

Base: staging ← Head: codex/tracker-custom-fields


📝 Commits (4)

  • 23a2368 Add tracker custom fields
  • 05a46da Merge branch 'staging' into codex/tracker-custom-fields
  • e80a16e Harden tracker custom fields and align UI
  • a748ee4 Address tracker custom field review feedback

📊 Changes

28 files changed (+1060 additions, -62 deletions)

View changed files

📝 CHANGELOG.md (+1 -0)
📝 docs/roleplay/hud-and-trackers.md (+18 -10)
📝 packages/client/src/components/chat/RoleplayHUD.tsx (+16 -1)
📝 packages/client/src/components/chat/RoleplayHUDPanels.tsx (+64 -0)
📝 packages/client/src/features/tracker-panel/components/TrackerSectionList.tsx (+2 -0)
📝 packages/client/src/features/tracker-panel/components/character-card/CharacterTrackerCard.tsx (+62 -8)
📝 packages/client/src/features/tracker-panel/components/character-card/FeaturedCharacterTrackerCard.tsx (+60 -7)
📝 packages/client/src/features/tracker-panel/components/controls/InlineControls.tsx (+6 -1)
📝 packages/client/src/features/tracker-panel/components/sections/WorldStatePanel.tsx (+190 -4)
➕ packages/client/src/features/tracker-panel/lib/character-custom-field-names.ts (+20 -0)
➕ packages/client/src/features/tracker-panel/lib/world-custom-field-icons.tsx (+162 -0)
📝 packages/client/src/hooks/use-game-state-patcher.ts (+2 -0)
📝 packages/server/src/db/migrate.ts (+6 -0)
📝 packages/server/src/db/schema/game-state.ts (+2 -0)
📝 packages/server/src/routes/chats.routes.ts (+13 -2)
📝 packages/server/src/routes/game.routes.ts (+7 -3)
📝 packages/server/src/routes/generate.routes.ts (+15 -4)
📝 packages/server/src/routes/generate/generate-route-utils.ts (+9 -0)
📝 packages/server/src/routes/generate/retry-agents-route.ts (+3 -0)
📝 packages/server/src/services/generation/committed-tracker-context.ts (+54 -5)

...and 8 more files

📄 Description

Linked issue

Closes #3518

This PR implements the custom-field portion of the request. Hiding built-in character fields is not included in this patch.

Why this change

Tracker customization is uneven: present characters can carry custom fields in state, but the tracker UI did not fully support adding or removing them, and world state had no matching custom-field support.

This adds first-class custom fields to the built-in tracker surfaces so extra world and character data lives where users expect it, without forcing them into a separate generic tracker panel.

What changed

  • Added worldCustomFields to game-state storage, migration, API patching, branching, checkpoints, generation context, and Roleplay HUD rendering.
  • Added world custom-field creation, rename, value editing, deletion, icon normalization, and lock cleanup to the Tracker Panel.
  • Added present-character custom-field creation and deletion to compact and featured tracker cards, plus value rendering in Roleplay HUD panels.
  • Kept custom field names visible in normal mode so values remain understandable without entering edit mode.
  • Added accessible edit labels, duplicate-name protection, and larger coarse-pointer delete targets.
  • Taught World State and Character Tracker prompts to return existing custom fields without deleting or renaming user-defined structure.
  • Preserved omitted character and world fields across tracker runs, including when no locks are active.
  • Made malformed stored world-field JSON fall back safely.
  • Updated the v2.2.0 changelog and Roleplay HUD/Tracker documentation.
  • Added regression coverage for prompt contracts, normalization, persistence, and committed context.

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

Contributor verification:

  • Created a Roleplay chat with world and present-character custom fields.
  • Confirmed tracker add/delete/rename flows, invalid-icon fallback, lock cleanup, and Roleplay HUD rendering.

Maintainer review validation:

  • pnpm check
  • pnpm test
  • pnpm regression:prompt
  • Focused desktop/mobile Playwright invocation for Roleplay side-panel transitions: desktop passed, the intentionally desktop-only mobile project case skipped.
  • git diff --check
  • Reviewed the supplied UI evidence against Marinara's PRODUCT.md, DESIGN.md, tracker components, semantic tokens, responsive behavior, and accessibility conventions.

The in-app browser was unavailable during the maintainer pass, so no new interactive screenshot is claimed.

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)

This PR updates CHANGELOG.md and docs/roleplay/hud-and-trackers.md. It does not change release metadata.

UI evidence (if applicable)

Tracker Custom Fields 1 Tracker Custom Fields 2 Tracker Custom Fields 3 Tracker Custom Fields 4 Tracker Custom Fields 5

Summary by CodeRabbit

  • New Features

    • Added editable custom fields for World State and Present Characters.
    • Added controls to create, rename, remove, lock, and unlock custom fields.
    • Custom fields now appear consistently in the Tracker Panel and Roleplay HUD.
    • Added supported icons for World State custom fields.
  • Bug Fixes

    • Improved duplicate-name prevention and preservation of locked tracker values.
    • Custom fields now persist correctly across saves, restores, branches, and generated updates.
  • Documentation

    • Updated HUD and tracker documentation with custom-field editing and management details.

🔄 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/3519 **Author:** [@kaldigo](https://github.com/kaldigo) **Created:** 7/12/2026 **Status:** ✅ Merged **Merged:** 7/12/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `staging` ← **Head:** `codex/tracker-custom-fields` --- ### 📝 Commits (4) - [`23a2368`](https://github.com/Pasta-Devs/Marinara-Engine/commit/23a23680560087986adfefa047414de794c05da5) Add tracker custom fields - [`05a46da`](https://github.com/Pasta-Devs/Marinara-Engine/commit/05a46da4e6eb2ff3f92dd20ec7f2c41cd4ce3a65) Merge branch 'staging' into codex/tracker-custom-fields - [`e80a16e`](https://github.com/Pasta-Devs/Marinara-Engine/commit/e80a16e719023b549bf2a0e6d79dbda016b79556) Harden tracker custom fields and align UI - [`a748ee4`](https://github.com/Pasta-Devs/Marinara-Engine/commit/a748ee49a31bb958501846a57b85159fee432bb5) Address tracker custom field review feedback ### 📊 Changes **28 files changed** (+1060 additions, -62 deletions) <details> <summary>View changed files</summary> 📝 `CHANGELOG.md` (+1 -0) 📝 `docs/roleplay/hud-and-trackers.md` (+18 -10) 📝 `packages/client/src/components/chat/RoleplayHUD.tsx` (+16 -1) 📝 `packages/client/src/components/chat/RoleplayHUDPanels.tsx` (+64 -0) 📝 `packages/client/src/features/tracker-panel/components/TrackerSectionList.tsx` (+2 -0) 📝 `packages/client/src/features/tracker-panel/components/character-card/CharacterTrackerCard.tsx` (+62 -8) 📝 `packages/client/src/features/tracker-panel/components/character-card/FeaturedCharacterTrackerCard.tsx` (+60 -7) 📝 `packages/client/src/features/tracker-panel/components/controls/InlineControls.tsx` (+6 -1) 📝 `packages/client/src/features/tracker-panel/components/sections/WorldStatePanel.tsx` (+190 -4) ➕ `packages/client/src/features/tracker-panel/lib/character-custom-field-names.ts` (+20 -0) ➕ `packages/client/src/features/tracker-panel/lib/world-custom-field-icons.tsx` (+162 -0) 📝 `packages/client/src/hooks/use-game-state-patcher.ts` (+2 -0) 📝 `packages/server/src/db/migrate.ts` (+6 -0) 📝 `packages/server/src/db/schema/game-state.ts` (+2 -0) 📝 `packages/server/src/routes/chats.routes.ts` (+13 -2) 📝 `packages/server/src/routes/game.routes.ts` (+7 -3) 📝 `packages/server/src/routes/generate.routes.ts` (+15 -4) 📝 `packages/server/src/routes/generate/generate-route-utils.ts` (+9 -0) 📝 `packages/server/src/routes/generate/retry-agents-route.ts` (+3 -0) 📝 `packages/server/src/services/generation/committed-tracker-context.ts` (+54 -5) _...and 8 more files_ </details> ### 📄 Description ## Linked issue Closes #3518 This PR implements the custom-field portion of the request. Hiding built-in character fields is not included in this patch. ## Why this change Tracker customization is uneven: present characters can carry custom fields in state, but the tracker UI did not fully support adding or removing them, and world state had no matching custom-field support. This adds first-class custom fields to the built-in tracker surfaces so extra world and character data lives where users expect it, without forcing them into a separate generic tracker panel. ## What changed - Added `worldCustomFields` to game-state storage, migration, API patching, branching, checkpoints, generation context, and Roleplay HUD rendering. - Added world custom-field creation, rename, value editing, deletion, icon normalization, and lock cleanup to the Tracker Panel. - Added present-character custom-field creation and deletion to compact and featured tracker cards, plus value rendering in Roleplay HUD panels. - Kept custom field names visible in normal mode so values remain understandable without entering edit mode. - Added accessible edit labels, duplicate-name protection, and larger coarse-pointer delete targets. - Taught World State and Character Tracker prompts to return existing custom fields without deleting or renaming user-defined structure. - Preserved omitted character and world fields across tracker runs, including when no locks are active. - Made malformed stored world-field JSON fall back safely. - Updated the v2.2.0 changelog and Roleplay HUD/Tracker documentation. - Added regression coverage for prompt contracts, normalization, persistence, and committed context. ## Validation - [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 Contributor verification: - Created a Roleplay chat with world and present-character custom fields. - Confirmed tracker add/delete/rename flows, invalid-icon fallback, lock cleanup, and Roleplay HUD rendering. Maintainer review validation: - `pnpm check` - `pnpm test` - `pnpm regression:prompt` - Focused desktop/mobile Playwright invocation for Roleplay side-panel transitions: desktop passed, the intentionally desktop-only mobile project case skipped. - `git diff --check` - Reviewed the supplied UI evidence against Marinara's PRODUCT.md, DESIGN.md, tracker components, semantic tokens, responsive behavior, and accessibility conventions. The in-app browser was unavailable during the maintainer pass, so no new interactive screenshot is claimed. ## 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) This PR updates `CHANGELOG.md` and `docs/roleplay/hud-and-trackers.md`. It does not change release metadata. ## UI evidence (if applicable) <img width="345" height="598" alt="Tracker Custom Fields 1" src="https://github.com/user-attachments/assets/303611b3-c032-4985-b8b9-8c15cc6f1ba7" /> <img width="351" height="650" alt="Tracker Custom Fields 2" src="https://github.com/user-attachments/assets/72cfa123-2894-46ce-bd1a-aeef9b74ec7f" /> <img width="372" height="587" alt="Tracker Custom Fields 3" src="https://github.com/user-attachments/assets/c64fda65-b883-41f3-a29d-f717a07e7bac" /> <img width="394" height="523" alt="Tracker Custom Fields 4" src="https://github.com/user-attachments/assets/0cce6441-94fd-45d7-939f-374eaf290883" /> <img width="512" height="226" alt="Tracker Custom Fields 5" src="https://github.com/user-attachments/assets/77cedc99-8959-4a02-93eb-70da9d698f1e" /> <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Added editable custom fields for World State and Present Characters. * Added controls to create, rename, remove, lock, and unlock custom fields. * Custom fields now appear consistently in the Tracker Panel and Roleplay HUD. * Added supported icons for World State custom fields. * **Bug Fixes** * Improved duplicate-name prevention and preservation of locked tracker values. * Custom fields now persist correctly across saves, restores, branches, and generated updates. * **Documentation** * Updated HUD and tracker documentation with custom-field editing and management details. <!-- 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:05:47 +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#5975
No description provided.