Skip to content

Conversation

TylerJDev
Copy link
Member

@TylerJDev TylerJDev commented Sep 9, 2025

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?

Addresses https://github.com/github/accessibility-audits/issues/12705

Ensures AvatarStack is utilizing modern Tooltip component

Integration

No

List the issues that this change affects.

https://github.com/github/accessibility-audits/issues/12705

Risk Assessment

  • Low risk the change is small, highly observable, and easily rolled back.
  • Medium risk changes that are isolated, reduced in scope or could impact few users. The change will not impact library availability.
  • High risk changes are those that could impact customers and SLOs, low or no test coverage, low observability, or slow to rollback.

What approach did you choose and why?

Replaces old CSS Tooltip with PVC `Tooltip.

Merge checklist

  • Added/updated tests
  • Added/updated documentation
  • Added/updated previews (Lookbook)
  • Tested in Chrome
  • Tested in Firefox
  • Tested in Safari
  • Tested in Edge

Take a look at the What we look for in reviews section of the contributing guidelines for more information on how we review PRs.

Copy link

changeset-bot bot commented Sep 9, 2025

🦋 Changeset detected

Latest commit: d6e09a3

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@primer/view-components Minor

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

)

@body_arguments[:tabindex] = tooltipped ? 0 : nil
@body_arguments[:id] = tooltipped ? @body_arguments[:id] ||= self.class.generate_id : nil
Copy link
Member

Choose a reason for hiding this comment

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

is this deleting the supplied id if not tooltipped? 🤔

Copy link
Member Author

Choose a reason for hiding this comment

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

Good call! We can add @body_arguments[:id] and the end of the ternary instead.

@TylerJDev TylerJDev marked this pull request as ready for review September 22, 2025 15:40
@TylerJDev TylerJDev requested a review from a team as a code owner September 22, 2025 15:40
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR modernizes the tooltip implementation in the AvatarStack component by replacing the deprecated Primer::Tooltip with the modern Primer::Alpha::Tooltip component.

Key changes:

  • Refactored tooltip logic to use Primer::Alpha::Tooltip instead of the deprecated tooltip wrapper
  • Updated component initialization to properly configure tooltip arguments and accessibility attributes
  • Modified the component template to render the tooltip as a separate component

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
app/components/primer/beta/avatar_stack.rb Refactored tooltip implementation to use modern Alpha::Tooltip component
app/components/primer/beta/avatar_stack.html.erb Added conditional rendering of the new tooltip component
test/components/beta/avatar_stack_test.rb Updated test selector to remove deprecated tooltip class reference
previews/primer/beta/avatar_stack_preview.rb Added href attributes to avatar examples for testing tooltip functionality
.changeset/blue-phones-boil.md Added changeset documentation for the tooltip modernization

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@body_arguments[:aria] ||= {}
@body_arguments[:aria][:label] = tooltipped && @body_arguments[:label].present? ? @body_arguments[:label] : nil


Copy link
Preview

Copilot AI Sep 22, 2025

Choose a reason for hiding this comment

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

[nitpick] Remove the extra blank line to maintain consistent code formatting.

Suggested change

Copilot uses AI. Check for mistakes.

TylerJDev and others added 2 commits September 22, 2025 11:42
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@TylerJDev TylerJDev added this pull request to the merge queue Sep 22, 2025
Merged via the queue into main with commit 263b185 Sep 22, 2025
28 checks passed
@TylerJDev TylerJDev deleted the fix-tooltip-avatar-stack branch September 22, 2025 20:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants