Skip to content

fix(toast): refine stacked hover and focus styles#33620

Merged
lyzno1 merged 1 commit intomainfrom
fix/toast-stack-hover-focus
Mar 18, 2026
Merged

fix(toast): refine stacked hover and focus styles#33620
lyzno1 merged 1 commit intomainfrom
fix/toast-stack-hover-focus

Conversation

@lyzno1
Copy link
Copy Markdown
Member

@lyzno1 lyzno1 commented Mar 18, 2026

Summary

  • replace the stacked toast hover bridge DOM node with a CSS pseudo-element to match the official Base UI pattern
  • keep the symmetric stacked toast alignment while simplifying the API
  • align toast root focus treatment with the card radius using an explicit ring instead of relying on the browser default outline

Testing

  • pnpm test -- app/components/base/ui/toast/tests/index.spec.tsx

@lyzno1 lyzno1 requested a review from iamjoel as a code owner March 18, 2026 01:50
Copilot AI review requested due to automatic review settings March 18, 2026 01:50
@lyzno1 lyzno1 requested a review from zxhlyh as a code owner March 18, 2026 01:50
@github-actions github-actions bot added the web This relates to changes on the web. label Mar 18, 2026
@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request refines the visual presentation and accessibility of stacked toast components. It modernizes the hover bridge implementation using CSS pseudo-elements, simplifies the component's API, and enhances focus visibility with custom ring styles, ensuring a more consistent and accessible user experience.

Highlights

  • Hover Bridge Implementation: Replaced the DOM-based hover bridge for stacked toasts with a CSS pseudo-element, aligning with the official Base UI pattern.
  • API Simplification: Simplified the API by removing the showHoverBridge prop, while maintaining symmetric stacked toast alignment.
  • Focus Styles: Aligned the toast root's focus treatment with the card radius by implementing an explicit ring, moving away from reliance on default browser outlines.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@dosubot dosubot bot added the size:S This PR changes 10-29 lines, ignoring generated files. label Mar 18, 2026
@lyzno1 lyzno1 changed the title Refine stacked toast hover and focus styles fix(toast): refine stacked hover and focus styles Mar 18, 2026
Copy link
Copy Markdown
Contributor

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 refines the stacked toast interaction styling to better match the Base UI pattern, including replacing the hover “bridge” element with a CSS pseudo-element and updating focus-visible styling to use an explicit ring aligned with the toast/card radius.

Changes:

  • Replace the stacked toast “hover bridge” DOM node with an ::after pseudo-element hit-area.
  • Simplify ToastCard/ToastViewport by removing the showHoverBridge prop and index-based mapping.
  • Update toast root focus-visible styling to use an explicit ring and rounded radius.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request effectively refactors the stacked toast component by replacing the hover bridge DOM node with a more efficient CSS pseudo-element and improving focus styles. The API is also simplified by removing the showHoverBridge prop. I've added one suggestion to refine the new hover bridge behavior to more closely match the previous implementation by hiding it on the last toast in the stack. Overall, these are solid improvements to the component's maintainability and accessibility.

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Mar 18, 2026
@lyzno1 lyzno1 merged commit a073d60 into main Mar 18, 2026
25 of 26 checks passed
@lyzno1 lyzno1 deleted the fix/toast-stack-hover-focus branch March 18, 2026 02:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lgtm This PR has been approved by a maintainer size:S This PR changes 10-29 lines, ignoring generated files. web This relates to changes on the web.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants