Skip to content

fix(avatar): bun and odango knots take the back hair color - #21

Merged
DoodleBears merged 2 commits into
mainfrom
fix/bun-back-hair-color
Oct 9, 2026
Merged

DoodleBears merged 2 commits into
mainfrom
fix/bun-back-hair-color

Conversation

@DoodleBears

@DoodleBears DoodleBears commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #19.

Cause

Bun and odango draw their knots in the style's front mask; their back mask is none. Split hair (detailedHair()) merges the back style's front mask into the fringe for rows y <= 7, so the knots became part of the bangs piece. The version 4 piece-color pass therefore gave them to bangsColor, and backHairColor, which only owns masks.back, never painted anything.

Change

  • hair() returns a knots mask for bun and odango. The front mask is unchanged, so the knots are drawn exactly as before.
  • detailedHair() passes on the back style's knots, excluding any pixel the bangs style itself covers.
  • In the version 4 piece-color pass, backHairColor owns the knot pixels and bangsColor no longer does.
  • The one exception is a drawn bangs part: it replaces the built-in fringe, so it keeps ownership of whatever it draws.

Compatibility

  • Only version 4 recipes that set bangsColor or backHairColor with backHair: 'bun' | 'odango' render differently, and that's the fix.
  • Recipes without piece colors take the same code path, so versions 1, 2 and 3 and all seeded faces are unaffected.
  • Every golden fixture passes unchanged: botharness-golden, species*, animals, custom-part, pieces.

Tests

New test in pieces.test.ts, run for both bun and odango:

  • backHairColor now changes more than 4 cells, all in the knot rows (y <= 7).
  • bangsColor and backHairColor share at most the dark outline on the seam between knot and fringe.
  • Setting the color to hairColor is a no-op.
  • Turned heads (±30°) are recolored too.

The test fails on main and passes with the fix. pnpm verify passes (112 tests).

#20 covers the two look-alike choices from the same audit (buzz bangs, heart vs diamond face). They're occlusion effects, and this PR leaves them unchanged.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Bug Fixes
    • For asset version 4, bun and odango knots now follow the back-hair color instead of the fringe color when hair colors are customized. Recipes using other hairstyles or no custom hair colors are unchanged.

The knots are drawn in the bun/odango style's front mask, which split
hair merges into the fringe, so in asset version 4 bangsColor painted
them and backHairColor had nothing to paint. hair() now reports the
knots, detailedHair() passes them on, and the version 4 piece-color pass
gives them to backHairColor instead of bangsColor (unless a drawn bangs
part replaces the fringe). Every golden fixture is unchanged.

Fixes #19

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Oct 9, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

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 45 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: a2d94475-50fc-4f42-b505-69814479c276

📥 Commits

Reviewing files that changed from the base of the PR and between 369a587 and d382b27.


📒 Files selected for processing (2)
  • CHANGELOG.md
  • packages/avatar/package.json


No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: fd0a1eec-8c89-4487-8e25-39c55b2e6477

📥 Commits

Reviewing files that changed from the base of the PR and between 71e69e8 and 369a587.


📒 Files selected for processing (3)
  • CHANGELOG.md
  • packages/avatar/src/figure.ts
  • packages/avatar/test/pieces.test.ts

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

Asset-version-4 hair masks now identify bun and odango knots separately. Recoloring assigns visible knots to back hair rather than bangs, subject to the drawn-bangs condition. Tests cover the updated color ownership.

Changes

Bun and odango knot recoloring

Layer / File(s) Summary
Separate knot masks
packages/avatar/src/figure.ts
The bun and odango branches return separate knot masks. detailedHair excludes knots covered by the built-in bangs front mask.
Recoloring ownership and coverage
packages/avatar/src/figure.ts, packages/avatar/test/pieces.test.ts, CHANGELOG.md
Asset-version-4 recoloring assigns visible knots to back hair and excludes them from bangs-color ownership. Tests check recoloring, seam overlap, matching base colors, and two yaws. The changelog records the change.

Priority: ➖ Normal

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix · Severity of issue fixed: Medium


Merge Risk: ⚪ Minimal · up to 369a5

The described version-4 knot recoloring change has focused coverage for bun and odango behavior. No concrete issue requiring resolution before merge is established.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

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 3 functions across 2 files. (1 skipped: 1 … Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 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: bun and odango knots now use the back hair color.
Linked Issues check Passed Issue #19 requires version 4 bun and odango knots to respond to backHairColor instead of bangsColor, with unchanged golden output. hair() now exposes knots for both styles. detailedHair() pa…
Out of Scope Changes check Passed The reviewed changes are limited to the issue behavior, its changelog entry, and automated regression coverage. The figure.ts mask and color-pass changes implement #19. The pieces.test.ts addition…

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 3 functions across 2 files. (1 skipped: 1 unsupported.)



✨ 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


  • Autofix · 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.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@DoodleBears
DoodleBears merged commit bf876e8 into main Oct 9, 2026
@DoodleBears
DoodleBears deleted the fix/bun-back-hair-color branch October 9, 2026 08:16
DoodleBears added a commit to BotHarness/deepseekbot-site that referenced this pull request Oct 9, 2026
…#51)

- The Avatar Studio gets the home page's companion. It walks along the
  bottom of the page wearing the design as it is edited, and asks for
  analytics consent there instead of the consent bar, like on the home
  page. pageKind ignores a trailing .html so dev (/avatar.html) behaves
  like the site (/avatar).
- @botharness/pixel-avatar 0.10.2 colors bun and odango knots with the
  back hair color (BotHarness/BotPixel#21), so the editor no longer
  hides that color row for them. The mascot, Crew and presets render
  byte-identical.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
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.

pixel-avatar: bun and odango back hair ignore backHairColor

1 participant