Switch auto-generated avatars from dicebear constellation to rings with a walhub-green greyscale-preset background #525
Labels
No labels
actions
bug
cli
duplicate
enhancement
fork
forum
git storage
help wanted
insights
invalid
issues
moderation
oidc
ownership transfer
packages
pr/merge protection rules
projects
pull requests
question
releases
sponsorships
tags
webhooks
wiki
wontfix
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
crueber/walhub#525
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What's requested
Switch the auto-generated user avatar style from DiceBear constellation to rings, and give the avatar a greyscale-preset-style background rendered in the standard walhub green — the same treatment DiceBear's "indigo duotone" preset applies to its own duotone hue, but in the app's brand color.
Evidence (current behavior)
internal/identity/avatar.go:61-67—constellationStyleparses thestyles.Get("constellation")definition once per process.internal/identity/avatar.go:80-94—GenerateUserAvatarSVGrenders withmap[string]any{"seed": seed}and default options only. A prior verification noted the constellation style defines no options, so there was no preset/backgroundColor key to set; rings does expose background options (the style definition carries abackgrounds/backgroundColoroption group with the standard DiceBear presets, including the greyscale-style flat/duotone backgrounds), which is what makes this treatment possible now.checkAvatarSVG, avatar.go:97-112) must carry over unchanged.Design notes
web/src/ui.css:.btn.primaryisemerald-600, brand textemerald-700 dark:text-emerald-400, etc. — emerald-600#059669is the canonical brand green).constellationStyle→ringsStyle(or keep a neutral name), switchstyles.Get("rings"), and pass the resolved background option throughdicebear.NewAvataralongsideseed. Verify against the vendoredgithub.com/dicebear/styles/v10definition forringswhat the option keys actually are (backgroundColor,backgroundType) before wiring — don't guess keys.Acceptance criteria
GenerateUserAvatarSVGrenders the DiceBearringsstyle, notconstellation.TestGenerateSeedAbsentstays green).checkAvatarSVGsanitize gate unchanged and still passing (size cap,<svg>prefix, no<script>, seed-leak check).internal/identity/avatar_test.goassertions updated for the new style (any style-name pins, output-shape checks).GET /api/v1/users/{username}/avatarpath.Fixed by #536 (#536): rings style + solid emerald-600 background, seed/sanitize contracts intact.
Review of PR #536 (fix/issue-525, commit
50e11a0) — verified in scratch worktree /tmp/pr536 (removed afterward). No browser (per instructions; SVG eyeballed as XML).(1) Rings wired, keys verified — PASS. avatar.go:73 ringsStyle uses styles.Get("rings"); avatar.go:102-105 passes backgroundColor: ["059669"] as core-library option alongside seed. Confirmed against vendored sources: rings.json (styles/v10 v10.6.0) defines no per-style options; dicebear-go v10 (v10.7.0) has zero backgroundType references (v5-era name, correctly not used); background is resolved from the backgroundColor core option (internal/render/renderer.go:37,186; internal/style/options_descriptor.go:67). Functional proof: rendered SVG carries dc:titleRings</dc:title>.
(2) Solid emerald background — PASS. Rendered eyeball SVG (seed eyeball@example.com, len 3030): present; fills are exactly {#059669, #dea552, none, white}; no linearGradient/radialGradient/<pattern; no <svg x="', 'a<b@example.com'); pre-existing TestGenerateSeedAbsent untouched and green; eyeball render contains no seed bytes.
(4) Sanitize gate — PASS, unchanged. Diff contains zero lines touching checkAvatarSVG (avatar.go:117-132 identical to main); size cap, <svg prefix, <script, seed-leak checks all still enforced and exercised by the new test (checkAvatarSVG called per row).
(5) Existing holders untouched — PASS. EnsureAvatarAsync (avatar.go:308-350) unchanged: early return when profile has AvatarContentType or AvatarDisabled, pre- and post-render; no migration/backfill code in diff. New look flows via POST regen and next-login generation (both call GenerateUserAvatarSVG).
(6) No new deps — PASS. go.mod/go.sum diff vs main is empty; changed files are only the 3 identity files + 2 docs. Same dicebear modules under the existing #376 law-1 exception.
(7) Quality gates — PASS. internal/identity: go test -race green; coverage 95.6% statements (≥95 gate); gofmt clean; go vet clean; go build ./... clean. Docs updated in same change (01_identity_permissions.md decision block + 06_server_http.md mention, law 12); file-header comment updated; no web/ changes (correct — opaque SVG bytes); no constellation pins left in code/tests (only historical 'constellation before' notes in docs).
No fixes needed; nothing pushed. MERGE RECOMMENDATION: ready to merge.
Fixed by PR #536 (review clean — all 7 checks pass, keys verified against vendored sources, seed/sanitize intact), merged. Closing.