Skip to content

Add buildAvatarSpec utility and export avatar-related types and functions#35

Merged
brionmario merged 1 commit into
thunder-id:mainfrom
brionmario:avatars
Jul 21, 2026
Merged

Add buildAvatarSpec utility and export avatar-related types and functions#35
brionmario merged 1 commit into
thunder-id:mainfrom
brionmario:avatars

Conversation

@brionmario

@brionmario brionmario commented Jul 21, 2026

Copy link
Copy Markdown
Member

Purpose

$subject

Approach

N/A

Related Issues

Related PRs

Checklist

  • Followed the contribution guidelines.
  • Manual test round performed and verified.
  • Documentation provided. (Add links if there are any)
  • Tests provided. (Add links if there are any)
    • Unit Tests
    • Integration Tests
  • Breaking changes. (Fill if applicable)
    • Breaking changes section filled.
    • breaking change label added.

Security checks

  • Followed secure coding standards in WSO2 Secure Coding Guidelines
  • Confirmed that this PR doesn't commit any keys, passwords, tokens, usernames, or other secrets.

Summary by CodeRabbit

  • New Features
    • Added a utility for creating avatar URI specifications from avatar settings, including optional background colors.
    • Exposed avatar URI parsing, generation, naming, icon, gradient, and type utilities through the browser and React packages.

@coderabbitai

coderabbitai Bot commented Jul 21, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Adds buildAvatarSpec to the browser package and re-exports it with other avatar utilities, types, constants, and helpers from the React package.

Changes

Avatar utility exports

Layer / File(s) Summary
Avatar specification builder and browser export
packages/browser/src/utils/buildAvatarSpec.ts, packages/browser/src/index.ts
Adds buildAvatarSpec to serialize AvatarParams into an avatar: specification, including an optional background value, and exposes it from the browser entrypoint.
React avatar utility re-exports
packages/react/src/index.ts
Re-exports avatar URI helpers, types, generation functions, constants, naming helpers, and anonymous icon sets from @thunderid/browser.

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

Possibly related PRs

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Description check ❓ Inconclusive The description follows the template but most sections are placeholders or N/A and don't explain the change. Replace $subject and N/A with a concrete purpose and approach, and complete the checklist and security items with actual status.
✅ Passed checks (4 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly reflects the main change: adding buildAvatarSpec and exporting avatar-related APIs.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
packages/browser/src/utils/buildAvatarSpec.ts (1)

36-38: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Add focused serializer/parser tests.

Cover serialization with and without bg, blank content, and round-tripping through extractAvatarParamsFromUri to lock the public URI contract.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/browser/src/utils/buildAvatarSpec.ts` around lines 36 - 38, Add
focused tests for buildAvatarSpec covering URIs with and without bg, blank
content serialization, and round-tripping the generated URI through
extractAvatarParamsFromUri. Assert the parsed parameters match the original
AvatarParams to preserve the public URI contract.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@packages/browser/src/utils/buildAvatarSpec.ts`:
- Around line 36-38: Add focused tests for buildAvatarSpec covering URIs with
and without bg, blank content serialization, and round-tripping the generated
URI through extractAvatarParamsFromUri. Assert the parsed parameters match the
original AvatarParams to preserve the public URI contract.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 314807de-43c4-439d-9dc4-22cd856f7785

📥 Commits

Reviewing files that changed from the base of the PR and between df6ecd9 and 2c21a03.

📒 Files selected for processing (3)
  • packages/browser/src/index.ts
  • packages/browser/src/utils/buildAvatarSpec.ts
  • packages/react/src/index.ts

@brionmario
brionmario merged commit 2a03148 into thunder-id:main Jul 21, 2026
3 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.

2 participants