Repository navigation
docs(Layer, Popover): no top layer without the Popover API - #13714
Conversation
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.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
|
/approve-spec dbfaeeb |
PR Analysis Report🔎 Preview ·
|
| 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
There was a problem hiding this comment.
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
useLayerlayer that sets no position of its own, gets nopositionfrom Astryx, so without thePopoverAPI it opens as a static box in the page flow, where an ancestor withoverflowhidden, auto or clip cuts it off and a transform on an ancestor does not; please name the overflow-clipping ancestor in the Popover,useLayerand 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
PopoverAPI. 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, theshowPopoverbranch). - Claim (changeset and description): a higher
z-indexor 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
useLayerand 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
PopoverAPI sit below that tier. - Claim (description): without
showPopover, the layer shows withdisplay: blockwhere it is rendered. Verified. - Claim (description): the
useLayercanonical 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/coreand@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).
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.
|
/approve-spec 4fbf09b |
There was a problem hiding this comment.
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
PopoverAPI, which holds for the anchored surface but not forpresentation="bottom-sheet"(oradaptiveon 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
useLayerand Popover docs and the browser support guide say a layer has no top layer without thePopoverAPI. 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-indexcan 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
positionfrom 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
useLayerand Popover docs did not say the fallback has no top layer. Verified against the base. - Claim (description): without the
PopoverAPI, higherz-indexcontent 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
PopoverAPI sit below that tier. - Claim (description): without
showPopoverthe layer shows withdisplay: block, only fixed mode setsposition: fixed, so an anchored layer stays in the page flow. Verified. - Claim (description): the
useLayerbest 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).
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.
|
/approve-spec 351bf5c |
There was a problem hiding this comment.
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
useLayerand Popover docs and the browser support guide say a layer has no top layer without thePopoverAPI. 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-indexcan 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
positionfrom 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
useLayerand Popover docs did not say the fallback has no top layer. Verified against the base. - Claim (description): without the
PopoverAPI, higherz-indexcontent 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
PopoverAPI sit below that tier, so the layer spec is what requires this text. - Claim (description): without
showPopoverthe layer shows withdisplay: blockwhere it is rendered, and only fixed mode setsposition: fixed, so an anchored layer stays in the page flow. Verified. - Claim (description): the
useLayerbest 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.
Reader impact
A builder who supports browsers without the
PopoverAPI reads theuseLayerdocs and relies on the top layer for stacking. TheuseLayerandPopoverdocs don't say that the reduced fallback has no top layer. In such a browser, content with a higherz-indexcan cover an open layer, and an ancestor can clip it. Nothing warns the builder. After this change, theuseLayerandPopoverdocs and the browser support guide state this boundary.Source of truth
useLayer, Popover, and relevant component docs distinguish full native behavior from reduced fallback behavior.packages/core/src/Layer/useLayer.tsx: whenshowPopoveris missing, the layer shows withdisplay: blockwhere it is rendered. Only fixed mode setsposition: 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 higherz-indexcan 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.PopoverAPI. It names the clip for an anchored layer and for a fixed-position layer.packages/cli/test/__golden__/no-icon-set/docs-topics.json) takes the guide's new skeleton hash, written by the test's own--update.[docs]Changeset names@astryxdesign/coreand@astryxdesign/cli.Evidence
Scope
Components: Layer, Popover
Testing
ASTRYX_STRICT_LINT=1 pnpm preflightpasses 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.