feat: SVG robot avatar templates (POC)#7
Open
radaghastly wants to merge 2079 commits into
Open
Conversation
luthien-m
approved these changes
Feb 17, 2026
luthien-m
left a comment
There was a problem hiding this comment.
Nice POC, Rad! CI green, code is clean. A few notes:
What works well:
- SVG_SPEC.md is thorough — good bit allocation design for future expansion
- Tests are solid (205 lines covering all exports + file validation)
- Preview page is slick with the gallery and parts library view
- Color scheme derivation is clean and deterministic
Minor observations (non-blocking):
extractContentregex (/<g[^>]*>([\s\S]*?)<\/g>/) uses non-greedy match — works fine for current templates since none have nested<g>elements, but if future parts add nested groups it will silently truncate. Worth a comment or consider a more robust parser if templates get complex.- All SVG part files are missing trailing newlines (no newline at EOF). Minor but
git diffwill flag it. - The spec describes granular bit-level color derivation (hue from 8 bits, sat/light modifiers, accent colors from bits 80-95) but the renderer uses a simpler 10-hue lookup table. Totally fine for POC — just noting the gap for when someone implements the full spec.
composeSvgdestructures buckets as[,,,, , bhColor, emColor]— a named destructure or comment mapping indices to meaning would help readability.
Overall: clean, well-tested, good foundation. 👍
luthien-m
approved these changes
Feb 18, 2026
luthien-m
left a comment
There was a problem hiding this comment.
Nice POC! SVG robot avatar templates look solid. CI is green (12/12 checks passing). A few notes:
Security: ✅ Clean — SVG parts are static path data with no scripts, event handlers, or foreign objects. User input goes through MD5 before bucket selection, so no injection vector in the rendering pipeline.
Minor observations:
sharpandsvgoare added todependenciesin package.json but aren't imported anywhere in this PR. Consider moving them todevDependenciesor deferring until they're actually used.- Several SVG files are empty (head-7/8/9, all mouths) — presumably placeholders for future work. Might be worth a comment in the spec noting which parts are stubs.
- The build script inlines its own MD5 implementation rather than reusing
blueimp-md5. Intentional for zero-dep browser bundle? - Two rendering approaches coexist:
src/svg-render.js(CSS class + color replacement) vs the build script's renderer (SVG hueRotate filters). Both valid, just noting the divergence for whoever picks this up next.
Tests are thorough (215 lines covering colors, composition, file existence). Good foundation for a POC. 🤖
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
SVG robot avatar templates POC. 50 part templates + renderer + preview page + bit allocation spec. See SVG_SPEC.md for details.