AvatarStack: Add support for Tooltip on individual avatars#3776
AvatarStack: Add support for Tooltip on individual avatars#3776
Tooltip on individual avatars#3776Conversation
🦋 Changeset detectedLatest commit: 68d1d88 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
There was a problem hiding this comment.
Pull request overview
This PR adds support for individual tooltips on avatars within the AvatarStack component. The feature enables developers to provide non-essential contextual information for each avatar when used as a link, improving the user experience while maintaining accessibility standards.
Key Changes:
- Added
tooltipparameter to theAvatarcomponent that integrates with theLinkcomponent's tooltip functionality - Updated CSS to handle the DOM structure changes introduced by tooltip wrappers and added
:focus-withinsupport for keyboard accessibility - Added comprehensive test coverage and preview examples for the new tooltip functionality
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| app/components/primer/beta/avatar.rb | Added tooltip parameter and logic to render tooltips on linked avatars |
| app/components/primer/beta/avatar_stack.pcss | Added CSS rules to handle avatar visibility when wrapped in tooltip spans and improved keyboard navigation support |
| test/components/beta/avatar_stack_test.rb | Added test case verifying that individual tooltips render correctly on avatars |
| previews/primer/beta/avatar_stack_preview.rb | Added preview demonstrating avatars with individual tooltips |
| .changeset/gentle-donkeys-own.md | Added changeset documenting the new feature (contains a typo) |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
|
@jonrohan, could I get your review on this, as it requires a CSS reviewer? 🤔 |
Authors: Please fill out this form carefully and completely.
Reviewers: By approving this Pull Request you are approving the code change, as well as its deployment and mitigation plans.
Please read this description carefully. If you feel there is anything unclear or missing, please ask for updates.
What are you trying to accomplish?
Adds support to
Avatarfor tooltip. Can be used withinAvatarStackto render individual tooltips.Screenshots
Integration
N/A
List the issues that this change affects.
https://github.com/github/accessibility-audits/issues/12705
Risk Assessment
What approach did you choose and why?
Allows consumers to add individual tooltips to
AvatarStack.Accessibility
Merge checklist
Take a look at the What we look for in reviews section of the contributing guidelines for more information on how we review PRs.