Skip to content

docs(Layer, Popover): no top layer without the Popover API - #13714

Merged
cixzhang merged 3 commits into
meta:mainfrom
vjeux:docs/layer-fallback-boundary
Nov 24, 2026
Merged

cixzhang merged 3 commits into
meta:mainfrom
vjeux:docs/layer-fallback-boundary

Conversation

@vjeux

@vjeux vjeux commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

Reader impact

A builder who supports browsers without the Popover API reads the useLayer docs and relies on the top layer for stacking. The useLayer and Popover docs don't say that the reduced fallback has no top layer. In such a browser, content with a higher z-index can cover an open layer, and an ancestor can clip it. Nothing warns the builder. After this change, the useLayer and Popover docs and the browser support guide state this boundary.

Source of truth

  • AST-003 FR22: the reduced fallback is not required to reproduce native top-layer behavior.
  • AST-003 FR23: the useLayer, Popover, and relevant component docs distinguish full native behavior from reduced fallback behavior.
  • AST-013 FR7: a component in the reduced-fallback tier documents its reduced fallback, here in the browser support guide.
  • packages/core/src/Layer/useLayer.tsx: when showPopover is missing, the layer shows with display: block where it is rendered. Only fixed mode sets position: fixed, so an anchored layer stays in the page flow.

Correction

  • useLayer: the best practice that says to rely on the top layer gains a sentence. It reads: "Without the Popover API there is no top layer, and content with a higher z-index can cover the layer." It then names the ancestor that can clip the layer in each mode. The dense doc says the same.
  • Popover: a new "don't" entry says: "Assume an anchored popover rises above the page in a browser without the Popover API." It adds that the popover then stays in the page flow, where an ancestor that clips overflow can clip it. The entry is in the canonical and dense docs, and in English in the Chinese docs, like most of its neighbors there.
  • Browser support guide: the list of what Astryx does not guarantee adds top-layer stacking without the Popover API. It names the clip for an anchored layer and for a fixed-position layer.
  • The CLI's no-icon-set docs golden (packages/cli/test/__golden__/no-icon-set/docs-topics.json) takes the guide's new skeleton hash, written by the test's own --update.
  • A [docs] Changeset names @astryxdesign/core and @astryxdesign/cli.

Evidence

  • Each changed doc module loads, and its exports keep their shape.
  • The no-icon-set docs golden test passes. The clipping correction leaves its hash as it is.
  • Strict preflight passes at this head (see Testing).

Scope

Components: Layer, Popover

  • This PR changes documentation only, or names every necessary generated artifact.
  • Runtime, API, visual, and policy changes were removed or split.
  • Public text and artifacts contain no internal Meta context.

Testing

ASTRYX_STRICT_LINT=1 pnpm preflight passes at 351bf5c: review:pre, build, typecheck, lint, vitest ui, vitest node, knowledge, and changesets. Vitest node ran 1,781 test files, and 27,837 tests passed.

A browser without the Popover API shows a layer in place, with no top
layer. The useLayer and Popover docs and the browser support guide now
say so: content with a higher z-index, or a transformed ancestor, can
cover or clip the layer there.

The CLI's no-icon-set docs golden takes the guide's new skeleton hash.
@vercel

vercel Bot commented Nov 24, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
astryx Ready Ready Preview Nov 24, 2026 8:00am UTC

Request Review

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Nov 24, 2026
@astracat-bot

astracat-bot Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
🟢 Reviewed (for maintainers only) Nov 24, 2026, 8:11 AM UTC

@cixzhang

Copy link
Copy Markdown
Contributor

/approve-spec dbfaeeb

@cixzhang cixzhang added the ci:run A maintainer lets this outside contributor's pull request run CI (AST-030 FR17) label Nov 24, 2026
@github-actions

github-actions Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

PR Analysis Report

🔎 Preview · 351bf5c

Storybook · Sandbox · built from this PR's head

Modified components

Component Size LoC Visual · A11y · RTL
LayerProvider 4.4 kB (0) · 20 B CSS (0) — — · ✓ · —
Popover · Storybook 106.3 kB (0) · 15.5 kB CSS (0) 1,857 (0) — · ✓ · ✓

Package size:

  • @astryxdesign/cli 6.32 MB packed (+91 B); no new dependencies
  • @astryxdesign/core 8.01 MB packed (+427 B); no new dependencies

Touched components checked; for the full suites, add ci:run-visual for Visual, ci:run-a11y for Accessibility, ci:run-rtl for RTL.


Generated by PR Enrichment workflow | View full report

@astracat-bot astracat-bot Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Requesting changes for one wording fix: the new fallback sentence names the wrong thing that clips a layer in a browser without the Popover API.

  • Popover's layer, like any context-mode useLayer layer that sets no position of its own, gets no position from Astryx, so without the Popover API it opens as a static box in the page flow, where an ancestor with overflow hidden, auto or clip cuts it off and a transform on an ancestor does not; please name the overflow-clipping ancestor in the Popover, useLayer and browser support guide strings and in the changeset (keep the transformed ancestor only where fixed-mode layers are meant), and narrow the changeset's "say what a layer loses" to the top-layer loss it documents.

The inline comments suggest wording for each place. The direction itself, documenting the missing top layer, matches the layer spec's docs requirement. CI has not run on this head.

Claims and files checked

Review mode: full; reason: no-earlier-review

  • Claim (changeset): the docs say what a layer loses without the Popover API. Partly true: they state only the top-layer loss.
  • Claim (changeset and description): the layer opens in place, without the top layer. Verified: the fallback only sets display: block (useLayer.tsx, the showPopover branch).
  • Claim (changeset and description): a higher z-index or a transformed ancestor can cover or clip it. Partly false: for Popover's in-flow layer, an overflow-clipping ancestor clips it; a transform does not.
  • Claim (changeset): no behavior change. Verified: docs strings only.
  • Claim (description): before this change, the useLayer and Popover docs did not mention the missing top layer. Verified against the base.
  • Claim (description): the layer spec does not require the fallback to reproduce the top layer and requires the docs to distinguish it. Verified.
  • Claim (description): the browser support spec has components in the reduced-fallback tier document their fallback. Verified as a paraphrase; by the guide's own tier table, browsers without the Popover API sit below that tier.
  • Claim (description): without showPopover, the layer shows with display: block where it is rendered. Verified.
  • Claim (description): the useLayer canonical and dense texts, the Popover canonical, Chinese (in English, like most neighbors) and dense entries, and the guide line are added. Verified.
  • Claim (description): the golden diff is one line. Verified; the digest value was not recomputed here.
  • Claim (description): a docs changeset names @astryxdesign/core and @astryxdesign/cli. Verified.
  • Claim (description): each changed doc module loads and keeps its export shape; Popover's lists grow by one and useLayer's stay the same length. Verified by importing the modules.
  • Claim (description): the golden test and strict preflight pass. Not verified: CI has not run on this head.
  • Claim (description): docs only, no internal context. Verified.
  • File .changeset/layer-fallback-docs-boundary.md: finding (clip wording; "what a layer loses" is broader than what is documented).
  • File packages/cli/assets/docs/browser-support.doc.mjs: finding (clip wording); otherwise consistent with the guide's Tier 3.
  • File packages/cli/test/__golden__/no-icon-set/docs-topics.json: clear (one digest line for the changed topic).
  • File packages/core/src/Layer/useLayer.doc.mjs: finding (clip wording omits the overflow case for anchored layers).
  • File packages/core/src/Popover/Popover.doc.mjs: finding (clip wording is wrong for Popover's in-flow layer).

Automated review (maintainer link)

An anchored layer sets no position of its own, so without the Popover
API it stays in the page flow, and an ancestor that clips overflow
can clip it. Only a fixed-mode layer takes a transformed ancestor as
its containing block. The useLayer, Popover and browser support docs
and the changeset now name the right clip for each kind of layer.
@cixzhang

Copy link
Copy Markdown
Contributor

/approve-spec 4fbf09b

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Approved pending CI: CI has not run on this head yet because the pull request is a draft, and it runs once the pull request is marked ready for review (the ci:run label is already on it).

The earlier wording issue is fixed: the Popover, useLayer and browser support guide strings and the changeset now name an ancestor that clips overflow for an anchored layer and keep the transformed ancestor for a fixed-position layer, which matches what the fallback does.

  • Optional: the new Popover entry says the popover stays in the page flow without the Popover API, which holds for the anchored surface but not for presentation="bottom-sheet" (or adaptive on a compact touch screen), whose sheet opens as a modal dialog above the page; consider scoping the entry to the anchored popover (see the inline suggestion).
Claims and files checked

Review mode: incremental; reason: none

  • Changed rules (0): none.
  • Claim (changeset): the useLayer and Popover docs and the browser support guide say a layer has no top layer without the Popover API. Verified: all six new strings say so.
  • Claim (changeset): the layer opens in place, without the top layer. Verified: the fallback only sets display: block.
  • Claim (changeset): content with a higher z-index can cover it. Verified: with no top layer, page stacking applies.
  • Claim (changeset): a layer anchored to a trigger stays in the page flow, where an overflow-clipping ancestor can clip it. Verified: anchored layers get no position from Astryx.
  • Claim (changeset): a transformed ancestor can move and clip a fixed-position layer. Verified: fixed mode sets position: fixed, and a transformed ancestor becomes its containing block.
  • Claim (changeset): no behavior change. Verified: docs strings only.
  • Claim (changeset): patch releases of the core and CLI packages. Verified: those are the two packages whose files change.
  • Claim (description): before this change, the useLayer and Popover docs did not say the fallback has no top layer. Verified against the base.
  • Claim (description): without the Popover API, higher z-index content can cover an open layer and an ancestor can clip it. Verified.
  • Claim (description): the layer spec does not require the fallback to reproduce the top layer. Verified.
  • Claim (description): the layer spec requires the useLayer, Popover and relevant docs to distinguish the fallback. Verified.
  • Claim (description): the browser support spec has a component in the reduced-fallback tier document its fallback. Verified as a paraphrase; by the guide's own tier table, browsers without the Popover API sit below that tier.
  • Claim (description): without showPopover the layer shows with display: block, only fixed mode sets position: fixed, so an anchored layer stays in the page flow. Verified.
  • Claim (description): the useLayer best practice gains the no-top-layer sentence and names the clipping ancestor for each mode, and the dense doc says the same. Verified.
  • Claim (description): the Popover "don't" entry is in the canonical and dense docs, and in English in the Chinese docs like most of its neighbors. Verified (seven of the eight Chinese entries are in English).
  • Claim (description): the guide adds top-layer stacking to what is not guaranteed and names the clip for anchored and fixed-position layers. Verified.
  • Claim (description): the CLI docs golden takes the guide's new skeleton digest. Verified as a one-line change for that topic; the value itself was not recomputed.
  • Claim (description): a docs changeset names the core and CLI packages. Verified.
  • Claim (description): each changed doc module loads and keeps its export shape. Verified by importing them on the base and the head.
  • Claim (description): the golden docs test passes. Not verified: CI has not run on this head.
  • Claim (description): the clipping correction leaves the golden digest as it is. Verified: the digest covers structure, not prose, and that commit changes only prose.
  • Claim (description): strict preflight passed on the earlier commit and runs again on this head. Not verified: no result is posted and CI has not run on this head.
  • Claim (description): docs only, with no runtime, API, visual or policy change and no internal context. Verified.
  • File .changeset/layer-fallback-docs-boundary.md: clear.
  • File packages/cli/assets/docs/browser-support.doc.mjs: clear; consistent with the guide's tier table and its "does not crash" guarantee.
  • File packages/cli/test/__golden__/no-icon-set/docs-topics.json: clear (one digest line for the changed topic).
  • File packages/core/src/Layer/useLayer.doc.mjs: clear.
  • File packages/core/src/Popover/Popover.doc.mjs: non-blocking note (the bottom-sheet presentation does rise above the page).

Automated review (maintainer link)

A bottom-sheet presentation opens its sheet with showModal(), so it
still enters the top layer without the Popover API wherever <dialog>
works. The Popover entry about the reduced fallback now names the
anchored popover, so it stays true for every presentation.
@cixzhang

Copy link
Copy Markdown
Contributor

/approve-spec 351bf5c

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Approved pending CI: CI has not run on this head yet because the pull request is a draft, and it runs once the pull request is marked ready for review (the ci:run label is already on it).

The Popover entry now speaks of an anchored popover, which keeps it true for the bottom-sheet presentation, whose sheet opens as a modal dialog above the page. No other finding: every new sentence in the useLayer, Popover and browser support docs and the changeset matches what the fallback does.

Claims and files checked

Review mode: incremental; reason: none

  • Changed rules (0): none.
  • Claim (changeset): the useLayer and Popover docs and the browser support guide say a layer has no top layer without the Popover API. Verified: all six new strings and the guide item say so.
  • Claim (changeset): the layer then opens in place, without the top layer. Verified: the fallback only sets display: block (useLayer.tsx:1599).
  • Claim (changeset): content with a higher z-index can cover it. Verified: with no top layer, page stacking applies.
  • Claim (changeset): a layer anchored to a trigger stays in the page flow, where an ancestor that clips overflow can clip it. Verified: anchored layers get no position from Astryx (useLayer.tsx:2724-2782).
  • Claim (changeset): a transformed ancestor can move and clip a fixed-position layer. Verified: only fixed mode sets position: fixed (useLayer.tsx:136, :2834), and a transformed ancestor becomes its containing block.
  • Claim (changeset): no behavior change. Verified: docs strings, a release note and a test digest only.
  • Claim (changeset): patch releases of the core and CLI packages. Verified: those are the two packages whose files change.
  • Claim (description): before this change, the useLayer and Popover docs did not say the fallback has no top layer. Verified against the base.
  • Claim (description): without the Popover API, higher z-index content can cover an open layer and an ancestor can clip it, with no warning. Verified.
  • Claim (description): the layer spec does not require the fallback to reproduce the top layer. Verified.
  • Claim (description): the layer spec requires the useLayer, Popover and relevant docs to distinguish the fallback. Verified.
  • Claim (description): the browser support spec has a component in the reduced-fallback tier document its fallback. Verified as a paraphrase; by the guide's own tier table, browsers without the Popover API sit below that tier, so the layer spec is what requires this text.
  • Claim (description): without showPopover the layer shows with display: block where it is rendered, and only fixed mode sets position: fixed, so an anchored layer stays in the page flow. Verified.
  • Claim (description): the useLayer best practice gains the quoted sentence and names the clipping ancestor for each mode, and the dense doc says the same. Verified (useLayer.doc.mjs:109, :163).
  • Claim (description): Popover gains the quoted "don't" entry for an anchored popover, in the canonical and dense docs and in English in the Chinese docs like most of its neighbors. Verified (Popover.doc.mjs:254, :560, :482; six of its seven neighbors in the Chinese list are in English).
  • Claim (description): the guide adds top-layer stacking to what is not guaranteed and names the clip for an anchored and a fixed-position layer. Verified (browser-support.doc.mjs:141).
  • Claim (description): the CLI docs golden takes the guide's new skeleton digest, written by the test's own update. Verified as one digest line for that topic; the value itself was not recomputed.
  • Claim (description): a docs changeset names the core and CLI packages. Verified.
  • Claim (description): each changed doc module loads and keeps its export shape. Verified by reading: each edit adds a string or one entry shaped like its neighbors; the modules were not executed.
  • Claim (description): the golden docs test passes. Not verified: CI has not run on this head.
  • Claim (description): the clipping correction leaves the golden digest as it is. Verified: the digest covers structure, not prose, and later commits change only prose.
  • Claim (description): strict preflight passes at this head. Not verified: CI has not run on this head.
  • Claim (description): docs only, with no runtime, API, visual or policy change and no internal context. Verified.
  • File .changeset/layer-fallback-docs-boundary.md: clear.
  • File packages/cli/assets/docs/browser-support.doc.mjs: clear; consistent with the guide's tier table and its "does not crash" guarantee.
  • File packages/cli/test/__golden__/no-icon-set/docs-topics.json: clear (one digest line for the changed topic).
  • File packages/core/src/Layer/useLayer.doc.mjs: clear.
  • File packages/core/src/Popover/Popover.doc.mjs: clear; the entry now names the anchored popover, matching the bottom-sheet presentation's modal dialog.

Automated review (maintainer link)

@cixzhang
cixzhang marked this pull request as ready for review November 24, 2026 08:14

@cixzhang cixzhang left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Approving at 351bf5c (agent-made approval on behalf of the maintainer, after CodeBunny ✓, CI green and Specs ✓ at this exact head). Docs-only: AST-003 FR23 top-layer fallback wording.

@cixzhang
cixzhang merged commit 44ac32b into meta:main Nov 24, 2026
214 of 217 checks passed

This branch was successfully deployed

1 active deployment
Preview — 351bf5c7 Deployed Nov 24, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci:run A maintainer lets this outside contributor's pull request run CI (AST-030 FR17) CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants