Skip to content

feat(avatar): draw hair pieces starting from the built-in style - #1242

Merged
DoodleBears merged 3 commits into
mainfrom
claude/festive-gauss-gv7xu2
Oct 8, 2026
Merged

DoodleBears merged 3 commits into
mainfrom
claude/festive-gauss-gv7xu2

Conversation

@DoodleBears

Copy link
Copy Markdown
Contributor

Summary

Closes #1238. Part of spec #1209. This PR uses @botharness/pixel-avatar 0.6.0 (BotHarness/BotPixel#12).

Editor

  • The bangs, left side hair, right side hair and back hair categories each gain Draw or edit this piece.
  • The canvas starts from the worn piece flattened to cells (hairPieceStart), with a note that the drawn piece keeps this shape and no longer follows face shape or hair length.
  • The editor uses one layer over a dimmed backdrop that leaves out the piece being replaced, with the same tools as the headpiece.
  • Saving adds the part to the Part Library and wears it in that slot.
  • Re-opening a worn piece edits it, and the save records the original as its parent.

Library and restore

  • Each hair category lists the library parts drawn for that slot.
  • Back to the built-in style takes the drawn piece off, and the saved built-in choice comes back.
  • Choosing a built-in style also takes the drawn piece off.

Rendering (BotPixel)

  • In a hair part, hairColor cells at tone 0 are live hair. They are shaded and recolored like built-in hair, follow turns with the built-in style's offset, and hide under helmets, hoods and on flowers.
  • An unchanged flattened copy renders identically.

Plumbing

  • The headpiece category now uses the same slot-generic part panel.
  • CustomPartEditor takes a slot, an optional note and an optional backdrop.

Evidence

I captured this on an isolated DSH instance built from this branch. The speech is simulated: a test script drives the mouth layers, and no model reply was involved. Details: docs/assets/pr/1238-drawn-hair.

Worn bangs flattened to cells, with the keep-shape note Bangs parted, with a tuft and a gold pin
start edited
Recolored with the hair color Window Companion speaking (×4 crop)
recolor closeup

Full flow (draw bangs, extend the left lock, recolor, go back to the built-in style, wear the drawn bangs again, speak):

Verification

  • pnpm typecheck, pnpm lint, pnpm format and the Release Ledger check all pass.
  • Full vitest run: 3464 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 covers:
    • the flattened start, the note, the single layer and the 32×32 canvas;
    • erasing and saving a bangs part;
    • the library tile being selected;
    • re-opening without the note, and Cancel;
    • Back to the built-in style;
    • re-wearing from the library;
    • the saved recipe carrying bangsPart.
  • The existing headpiece tests still pass on the generic panel.

Agent-Task: claude/cloud/session_01MozvQ2eMvqX1MzSqm9G2o8

🤖 Generated with Claude Code

https://claude.ai/code/session_01MozvQ2eMvqX1MzSqm9G2o8


Generated by Claude Code

claude added 3 commits October 8, 2026 20:27
Bangs, left and right side hair and back hair gain "Draw or edit this
piece": the editor starts from the worn piece flattened to cells (with a
keep-shape note), uses a single layer over a backdrop without that
piece, and saves to the Part Library. The drawn piece is worn in its
slot; "Back to the built-in style" restores the saved choice, and
library parts are listed per slot.

Issue: #1238
Agent-Task: claude/cloud/session_01MozvQ2eMvqX1MzSqm9G2o8
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MozvQ2eMvqX1MzSqm9G2o8
Issue: #1238
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

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 5 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: ce6eb2c3-6caa-499c-9a0c-cf53c5cf49d2
📥 Commits

Reviewing files that changed from the base of the PR and between 78aba54 and 4211815.

⛔ Files ignored due to path filters (3)
  • docs/assets/pr/1238-drawn-hair/drawn-hair-flow.gif is excluded by !**/*.gif
  • docs/assets/pr/1238-drawn-hair/drawn-hair-flow.mp4 is excluded by !**/*.mp4
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (21)
  • CHANGELOG.md
  • CHANGELOG.zh.md
  • docs/architecture/botharness-architecture.en.md
  • docs/architecture/botharness-architecture.md
  • docs/assets/pr/1238-drawn-hair/README.md
  • docs/assets/pr/1238-drawn-hair/companion-closeup-en-light.webp
  • docs/assets/pr/1238-drawn-hair/hair-builtin-en-light.webp
  • docs/assets/pr/1238-drawn-hair/hair-edited-en-light.webp
  • docs/assets/pr/1238-drawn-hair/hair-recolor-en-light.webp
  • docs/assets/pr/1238-drawn-hair/hair-restored-en-light.webp
  • docs/assets/pr/1238-drawn-hair/hair-saved-en-light.webp
  • docs/assets/pr/1238-drawn-hair/hair-speaking-en-light.webp
  • docs/assets/pr/1238-drawn-hair/hair-start-en-light.webp
  • docs/assets/pr/1238-drawn-hair/side-edited-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
  • 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 04da609 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 1b: draw hair pieces starting from the built-in style

2 participants