Repository navigation
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 23 minutes. View limit details
No actionable comments were generated in the recent review.
|
commit: |
fe3b858 to
7261fdc
Compare
- Build the manager and hook methods with one wrap function. The hook finds the anchored manager through the stacked store, so ToastManagerContext is removed. - Render the anchored provider first, so hook adds in mount effects reach it. - Drop positionerProps from stacked toasts, so anchor: null keeps swipe. - Label the anchored viewport "Anchored notifications", so there is one "Notifications" region. - Hide anchored toasts over the limit or with a hidden anchor, and show newer ones on top. - Document the routing rules and fix the Popover sideOffset playground default.
- Keep the anchored Base UI manager on the toast manager under a symbol key, and put the manager in ToastManagerContext. - useToastManager reads the context instead of a WeakMap link that Toast.Provider wrote during render. - StackedToasts no longer has to render before children.
Summary
Add anchored toasts.
toastManager.add({ title: 'Copied', positionerProps: { anchor: el } })shows the toast next toelwith an arrow. Toasts without an anchor stay in the corner stack as before.Add
showArrowtoPopover.Content(off by default). The arrow uses Tooltip's arrow styles, which move toshared/arrowso Tooltip, Popover, and Toast share one copy.Add data-slots
toast-anchored-viewport,toast-positioner,toast-arrow, andpopover-arrow, with tests and docs.Why it's like this: Toast moved to Base UI in Mar 2026 (feat: migrate Toast to Base UI #671) and only the corner toasts were ported. Base UI needs anchored toasts in a separate provider. Each Apsara manager now holds a second, internal Base UI manager, and
Toast.Providerrenders a second provider for it.addroutes bypositionerProps.anchor, andcloseandupdatego to both. This keeps onetoastManagerand oneuseToastManager(), and uses Base UI's ownpositionerPropsoption. The hook'stoastslist holds stacked toasts only. Popover's Base UI port only ported the panel it had, which never had an arrow.Breaking: no.
toastManager,useToastManager(), andcreateToastManager()keep their signatures and behavior for toasts without an anchor.I have followed the pull request section of the contributing guide.