[PR #7728] [MERGED] fix(trackers): show field locks on Present Characters cards and keep locked names #7900

Closed
opened 2026-10-24 04:08:39 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

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

Base: staging ← Head: fix/7689-tracker-field-locking


📝 Commits (4)

  • e35e6c6 fix(trackers): show field locks on Present Characters cards and keep locked names
  • 310fd5f fix(trackers): keep locks with cast and explicitly identified rows
  • b7dcb8d fix(trackers): select eligible identities before matching namesakes
  • ad8d748 test(export): calibrate the bounded streaming fixture heap

📊 Changes

6 files changed (+295 additions, -15 deletions)

View changed files

📝 e2e/tracker-window-routing.e2e.ts (+51 -0)
📝 packages/client/src/features/tracker-panel/components/controls/InlineControls.tsx (+21 -6)
📝 packages/client/src/features/tracker-panel/components/controls/SectionControls.tsx (+6 -5)
📝 packages/shared/src/utils/tracker-field-locks.ts (+31 -3)
📝 scripts/regressions/native-export-memory.regression.ts (+2 -1)
➕ scripts/regressions/tracker-character-name-lock.regression.ts (+184 -0)

📄 Description

Important

Contributions target staging. Only SpicyMarinara may promote this repository's staging branch or a same-repository hotfix/* branch to main.
Outside and first-time contributors also require an approving review from SpicyMarinara.

Linked issue

Closes #7689

Why this change

  • The reporter could no longer lock Present Characters fields after the HUD moved into the Trackers window, so their agent kept renaming "Madeline" back to the card's name, "Family survivors".
  • The lock data model and the server-side enforcement were still there, and the cards still had a lock-mode button. But the readable cards (Trackers window and Tracker Panel) gave no sign of what lock mode could lock. The old HUD showed a padlock beside every field; the cards showed nothing, and the lock-mode button did not even look pressed. To users, locking looked gone.
  • A second, server-side gap made locks fail for exactly this case. Locks on a row matched to a character card are keyed by the row's id. When the Character Tracker named the corrected row ("Madeline") without that id, the name was kept but the id was dropped, so the lock stopped matching her row. On the next turn the card's name came back.

What changed

  • InlineEdit (the tracker cards' editable fields) shows a small padlock on each field it can lock while lock mode is on, open when unlocked and closed and brighter when locked. This matches what the World State tiles already do. Outside lock mode nothing changes: locked fields keep their existing ring.
  • SectionIconButton shows its pressed state for every tone, so the Present Characters lock, add and delete mode buttons now look switched on.
  • mergeCharactersWithLocks (shared; used by the generate route, the retry route and the live client merge): a locked row keeps its original id when the agent omits it or replaces it with that same card member's cast id. Name and position matching reserve identities that another reported row explicitly owns, including an exact same-card cast alias, so a bare row can still match another eligible character with the same name. The explicit owner keeps its lock regardless of row order. An unrelated explicit id stays distinct, and the old locked row is retained.
  • Regression proofs, both failing without the fix:
    • scripts/regressions/tracker-character-name-lock.regression.ts runs the generate route's tracker steps (card identity, UI-field preservation, locks) over two turns of the reporter's case. Without the fix it fails on the dropped id (characterId: undefined instead of "family-card").
    • The e2e/tracker-window-routing.e2e.ts test "Present Characters lock mode marks each field with a padlock" runs in light and dark. Without the fix it fails on the unpressed lock-mode button, and with the badge change alone reverted it fails on the missing padlock.
  • No new copy; the existing lock labels ("Lock Thrum", "Unlock Thrum", "Enter HUD lock mode") are reused.

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

Agent-run checks (not a substitute for the boxes above):

  • tsc --noEmit for shared, server, client and root: clean. ESLint on the changed client files and Prettier on all changed files: clean.
  • Regressions: tracker-character-name-lock, prompt.regression (7 files), agent-runtime, agent-context-generation, tracker-manual-edit-base, tracker-sections and open-issues all passed.
  • Playwright (desktop-chromium and mobile-chromium, --workers=1): tracker-window-routing and world-tracker-controls passed. inventory-tracker-details fails at its first step ("Location for Painkillers" not found) both with and without this change, so that failure is not caused by this PR.

Follow-up validation on 310fd5f41aa68b5197c0f4b28984f1ac040c2632:

  • pnpm install, pnpm check, regression-file Prettier, and git diff --check passed. The baseline check retains one existing HomeProfessorMariChat.tsx hook-dependency warning, with no errors.
  • tracker-character-name-lock, tracker-sections, and tracker-manual-edit-base regressions passed. Added proof covers three multi-person-card cast transitions, explicit ID ownership in both row orders and on the following turn, and distinct same-name characters with unrelated IDs.
  • Before the respective fixes, the expanded regression failed on a changed cast id (family-card:cast:madeline instead of family-card), on the explicitly identified row retaining Family survivors instead of locked Madeline, and on overwriting an unrelated new-alex identity with old-alex.
  • Final local CodeRabbit review of the two-file follow-up completed with no new findings. The intermediate identity-overwrite finding was fixed and regression-backed. Browser evidence above covers the unchanged UI; this follow-up edits only shared merge behavior and its regression.

Final namesake follow-up validation on b7dcb8d11a37f3498a87725d370f3c26e69d72f6:

  • pnpm check, regression-file Prettier, git diff --check, and the three focused tracker regressions above passed again after the final shared-code change.
  • Additional real tracker-step fixtures cover two cards both named Alex, with separate locks: a bare report matches the unreserved character while the explicit original-ID or canonical cast-ID owner keeps its own row, in either incoming row order. A known cast alias also finds the correct second namesake. Before the candidate-selection fix these cases produced a third row or lost the intended mood lock; the final regression asserts exact row identities, moods, and row count.
  • Independent source review found no remaining substantive issue. Final local CodeRabbit re-review completed with no new findings. One prior trivial suggestion to remove an empty-string entry from reportedIds was dismissed: the currentId guard prevents lookup of that entry, so filtering it adds work without changing behavior. The earlier substantive findings were fixed, not dismissed.

Hosted-CI fixture calibration on ad8d74868da9469624c0cd66cd4f2c065a431ae5:

  • The previous head's complete Node lane passed 904/905 regressions. Its sole failure was the native-export memory fixture's child process exhausting its 112 MB heap during character export on Node 24.21.0; every tracker regression passed.
  • Calibrated that regression's fixed heap limit to 128 MB, using the same patch as the other affected PRs. The ~64 MB galleries, export/import byte checks, and buffered-export negative control remain in place. The control must still fail with an out-of-memory error for the test to pass.
  • node scripts/run-regressions.mjs --filter scripts/regressions/native-export-memory.regression.ts passed locally, including that negative control. Observed local server memory: baseline heap 71 MB, peak heap 128 MB, peak RSS 346 MB. These are observed values, not a universal headroom guarantee.
  • Regression-file Prettier and git diff --check passed. Local CodeRabbit review of this one-file calibration completed with no new findings. This commit changes only the test fixture; the production and namesake regression validation above was completed on b7dcb8d11a37f3498a87725d370f3c26e69d72f6.

Manual verification notes

  • Manually verify in the Trackers window (Tracker Panel off): open Present Characters, press the lock-mode button. It should look pressed and every field (name, emoji, mood, appearance, outfit, thoughts, stat names, custom fields) should show a padlock. Click a name: its padlock closes and brightens.
  • Manually verify that leaving lock mode removes the padlocks and the locked name keeps its ring.
  • Manually verify the same in the Tracker Panel's lock mode (Settings gear → lock), in light and dark themes.
  • Manually verify the reporter's case: rename a card-matched character, lock the name, run the Character Tracker a few times, and check that the name stays.
  • Manually verify in the popped-out Present Characters window.

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)

UI evidence (if applicable)

Playwright captures characters-lock-mode-light.png and characters-lock-mode-dark.png in the new test's output folder: padlocks on every card field, the locked name brighter, and the lock-mode button pressed.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features

    • Lock mode now shows locked or unlocked badges on character fields, including names, emojis, moods, and appearance details. Badges clear when lock mode ends.
  • Bug Fixes

    • Character cards retain their identity when updates omit a usable ID, preserving locked fields while allowing unlocked fields to update.
    • Pressed-state styling now appears consistently on tracker controls.

🔄 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/7728 **Author:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Created:** 10/16/2026 **Status:** ✅ Merged **Merged:** 10/16/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `staging` ← **Head:** `fix/7689-tracker-field-locking` --- ### 📝 Commits (4) - [`e35e6c6`](https://github.com/Pasta-Devs/Marinara-Engine/commit/e35e6c62a0a6082e3517c49db2cbe1a12c0fa745) fix(trackers): show field locks on Present Characters cards and keep locked names - [`310fd5f`](https://github.com/Pasta-Devs/Marinara-Engine/commit/310fd5f41aa68b5197c0f4b28984f1ac040c2632) fix(trackers): keep locks with cast and explicitly identified rows - [`b7dcb8d`](https://github.com/Pasta-Devs/Marinara-Engine/commit/b7dcb8d11a37f3498a87725d370f3c26e69d72f6) fix(trackers): select eligible identities before matching namesakes - [`ad8d748`](https://github.com/Pasta-Devs/Marinara-Engine/commit/ad8d74868da9469624c0cd66cd4f2c065a431ae5) test(export): calibrate the bounded streaming fixture heap ### 📊 Changes **6 files changed** (+295 additions, -15 deletions) <details> <summary>View changed files</summary> 📝 `e2e/tracker-window-routing.e2e.ts` (+51 -0) 📝 `packages/client/src/features/tracker-panel/components/controls/InlineControls.tsx` (+21 -6) 📝 `packages/client/src/features/tracker-panel/components/controls/SectionControls.tsx` (+6 -5) 📝 `packages/shared/src/utils/tracker-field-locks.ts` (+31 -3) 📝 `scripts/regressions/native-export-memory.regression.ts` (+2 -1) ➕ `scripts/regressions/tracker-character-name-lock.regression.ts` (+184 -0) </details> ### 📄 Description > [!IMPORTANT] > Contributions target `staging`. Only `SpicyMarinara` may promote this repository's `staging` branch or a same-repository `hotfix/*` branch to `main`. > Outside and first-time contributors also require an approving review from `SpicyMarinara`. <!-- See CONTRIBUTING.md § Branches. --> ## Linked issue Closes #7689 ## Why this change - The reporter could no longer lock Present Characters fields after the HUD moved into the Trackers window, so their agent kept renaming "Madeline" back to the card's name, "Family survivors". - The lock data model and the server-side enforcement were still there, and the cards still had a lock-mode button. But the readable cards (Trackers window and Tracker Panel) gave no sign of what lock mode could lock. The old HUD showed a padlock beside every field; the cards showed nothing, and the lock-mode button did not even look pressed. To users, locking looked gone. - A second, server-side gap made locks fail for exactly this case. Locks on a row matched to a character card are keyed by the row's id. When the Character Tracker named the corrected row ("Madeline") without that id, the name was kept but the id was dropped, so the lock stopped matching her row. On the next turn the card's name came back. ## What changed - `InlineEdit` (the tracker cards' editable fields) shows a small padlock on each field it can lock while lock mode is on, open when unlocked and closed and brighter when locked. This matches what the World State tiles already do. Outside lock mode nothing changes: locked fields keep their existing ring. - `SectionIconButton` shows its pressed state for every tone, so the Present Characters lock, add and delete mode buttons now look switched on. - `mergeCharactersWithLocks` (shared; used by the generate route, the retry route and the live client merge): a locked row keeps its original id when the agent omits it or replaces it with that same card member's cast id. Name and position matching reserve identities that another reported row explicitly owns, including an exact same-card cast alias, so a bare row can still match another eligible character with the same name. The explicit owner keeps its lock regardless of row order. An unrelated explicit id stays distinct, and the old locked row is retained. - Regression proofs, both failing without the fix: - `scripts/regressions/tracker-character-name-lock.regression.ts` runs the generate route's tracker steps (card identity, UI-field preservation, locks) over two turns of the reporter's case. Without the fix it fails on the dropped id (`characterId: undefined` instead of `"family-card"`). - The `e2e/tracker-window-routing.e2e.ts` test "Present Characters lock mode marks each field with a padlock" runs in light and dark. Without the fix it fails on the unpressed lock-mode button, and with the badge change alone reverted it fails on the missing padlock. - No new copy; the existing lock labels ("Lock Thrum", "Unlock Thrum", "Enter HUD lock mode") are reused. ## 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` Agent-run checks (not a substitute for the boxes above): - `tsc --noEmit` for shared, server, client and root: clean. ESLint on the changed client files and Prettier on all changed files: clean. - Regressions: `tracker-character-name-lock`, `prompt.regression` (7 files), `agent-runtime`, `agent-context-generation`, `tracker-manual-edit-base`, `tracker-sections` and `open-issues` all passed. - Playwright (desktop-chromium and mobile-chromium, `--workers=1`): `tracker-window-routing` and `world-tracker-controls` passed. `inventory-tracker-details` fails at its first step ("Location for Painkillers" not found) both with and without this change, so that failure is not caused by this PR. Follow-up validation on `310fd5f41aa68b5197c0f4b28984f1ac040c2632`: - `pnpm install`, `pnpm check`, regression-file Prettier, and `git diff --check` passed. The baseline check retains one existing `HomeProfessorMariChat.tsx` hook-dependency warning, with no errors. - `tracker-character-name-lock`, `tracker-sections`, and `tracker-manual-edit-base` regressions passed. Added proof covers three multi-person-card cast transitions, explicit ID ownership in both row orders and on the following turn, and distinct same-name characters with unrelated IDs. - Before the respective fixes, the expanded regression failed on a changed cast id (`family-card:cast:madeline` instead of `family-card`), on the explicitly identified row retaining `Family survivors` instead of locked `Madeline`, and on overwriting an unrelated `new-alex` identity with `old-alex`. - Final local CodeRabbit review of the two-file follow-up completed with no new findings. The intermediate identity-overwrite finding was fixed and regression-backed. Browser evidence above covers the unchanged UI; this follow-up edits only shared merge behavior and its regression. Final namesake follow-up validation on `b7dcb8d11a37f3498a87725d370f3c26e69d72f6`: - `pnpm check`, regression-file Prettier, `git diff --check`, and the three focused tracker regressions above passed again after the final shared-code change. - Additional real tracker-step fixtures cover two cards both named Alex, with separate locks: a bare report matches the unreserved character while the explicit original-ID or canonical cast-ID owner keeps its own row, in either incoming row order. A known cast alias also finds the correct second namesake. Before the candidate-selection fix these cases produced a third row or lost the intended mood lock; the final regression asserts exact row identities, moods, and row count. - Independent source review found no remaining substantive issue. Final local CodeRabbit re-review completed with no new findings. One prior trivial suggestion to remove an empty-string entry from `reportedIds` was dismissed: the `currentId` guard prevents lookup of that entry, so filtering it adds work without changing behavior. The earlier substantive findings were fixed, not dismissed. Hosted-CI fixture calibration on `ad8d74868da9469624c0cd66cd4f2c065a431ae5`: - The previous head's complete Node lane passed 904/905 regressions. Its sole failure was the native-export memory fixture's child process exhausting its 112 MB heap during character export on Node 24.21.0; every tracker regression passed. - Calibrated that regression's fixed heap limit to 128 MB, using the same patch as the other affected PRs. The ~64 MB galleries, export/import byte checks, and buffered-export negative control remain in place. The control must still fail with an out-of-memory error for the test to pass. - `node scripts/run-regressions.mjs --filter scripts/regressions/native-export-memory.regression.ts` passed locally, including that negative control. Observed local server memory: baseline heap 71 MB, peak heap 128 MB, peak RSS 346 MB. These are observed values, not a universal headroom guarantee. - Regression-file Prettier and `git diff --check` passed. Local CodeRabbit review of this one-file calibration completed with no new findings. This commit changes only the test fixture; the production and namesake regression validation above was completed on `b7dcb8d11a37f3498a87725d370f3c26e69d72f6`. ### Manual verification notes - Manually verify in the Trackers window (Tracker Panel off): open Present Characters, press the lock-mode button. It should look pressed and every field (name, emoji, mood, appearance, outfit, thoughts, stat names, custom fields) should show a padlock. Click a name: its padlock closes and brightens. - Manually verify that leaving lock mode removes the padlocks and the locked name keeps its ring. - Manually verify the same in the Tracker Panel's lock mode (Settings gear → lock), in light and dark themes. - Manually verify the reporter's case: rename a card-matched character, lock the name, run the Character Tracker a few times, and check that the name stays. - Manually verify in the popped-out Present Characters window. ## 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) ## UI evidence (if applicable) Playwright captures `characters-lock-mode-light.png` and `characters-lock-mode-dark.png` in the new test's output folder: padlocks on every card field, the locked name brighter, and the lock-mode button pressed. 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Lock mode now shows locked or unlocked badges on character fields, including names, emojis, moods, and appearance details. Badges clear when lock mode ends. * **Bug Fixes** * Character cards retain their identity when updates omit a usable ID, preserving locked fields while allowing unlocked fields to update. * Pressed-state styling now appears consistently on tracker controls. <!-- 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-24 04:08:39 +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#7900
No description provided.