feat(jsx-email): add avatar and avatar-group components#417
feat(jsx-email): add avatar and avatar-group components#417shellscape merged 5 commits intonext/v3from
Conversation
|
@CharlieHelps read the agents.md guidance and adjust this PR appropriately to be in compliance |
|
@CharlieHelps you appear to have broken the smoke tests |
b457777 to
78a9a34
Compare
|
Thanks for flagging this — I investigated and validated it end-to-end.
I also completed the earlier AGENTS.md compliance updates on this PR:
If you want, I can follow up with a dedicated hardening pass for the smoke watcher path to reduce transient preview-server crash risk. |
|
@CharlieHelps you haven't updated the PR body to check off the requirements that you added. do that now. |
|
Updated the PR body requirements checklist to mark completed items as checked. The checklist section now reflects current PR implementation status. |
|
@CharlieHelps can you implement the remaining requirements in the pr body? if you have questions, you may ask them but provide suggested answers in acbd format. |
|
Implemented the remaining requested items:
Commit: 61c9771 Tests run:
|
|
@CharlieHelps please do a thorough review of this PR to determine if it's ready to merge. Look at the diff, reviews, comments, and referenced issues/docs/links to build a complete understanding. Then respond with a comment that includes a list of MUST fix items that must be fixed before the the PR is merged, and a list of IMPROVEMENTS that shouldn't block the merge but may be quick improvements or things that could be addressed in a follow up PR. The MUST fix items should explain exactly what's wrong and what needs to change to resolve the problem. Both should be numbered lists and the IMPROVEMENTS list should continue counting up from the MUST list. It's OK if there are no IMPROVEMENTS or MUST fix items, you can just omit the lists. |
There was a problem hiding this comment.
Non-blocking feedback (2)
-
Overflow token sizing does not follow custom avatar dimensions — packages/jsx-email/src/components/avatar-group.tsx#L43-L47
Whenmaxtruncation is used with avatars sized differently than the 40px default, the+Ntoken is still rendered at defaultAvatarsize, which can make the group visually uneven.
Consider deriving the overflow tokenwidth/heightfrom rendered avatars (or exposing a small explicit sizing prop for the overflow token). -
Overflow token accessibility label is currently just
+N— packages/jsx-email/src/components/avatar-group.tsx#L43-L47
Because the overflow token only setsfallback, assistive tech will read a literal value like+2.
Consider passing a semanticname/alt(for example, "2 more") while keeping visual fallback text as+2.
If you'd like me to implement any of these, reply with item numbers (for example: please fix 1).
|
Completed a thorough review of this PR (diff, existing reviews/comments, and referenced context). I don’t see any blocking issues, so this looks ready to merge. MUST fix items IMPROVEMENTS
|
|
@CharlieHelps fix both improvements 1 and 2 |
|
@shellscape done — I fixed both improvements and pushed them to the PR branch.
Pushed commit: 7d47983 Validation run:
|
Component / Package Name:
packages/jsx-emailThis PR contains:
Are tests included?
Breaking Changes?
If yes, please include "BREAKING CHANGES:" in the first commit message body, followed by a description of what is breaking.
List any relevant issue numbers:
N/A
Description
Adds
AvatarandAvatarGroupcomponents forpackages/jsx-emailwith exports, tests, docs, and demo coverage.Implemented files include:
packages/jsx-email/src/components/avatar.tsxpackages/jsx-email/src/components/avatar-group.tsxpackages/jsx-email/src/index.tspackages/jsx-email/test/avatar.test.tsxpackages/jsx-email/test/avatar-group.test.tsxpackages/jsx-email/test/.snapshots/avatar.test.tsx.snappackages/jsx-email/test/.snapshots/avatar-group.test.tsx.snapdocs/components/avatar.mddocs/components/avatar-group.mdapps/web/src/content/docs/components/avatar.mdxapps/web/src/content/docs/components/avatar-group.mdxapps/demo/emails/vercel-invite-user.tsxChecks run:
moon run jsx-email:test✅ (48 files / 200 tests passed)Pre-existing unrelated TypeScript failure note:
Requirements checklist
packages/jsx-email/src/components/avatar.tsxwith the agreedAvatarAPI and defaults.packages/jsx-email/src/components/avatar-group.tsxwith safe-mode default rendering.fallbackText/initials/?).AvatarGrouptruncation with overflow token (+N).directionsupport (ltr/rtl) for group rendering order.AvatarandAvatarGroup(and related types) frompackages/jsx-email/src/index.ts.packages/jsx-email/test/avatar.test.tsxcoverage.packages/jsx-email/test/avatar-group.test.tsxcoverage.docs/components/*for both components.apps/web/src/content/docs/components/*for both components.apps/demo/emails/.next/v3using the repo PR template.react‑email.