Add support for embedded Avatars#14
Conversation
|
Warning Review limit reached
Next review available in: 59 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: ⛔ Files ignored due to path filters (156)
📒 Files selected for processing (12)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
|
@coderabbitai review |
✅ Action performedReview finished.
|
Purpose
Adds a
logopackage that resolves an application/user branding "logo spec" string into a renderable representation on Android:emoji:<glyph>glyphs,avatar:shape=...,variant=...,content=...,colors=...,bg=...generated avatars, or a bare image URL, mirroring the same spec used by the JS SDKs (see thunder-id/thunderid#4182).Approach
LogoSpecParserrecognizes and decomposes theemoji:andavatar:schemes from a spec string; anything else is left for the caller to treat as a plain URL.AvatarSpecEnumsdefinesAvatarShape(rounded/circle) andAvatarVariant(one_letter/two_letter/anonymous_animal/anonymous_entity), each parsed from the spec's wire-value strings with a safe default fallback.AvatarContentDeriverfills incontentfrom a fallback seed (e.g. a display name) when the spec itself doesn't carry one — initials for letter variants, a deterministic hashed pick into the curated icon set for the anonymous variants (AvatarMathholds the shared hash/palette/rotation logic).AvatarGeneratornatively renders theone_letter/two_lettergradient-swatch variants to aBitmap(no SVG dependency), matching the JS implementation's palette and rotation formula.LogoIconRegistrymaps curatedanonymous_animal/anonymous_entitycontent keys to bundled drawable resources (PNGs at mdpi/xhdpi/xxhdpi, generated from the same source SVGs as the JS SDK's curated icon set).LogoResolver.resolve(spec, fallbackSeedText)ties it together into a single entry point returning a sealedResolvedLogo(Emoji/Icon/Avatar/Url), so callers render whichever variant comes back without needing to know the spec grammar.Related Issues
Related PRs
Checklist
breaking changelabel added.Security checks