Repository navigation
Conversation
The anatomy claimed a scroll-driven scale effect that does not exist, and hasButtons was described as hover-triggered and desktop-only. The buttons are actually driven by per-edge overflow: each appears when the content can scroll in that direction. Descriptions now mirror the component JSDoc. The docsZh usage block was still in English; translate it in the same style as the other component translations.
…ement Layers rendered through useLayer expose data-state="open|closed" on the popover container, mirroring the Popover API toggle-state naming. Open/closed can now be asserted from stable attributes in environments without a layout/Popover engine (jsdom), instead of only via :popover-open in full browsers. Covers the data-state follow-up deferred from meta#3240 (role="tooltip" shipped in meta#3243).
|
@arham766 is attempting to deploy a commit to the Meta Open Source Team on Vercel. A member of the Team first needs to authorize it. |
cixzhang
left a comment
There was a problem hiding this comment.
Hey @arham766, thanks for working on this. Unfortunately I had to mark the main issue as "needs scoping" since I want to explore options for HoverCard accessibility + testing a bit more. The carousel doc updates here seem okay though. Mind breaking out the PR just for that?
|
Makes sense — happy to wait for the re-scope on the HoverCard side. Good news on the carousel docs: they're already broken out — this branch was stacked on #3532, and the Closing this one; I'll pick the |
Summary
Implements the
data-state="open|closed"follow-up deferred from #3240 (option 2 in the issue;role="tooltip"already shipped in #3243).Every layer rendered through
useLayer— Tooltip, HoverCard, Popover, ContextMenu, Tokenizer overflow, keyboard hints — now reflects its open state as adata-stateattribute on the popover container, in both context and fixed modes. Values mirror the Popover API's ownToggleEvent.newStatenaming (open/closed).Why on
useLayerrather than per component: the attribute stays consistent across every current and future layer consumer, and browser-initiated closes (light dismiss / popover stack eviction) already flow back through the existingtoggle-event reconciliation, so the attribute stays in sync with the DOM for free.Per @Daniel15's note in the issue, this deliberately does not add
data-testidforwarding.Test plan
closed → open → closedacross hover show/hide; HoverCard flipsclosed → open(both viagetByRole+toHaveAttribute, running in jsdom — which is exactly the environment the issue says cannot observe:popover-open)pnpm -F @astryxdesign/core run typecheckand eslint on touched files — clean