[PR #7617] [MERGED] fix(avatars): preselect the full-body neutral sprite for a mesh avatar #7841

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

📋 Pull Request Information

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

Base: staging ← Head: fix/mesh-avatar-preselect-neutral


📝 Commits (2)

  • 5bdf9b9 fix(avatars): preselect the full-body neutral sprite for a mesh avatar
  • d12e1f8 fix(avatars): say a full-body or bust sprite works best for a mesh avatar

📊 Changes

5 files changed (+109 additions, -8 deletions)

View changed files

📝 docs/agents/avatars.md (+1 -1)
📝 e2e/avatar-2d.e2e.ts (+85 -2)
📝 packages/client/src/features/avatars/generation/MeshAvatarSection.tsx (+16 -3)
📝 packages/client/src/features/avatars/renderers/pngtuber/pngtuber-layers.ts (+6 -1)
📝 packages/client/src/localization/locales/en.json (+1 -1)

📄 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

No linked issue: requested by the maintainer on 2026-10-14.

Why this change

  • In the 2D Avatars agent, "Make an avatar from a sprite" → Mesh avatar opened with no sprite chosen, so you had to find the right one yourself every time.
  • The best picture for a mesh avatar is usually the neutral one, so it should be chosen for you. You can still pick another sprite.

What changed

  • The mesh avatar maker now picks the full-body neutral sprite when there is one. Otherwise it picks the neutral portrait. If there's neither, nothing is picked, as before.

  • Labels are matched the way the avatar code already reads them: full_neutral, full-neutral, Full Neutral and Neutral all count. This matches sprite labels only, never character names.

  • Until you pick or clear a sprite, the choice follows the sprite list. If the list loads or changes later, the best match is chosen again. Your own pick or a cleared choice is kept. If the sprite you picked is removed, it goes back to the best match, so Make never sends a sprite that no longer exists. (CodeRabbit found that last case. It was possible before this change too.)

  • Picking a sprite, including the automatic pick, never starts making the avatar.

  • isFullBodySprite is now exported from pngtuber-layers.ts, the file that already held the full-body check, and the PNGTuber sprite filter uses it too. There is still only one copy of that check.

  • e2e/avatar-2d.e2e.ts has a new focused test. It mounts the section and redraws it with different sprite lists:

    • [happy, neutral, full_neutral] picks full_neutral.
    • Full Neutral is also recognized.
    • [happy, neutral] picks neutral.
    • [happy] picks nothing, and Make stays disabled.
    • Your pick survives a list change.
    • A removed pick goes back to the best match.
    • A cleared choice stays cleared.
    • No /api/avatar-generation request is sent.
  • No copy changes.

  • The hint under the picker now reads "A front-facing full-body or bust sprite works best." (it recommended only a bust), and docs/agents/avatars.md → Mesh avatar step 1 says the full-body neutral sprite is picked for you. The maintainer chose this wording on 2026-10-14. Translations: #7618.

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

Commands run by the agent (results):

  • pnpm exec playwright test e2e/avatar-2d.e2e.ts -g "preselects" --project=desktop-chromium: failed on unpatched code (no sprite was pressed when full neutral was expected) and passed with the fix.
  • pnpm exec playwright test e2e/avatar-2d.e2e.ts e2e/avatar-setup.e2e.ts on desktop-chromium, mobile-chromium and mobile-webkit: 42 passed (before the CodeRabbit follow-up). After the follow-up, the new test passed on all 3 projects.
  • node ./scripts/run-regressions.mjs --filter scripts/regressions/avatar-2d-renderers.regression.ts: passed. The same command with --filter scripts/regressions/avatar-generation.regression.ts: passed.
  • pnpm localization:check: passed.
  • pnpm check: passed (exit 0).
  • Local CodeRabbit (coderabbit review --agent --committed): the first run had 1 minor finding (a removed pick kept Make enabled). It was fixed and covered by the test. The rerun had 0 findings.

Manual verification notes

  • Manually verify in the browser: open the 2D Avatars agent page and choose a character that has neutral and full_neutral sprites. Under "Mesh avatar", full neutral should be preselected and "Make mesh avatar" should be enabled.
  • Manually verify that a character with only portrait sprites (including neutral) gets neutral preselected, and a character with no neutral sprite gets nothing preselected.
  • Manually verify that picking another sprite, or clicking the preselected one to clear it, sticks. No mesh build should start until you press "Make mesh avatar".
  • Manually check whether a full-body sprite gives a good mesh avatar. The hint under the picker still says "A front-facing bust sprite works best." I left that copy unchanged.

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)

No screenshots. The change only affects which sprite thumbnail starts out selected.

Summary by CodeRabbit

  • New Features
    • Mesh avatars now default to a neutral sprite, preferring a full-body option when available. The selection updates if sprites change, while respecting manual choices and cleared selections.
    • Full-body sprites are excluded from portrait choices when portrait sprites are available.
  • Documentation
    • Updated avatar sprite guidance to recommend a front-facing full-body or bust sprite.

🔄 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/7617 **Author:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Created:** 10/14/2026 **Status:** ✅ Merged **Merged:** 10/14/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `staging` ← **Head:** `fix/mesh-avatar-preselect-neutral` --- ### 📝 Commits (2) - [`5bdf9b9`](https://github.com/Pasta-Devs/Marinara-Engine/commit/5bdf9b94dc00e6882de307fc5ddd1eb604471837) fix(avatars): preselect the full-body neutral sprite for a mesh avatar - [`d12e1f8`](https://github.com/Pasta-Devs/Marinara-Engine/commit/d12e1f8a45e8f8fdb5eb1f8f195a51a25a7cc607) fix(avatars): say a full-body or bust sprite works best for a mesh avatar ### 📊 Changes **5 files changed** (+109 additions, -8 deletions) <details> <summary>View changed files</summary> 📝 `docs/agents/avatars.md` (+1 -1) 📝 `e2e/avatar-2d.e2e.ts` (+85 -2) 📝 `packages/client/src/features/avatars/generation/MeshAvatarSection.tsx` (+16 -3) 📝 `packages/client/src/features/avatars/renderers/pngtuber/pngtuber-layers.ts` (+6 -1) 📝 `packages/client/src/localization/locales/en.json` (+1 -1) </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 No linked issue: requested by the maintainer on 2026-10-14. ## Why this change - In the 2D Avatars agent, "Make an avatar from a sprite" → Mesh avatar opened with no sprite chosen, so you had to find the right one yourself every time. - The best picture for a mesh avatar is usually the neutral one, so it should be chosen for you. You can still pick another sprite. ## What changed - The mesh avatar maker now picks the full-body neutral sprite when there is one. Otherwise it picks the neutral portrait. If there's neither, nothing is picked, as before. - Labels are matched the way the avatar code already reads them: `full_neutral`, `full-neutral`, `Full Neutral` and `Neutral` all count. This matches sprite labels only, never character names. - Until you pick or clear a sprite, the choice follows the sprite list. If the list loads or changes later, the best match is chosen again. Your own pick or a cleared choice is kept. If the sprite you picked is removed, it goes back to the best match, so Make never sends a sprite that no longer exists. (CodeRabbit found that last case. It was possible before this change too.) - Picking a sprite, including the automatic pick, never starts making the avatar. - `isFullBodySprite` is now exported from `pngtuber-layers.ts`, the file that already held the full-body check, and the PNGTuber sprite filter uses it too. There is still only one copy of that check. - `e2e/avatar-2d.e2e.ts` has a new focused test. It mounts the section and redraws it with different sprite lists: - `[happy, neutral, full_neutral]` picks `full_neutral`. - `Full Neutral` is also recognized. - `[happy, neutral]` picks `neutral`. - `[happy]` picks nothing, and Make stays disabled. - Your pick survives a list change. - A removed pick goes back to the best match. - A cleared choice stays cleared. - No `/api/avatar-generation` request is sent. - No copy changes. - The hint under the picker now reads "A front-facing full-body or bust sprite works best." (it recommended only a bust), and `docs/agents/avatars.md` → **Mesh avatar** step 1 says the full-body neutral sprite is picked for you. The maintainer chose this wording on 2026-10-14. Translations: #7618. ## 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` Commands run by the agent (results): - `pnpm exec playwright test e2e/avatar-2d.e2e.ts -g "preselects" --project=desktop-chromium`: **failed** on unpatched code (no sprite was pressed when `full neutral` was expected) and **passed** with the fix. - `pnpm exec playwright test e2e/avatar-2d.e2e.ts e2e/avatar-setup.e2e.ts` on desktop-chromium, mobile-chromium and mobile-webkit: 42 passed (before the CodeRabbit follow-up). After the follow-up, the new test passed on all 3 projects. - `node ./scripts/run-regressions.mjs --filter scripts/regressions/avatar-2d-renderers.regression.ts`: passed. The same command with `--filter scripts/regressions/avatar-generation.regression.ts`: passed. - `pnpm localization:check`: passed. - `pnpm check`: passed (exit 0). - Local CodeRabbit (`coderabbit review --agent --committed`): the first run had 1 minor finding (a removed pick kept Make enabled). It was fixed and covered by the test. The rerun had 0 findings. ### Manual verification notes - Manually verify in the browser: open the 2D Avatars agent page and choose a character that has `neutral` and `full_neutral` sprites. Under "Mesh avatar", `full neutral` should be preselected and "Make mesh avatar" should be enabled. - Manually verify that a character with only portrait sprites (including `neutral`) gets `neutral` preselected, and a character with no neutral sprite gets nothing preselected. - Manually verify that picking another sprite, or clicking the preselected one to clear it, sticks. No mesh build should start until you press "Make mesh avatar". - Manually check whether a full-body sprite gives a good mesh avatar. The hint under the picker still says "A front-facing bust sprite works best." I left that copy unchanged. ## 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) No screenshots. The change only affects which sprite thumbnail starts out selected. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Mesh avatars now default to a neutral sprite, preferring a full-body option when available. The selection updates if sprites change, while respecting manual choices and cleared selections. * Full-body sprites are excluded from portrait choices when portrait sprites are available. * **Documentation** * Updated avatar sprite guidance to recommend a front-facing full-body or bust sprite. <!-- 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:03 +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#7841
No description provided.