Skip to content

feat(avatar): draw every other part starting from the built-in style - #1243

Merged
DoodleBears merged 1 commit into
mainfrom
claude/festive-gauss-gv7xu2
Oct 8, 2026
Merged

DoodleBears merged 1 commit into
mainfrom
claude/festive-gauss-gv7xu2

Conversation

@DoodleBears

@DoodleBears DoodleBears commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Closes #1240. Part of spec #1209. This PR uses @botharness/pixel-avatar 0.7.0 (BotHarness/BotPixel#15).

What you can draw now

  • Outfit, accessory, beard, glasses, nose, cheeks, petals and flower base each gain Draw or edit this piece, so together with Custom Parts 1b: draw hair pieces starting from the built-in style #1238 every part slot except eyes, brows and mouth can be drawn. Those three stay rig-owned for blink and speech, per ADR-0148.
  • The editor starts from the worn part flattened by replacePartStart:
    • pixels that are exactly an appearance color at a tone stay recolorable;
    • other pixels become fixed colors;
    • an unchanged copy renders identically.
  • A note explains that the drawn part keeps its shape and no longer adapts to face shape or species.
  • Drawing uses one layer over a backdrop that leaves out the part being replaced.

Wearing and switching back

  • The saved part goes to the Part Library and is worn in its slot.
  • Back to the built-in style restores the saved choice.

Rendering (BotPixel)

  • Drawn face parts never cover any speaking-mouth pixel.
  • Drawn parts hide wherever the species or headwear hides the built-in part.
  • A drawn accessory replacing a helmet or hood shows the hair again.

Fix for a regression from #1242: picking a built-in style in a part category (hair included) only upgrades the recipe when it takes a drawn part off. Before this, picking built-in bangs on a version 1 Avatar upgraded it to version 2.

Evidence

I captured this on an isolated DSH instance built from this branch. The speech is simulated. Details: docs/assets/pr/1240-drawn-parts.

Outfit flattened from the worn sailor outfit Gold badges and a darker hem drawn in
outfit start outfit edited
Glasses lenses filled pink Shirt color recolors the drawn outfit
glasses recolor

Verification

  • pnpm typecheck, pnpm lint, pnpm format and the Release Ledger check all pass.
  • Full vitest run: 3465 passed. client-observer.test.ts fails in this container because it can't bundle node:sqlite; it fails the same way on a clean tree.
  • New editor test: an outfit drawn from the flattened start shows the note, has no back layer, starts each cell with its color slot and tone, saves an outfit part and saves outfitPart.
  • The existing preset/accessory test passes again; it caught the version upgrade fixed above.
  • BotPixel 0.7.0 tests cover an identical round trip for every outfit, every accessory except helmet and hood, every beard, glasses, nose, cheeks, petal and base, plus mouth keep-out, hiding and turns.

Agent-Task: claude/cloud/session_01MozvQ2eMvqX1MzSqm9G2o8

🤖 Generated with Claude Code

https://claude.ai/code/session_01MozvQ2eMvqX1MzSqm9G2o8


Generated by Claude Code

Summary by CodeRabbit

  • New Features
    • Draw and edit custom avatar outfits, accessories, beards, glasses, noses, cheeks, petals, and flower bases, starting from the currently worn style.
    • Appearance-color pixels remain recolorable. Drawn face parts don’t cover the speaking mouth and may be hidden by species or headwear.
    • Return to a built-in style to restore its selection; choosing a built-in style won’t update an older avatar recipe unless you remove a drawn part.
  • Documentation
    • Added examples and a walkthrough for drawing and editing avatar parts.

Outfit, accessory, beard, glasses, nose, cheeks, petals and flower base
gain "Draw or edit this piece": the editor starts from the worn part
flattened by replacePartStart (pixelaccurate, recolorable where exact),
uses one layer over a backdrop without that part, and wears the saved
part in its slot. Picking a built-in style only upgrades the recipe when
it takes a drawn part off, which also fixes built-in hair choices
upgrading version 1 recipes. Uses @botharness/pixel-avatar 0.7.0.

Issue: #1240
Agent-Task: claude/cloud/session_01MozvQ2eMvqX1MzSqm9G2o8
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MozvQ2eMvqX1MzSqm9G2o8
@coderabbitai

coderabbitai Bot commented Oct 8, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 78a6cd8e-43ee-47be-a39d-f4e3a9aaa9e1
📥 Commits

Reviewing files that changed from the base of the PR and between 04da609 and a46dbce.

⛔ Files ignored due to path filters (3)
  • docs/assets/pr/1240-drawn-parts/drawn-parts-flow.gif is excluded by !**/*.gif
  • docs/assets/pr/1240-drawn-parts/drawn-parts-flow.mp4 is excluded by !**/*.mp4
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (16)
  • CHANGELOG.md
  • CHANGELOG.zh.md
  • docs/assets/pr/1240-drawn-parts/README.md
  • docs/assets/pr/1240-drawn-parts/glasses-edited-en-light.webp
  • docs/assets/pr/1240-drawn-parts/glasses-start-en-light.webp
  • docs/assets/pr/1240-drawn-parts/outfit-edited-en-light.webp
  • docs/assets/pr/1240-drawn-parts/outfit-start-en-light.webp
  • docs/assets/pr/1240-drawn-parts/parts-recolor-en-light.webp
  • docs/assets/pr/1240-drawn-parts/parts-speaking-en-light.webp
  • packages/client/src/client/avatar-appearance-editor.tsx
  • packages/client/src/client/custom-part-editor.tsx
  • packages/client/src/client/locale.ts
  • packages/client/test/avatar-appearance-editor.test.ts
  • packages/core/package.json
  • packages/core/src/bots/avatar-appearance.ts
  • pnpm-workspace.yaml

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

The avatar editor now supports drawing and editing custom outfit, accessory, beard, glasses, nose, cheeks, petal, and flower-base parts. The workflow uses replacement-part helpers from pixel-avatar 0.7.0. The editor test covers drawing and saving a custom outfit.

Changes

Custom avatar parts

Layer / File(s) Summary
Replacement-part API
packages/core/package.json, packages/core/src/bots/avatar-appearance.ts, pnpm-workspace.yaml
The core package updates @botharness/pixel-avatar to version 0.7.0 and re-exports its replacement-part helpers, slot list, guard, and type. The workspace release-age exclusions include version 0.7.0.
Replacement-slot drawing workflow
packages/client/src/client/avatar-appearance-editor.tsx, packages/client/src/client/custom-part-editor.tsx, packages/client/src/client/locale.ts, packages/client/test/avatar-appearance-editor.test.ts, docs/assets/pr/1240-drawn-parts/README.md, CHANGELOG.md, CHANGELOG.zh.md
The editor adds replacement-slot categories and initializes drawings from built-in styles. Built-in selection clears an override when a custom part is worn. The custom-part editor updates layer-control visibility. The outfit test verifies drawing and saving a custom part. Locale text, visual documentation, and changelog entries describe the drawing workflow and its behavior.

Priority: ➖ Normal

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Feature

Merge Risk: ⚪ Minimal · up to a46db

No identified issue blocks merging the expanded avatar-part drawing workflow after normal checks.

🚥 Pre-merge checks | ✅ 3 | ❌ 1 | ❓ 1

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 5 files. (5 skipped: 5 … Write docstrings for the functions missing them to satisfy the coverage threshold.
Linked Issues check ❓ Inconclusive Direct issue #1240 is active and has coding requirements. The PR summary supports the replacement-slot editor, flattened starts, recolorable cells, saving and wearing, built-in restoration, rendering … Provide reviewable evidence for the missing #1240 criteria, or inspect the BotPixel 0.7.0 implementation and the client snapshot, Part Library, golden-output, and per-slot bounds tests.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: enabling drawing of additional avatar parts from their built-in styles.
Out of Scope Changes check ✅ Passed The listed changes stay within #1240. They implement replacement-slot editing, editor text and tests, BotPixel integration, public re-exports, release configuration, changelog entries, and focused evi…
Full details: Linked Issues check

Explanation

Direct issue #1240 is active and has coding requirements. The PR summary supports the replacement-slot editor, flattened starts, recolorable cells, saving and wearing, built-in restoration, rendering hides, mouth keep-out, turns, and the recipe-version fix. The available evidence does not establish all acceptance criteria, including eye blink/gaze keep-out, older-client snapshot fallback, unchanged golden output, slot-filtered Part Library results, or bounds coverage for every slot. The referenced BotPixel 0.7.0 implementation and tests are not included in the reviewable change summary.

Full details: Docstring Coverage

Explanation

Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 5 files. (5 skipped: 5 unsupported.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@DoodleBears
DoodleBears merged commit 5efae37 into main Oct 8, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Custom Parts 1c: draw every other part slot starting from the built-in style

2 participants