[PR #8707] [MERGED] fix(characters): match sheet previews and saving to avatar media #8756

Closed
opened 2026-11-07 17:39:29 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/8707
Author: @DSBwizzard
Created: 11/3/2026
Status: ✅ Merged
Merged: 11/3/2026
Merged by: @SpicyMarinara

Base: staging ← Head: codex/character-sheet-preview


📝 Commits (10+)

  • 5a4d668 fix(characters): open applied character sheets in full image view
  • 7e81dcb fix(characters): restore sheet focus after pointer dismissal
  • c3887ed fix(characters): reuse the avatar full image overlay for sheets
  • cf30ef1 fix(characters): persist sheet selections like avatar uploads
  • 61c5f32 test(characters): select sheet model in the current picker
  • 6af3317 fix(characters): scope sheet-save guards to their own mutation
  • b4a4641 style(characters): simplify character sheet labels
  • 660bc89 test(characters): retain generated sheet cancellation coverage
  • b29081c test(characters): reset likeness after reopening the sheet generator
  • e3fc381 Merge branch 'staging' into codex/character-sheet-preview

📊 Changes

7 files changed (+391 additions, -58 deletions)

View changed files

📝 e2e/avatar-preview.e2e.ts (+194 -0)
📝 e2e/core-flows.e2e.ts (+59 -4)
📝 e2e/sprite-library.e2e.ts (+1 -1)
📝 packages/client/src/components/characters/CharacterEditor.tsx (+90 -35)
📝 packages/client/src/components/ui/AvatarCropWidget.tsx (+43 -15)
📝 packages/client/src/localization/locales/en.json (+3 -2)
📝 scripts/regressions/onboarding-s1.regression.ts (+1 -1)

📄 Description

Important

Contributions target staging. Outside contributors require an approving review from SpicyMarinara.

Linked issue

Closes #8706

Why this change

An applied character sheet should open like the avatar's Full button. Sheet media changes also should persist like avatar and sprite uploads: uploading a sheet and refreshing should not require a separate card Save or trigger a leave-page warning.

What changed

  • Open applied character sheets from the compact thumbnail and expanded image in the avatar's existing borderless Full presentation. Share the viewer with avatars, including focus restoration, Escape, close/backdrop dismissal and hardware back support.

  • Persist uploaded/generated sheet selections, replacements, the reference toggle and removal immediately using existing sparse character updates. Keep unrelated text edits unsaved and protected; failed sheet writes retain the previous selection. Removal clears the selection and reference flag while retaining the gallery image.

  • Use the requested labels Remove character sheet and Use character sheet from #8706 in the existing English localization keys; the shared keys also update the persona sheet labels.

  • Add viewer-parity and refresh/error/draft-preservation browser coverage. Preserve generated-sheet cancellation coverage alongside immediate saving. Update affected reference and sprite tests, including the generated-sheet test's current model picker.

  • Keep the onboarding Save-guard regression independent of Prettier line wrapping; the assertion still requires !dirty || unreadableOnboarding.

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

Agent-run validation evidence is listed below.

  • pnpm check passed on b4a464121841, including localization, formatting, workspace lint, type checks and production builds. Existing unrelated lint warnings remain.
  • Product revision b4a464121841 was built and run in an isolated Docker preview. Compiled desktop and mobile checks exercised sheet upload, refresh without a browser warning, both requested labels and the borderless viewer. Only disposable QA characters were removed.
  • pnpm smoke:ui --timeout=120000 passed all seven desktop Chromium smoke cases on b4a464121841.
  • pnpm regression:ui passed all 18 selected cases on b4a464121841 across desktop Chromium, mobile Chromium and mobile WebKit (--workers=1 --timeout=120000). Coverage includes refresh without a warning, sparse sheet writes, unrelated unsaved text, rejected writes, Full-view parity, generated sheets, character/persona reference persistence, in-flight card saving and sprite management.
  • After the test-only review fix, Prettier and pnpm check:e2e-types passed; the generated-sheet Save/Cancel case then passed again in all three browsers on final head b29081c34. Product source is unchanged from the fully checked and container-tested b4a464121841.
  • Local CodeRabbit completed two CLI reviews against upstream/staging (on b4a464121841 and 660bc8999). Five items were evaluated across the two runs; dispositions are below. The final one-line follow-up only restores the test's sprite-only setup after reopening the generator.
  • Human verification requested: compare the avatar Full view with both sheet entry points; check light/dark themes and mobile sizing; upload, replace, toggle reference and remove a sheet without card Save, then refresh; confirm unrelated text drafts still require Save and survive a failed sheet write.

CI follow-up (2026-11-03)

The maintainer-updated head e3fc381ca passed 549/550 files in Node shard 3. onboarding-s1.regression.ts failed because its source assertion required the Save-disabled condition on one line, while Prettier had wrapped the longer condition after =. Commit f395d7cb9 makes only that assertion whitespace-tolerant. The exact regression failed before the fix and passed afterward. A negative control confirmed the assertion still rejects removal of the unreadable-onboarding guard; single-line and wrapped forms both pass. Prettier and git diff --check passed. Application code is unchanged by this follow-up; the parent head's pnpm-validate, container and platform checks passed. The CI rerun passed all three Node shards and complete-node-regressions; shard 3 passed 550/550 files. All technical checks on f395d7cb9 are green, including pnpm-validate, container/platform builds, CodeQL and Dottore (Viable, With Notes; no actionable defects). The only remaining failed status is the required outside-contributor owner approval.

Local review disposition

  • Restored the existing generated-sheet Cancel interaction alongside Save coverage, and assert that canceling a replacement retains the previously saved sheet.
  • Retained the existing avatar Full close-button dimensions and positioning. The extraction preserves that presentation; a larger touch target/top safe-area adjustment is an existing avatar improvement rather than a regression introduced here.
  • Retained click-on-image dismissal because the avatar Full viewer already closes on any overlay click and this request explicitly asks for the same behavior. The close button, Escape and back dismissal also work.
  • Retained Remove character sheet because that exact wording was requested in #8706. Removal clears the sheet assignment and reference flag; it preserves the gallery asset, as documented above.
  • Retained the sprite-test expectation Use character sheet because the English UI key and the requested wording in #8706 changed together. The disabled-state assertion remains intact.

Prepared by @DSBwizzard. @SpicyMarinara: this account cannot self-assign upstream issues or PRs.

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)

No installation, update, release, schema or API contract changes; no documentation or release-file changes are needed for this UI correction. New and changed UI copy uses canonical English semantic keys.

UI evidence (if applicable)

Approved desktop and mobile screenshots are attached in the issue's UI evidence comment. They show disposable QA characters with Engine's built-in Mari artwork after upload and refresh, in the shared avatar Full viewer.

Desktop character-sheet Full viewer after upload and refresh Mobile character-sheet Full viewer after upload and refresh

🔄 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/8707 **Author:** [@DSBwizzard](https://github.com/DSBwizzard) **Created:** 11/3/2026 **Status:** ✅ Merged **Merged:** 11/3/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `staging` ← **Head:** `codex/character-sheet-preview` --- ### 📝 Commits (10+) - [`5a4d668`](https://github.com/Pasta-Devs/Marinara-Engine/commit/5a4d66859dab93862449cd20f65afd459c8d713a) fix(characters): open applied character sheets in full image view - [`7e81dcb`](https://github.com/Pasta-Devs/Marinara-Engine/commit/7e81dcb18ad38ce07569705fd0f54cdb59752941) fix(characters): restore sheet focus after pointer dismissal - [`c3887ed`](https://github.com/Pasta-Devs/Marinara-Engine/commit/c3887edaba7b6266bdd8ee411d9eb5dedfd0dabc) fix(characters): reuse the avatar full image overlay for sheets - [`cf30ef1`](https://github.com/Pasta-Devs/Marinara-Engine/commit/cf30ef1fcdc46e767b29d407e05ee61176fbf0a4) fix(characters): persist sheet selections like avatar uploads - [`61c5f32`](https://github.com/Pasta-Devs/Marinara-Engine/commit/61c5f32aa096b737cc1642225f2e6306d63f3c99) test(characters): select sheet model in the current picker - [`6af3317`](https://github.com/Pasta-Devs/Marinara-Engine/commit/6af33176d7fdfa3b3c42c0f6fcdd3c6fe351f64a) fix(characters): scope sheet-save guards to their own mutation - [`b4a4641`](https://github.com/Pasta-Devs/Marinara-Engine/commit/b4a464121841f0e08ddf0584fc77a37fadf3f757) style(characters): simplify character sheet labels - [`660bc89`](https://github.com/Pasta-Devs/Marinara-Engine/commit/660bc8999cab0fe587783d9cea27af6e2fae1fb9) test(characters): retain generated sheet cancellation coverage - [`b29081c`](https://github.com/Pasta-Devs/Marinara-Engine/commit/b29081c34c02612b3801b1726c04acfb78d028c6) test(characters): reset likeness after reopening the sheet generator - [`e3fc381`](https://github.com/Pasta-Devs/Marinara-Engine/commit/e3fc381ca5d9e1a32b87b57600af7d66b50a7403) Merge branch 'staging' into codex/character-sheet-preview ### 📊 Changes **7 files changed** (+391 additions, -58 deletions) <details> <summary>View changed files</summary> 📝 `e2e/avatar-preview.e2e.ts` (+194 -0) 📝 `e2e/core-flows.e2e.ts` (+59 -4) 📝 `e2e/sprite-library.e2e.ts` (+1 -1) 📝 `packages/client/src/components/characters/CharacterEditor.tsx` (+90 -35) 📝 `packages/client/src/components/ui/AvatarCropWidget.tsx` (+43 -15) 📝 `packages/client/src/localization/locales/en.json` (+3 -2) 📝 `scripts/regressions/onboarding-s1.regression.ts` (+1 -1) </details> ### 📄 Description > [!IMPORTANT] > Contributions target `staging`. Outside contributors require an approving review from `SpicyMarinara`. ## Linked issue Closes #8706 ## Why this change An applied character sheet should open like the avatar's **Full** button. Sheet media changes also should persist like avatar and sprite uploads: uploading a sheet and refreshing should not require a separate card Save or trigger a leave-page warning. ## What changed - Open applied character sheets from the compact thumbnail and expanded image in the avatar's existing borderless Full presentation. Share the viewer with avatars, including focus restoration, Escape, close/backdrop dismissal and hardware back support. - Persist uploaded/generated sheet selections, replacements, the reference toggle and removal immediately using existing sparse character updates. Keep unrelated text edits unsaved and protected; failed sheet writes retain the previous selection. Removal clears the selection and reference flag while retaining the gallery image. - Use the requested labels **Remove character sheet** and **Use character sheet** from #8706 in the existing English localization keys; the shared keys also update the persona sheet labels. - Add viewer-parity and refresh/error/draft-preservation browser coverage. Preserve generated-sheet cancellation coverage alongside immediate saving. Update affected reference and sprite tests, including the generated-sheet test's current model picker. - Keep the onboarding Save-guard regression independent of Prettier line wrapping; the assertion still requires `!dirty || unreadableOnboarding`. ## Validation - [x] `pnpm check` passes locally - [x] 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) - [x] Above manual verification completed (describe below) - [x] Read and followed `CONTRIBUTING.md` ### Manual verification notes Agent-run validation evidence is listed below. - `pnpm check` passed on `b4a464121841`, including localization, formatting, workspace lint, type checks and production builds. Existing unrelated lint warnings remain. - Product revision `b4a464121841` was built and run in an isolated Docker preview. Compiled desktop and mobile checks exercised sheet upload, refresh without a browser warning, both requested labels and the borderless viewer. Only disposable QA characters were removed. - `pnpm smoke:ui --timeout=120000` passed all seven desktop Chromium smoke cases on `b4a464121841`. - `pnpm regression:ui` passed all 18 selected cases on `b4a464121841` across desktop Chromium, mobile Chromium and mobile WebKit (`--workers=1 --timeout=120000`). Coverage includes refresh without a warning, sparse sheet writes, unrelated unsaved text, rejected writes, Full-view parity, generated sheets, character/persona reference persistence, in-flight card saving and sprite management. - After the test-only review fix, Prettier and `pnpm check:e2e-types` passed; the generated-sheet Save/Cancel case then passed again in all three browsers on final head `b29081c34`. Product source is unchanged from the fully checked and container-tested `b4a464121841`. - Local CodeRabbit completed two CLI reviews against `upstream/staging` (on `b4a464121841` and `660bc8999`). Five items were evaluated across the two runs; dispositions are below. The final one-line follow-up only restores the test's sprite-only setup after reopening the generator. - Human verification requested: compare the avatar Full view with both sheet entry points; check light/dark themes and mobile sizing; upload, replace, toggle reference and remove a sheet without card Save, then refresh; confirm unrelated text drafts still require Save and survive a failed sheet write. ### CI follow-up (2026-11-03) The maintainer-updated head `e3fc381ca` passed 549/550 files in Node shard 3. `onboarding-s1.regression.ts` failed because its source assertion required the Save-disabled condition on one line, while Prettier had wrapped the longer condition after `=`. Commit `f395d7cb9` makes only that assertion whitespace-tolerant. The exact regression failed before the fix and passed afterward. A negative control confirmed the assertion still rejects removal of the unreadable-onboarding guard; single-line and wrapped forms both pass. Prettier and `git diff --check` passed. Application code is unchanged by this follow-up; the parent head's `pnpm-validate`, container and platform checks passed. [The CI rerun](https://github.com/Pasta-Devs/Marinara-Engine/actions/runs/41643965869) passed all three Node shards and `complete-node-regressions`; shard 3 passed 550/550 files. All technical checks on `f395d7cb9` are green, including `pnpm-validate`, container/platform builds, CodeQL and Dottore (Viable, With Notes; no actionable defects). The only remaining failed status is the required outside-contributor owner approval. ### Local review disposition - Restored the existing generated-sheet Cancel interaction alongside Save coverage, and assert that canceling a replacement retains the previously saved sheet. - Retained the existing avatar Full close-button dimensions and positioning. The extraction preserves that presentation; a larger touch target/top safe-area adjustment is an existing avatar improvement rather than a regression introduced here. - Retained click-on-image dismissal because the avatar Full viewer already closes on any overlay click and this request explicitly asks for the same behavior. The close button, Escape and back dismissal also work. - Retained **Remove character sheet** because that exact wording was requested in #8706. Removal clears the sheet assignment and reference flag; it preserves the gallery asset, as documented above. - Retained the sprite-test expectation **Use character sheet** because the English UI key and the requested wording in #8706 changed together. The disabled-state assertion remains intact. Prepared by @DSBwizzard. @SpicyMarinara: this account cannot self-assign upstream issues or PRs. ## Docs and release impact - [x] 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) No installation, update, release, schema or API contract changes; no documentation or release-file changes are needed for this UI correction. New and changed UI copy uses canonical English semantic keys. ## UI evidence (if applicable) Approved desktop and mobile screenshots are attached in [the issue's UI evidence comment](https://github.com/Pasta-Devs/Marinara-Engine/issues/8706#issuecomment-6592369401). They show disposable QA characters with Engine's built-in Mari artwork after upload and refresh, in the shared avatar Full viewer. <img width="960" alt="Desktop character-sheet Full viewer after upload and refresh" src="https://github.com/user-attachments/assets/c8dea70a-d8b2-4249-b28d-d779096d6a05" /> <img width="390" alt="Mobile character-sheet Full viewer after upload and refresh" src="https://github.com/user-attachments/assets/95e779c8-f21b-46f5-9f35-55a0066b361b" /> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-07 17:39:29 +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#8756
No description provided.