Skip to content

docs(layer-runtime): a closed dialog that renders, for presses and focus - #11894

Merged
cixzhang merged 2 commits into
meta:mainfrom
vjeux:docs/layer-runtime-closed-dialog-press-focus
Nov 20, 2026
Merged

cixzhang merged 2 commits into
meta:mainfrom
vjeux:docs/layer-runtime-closed-dialog-press-focus

Conversation

@vjeux

@vjeux vjeux commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

Reader impact

architecture:layer-runtime says that a layer anchored in a closed <dialog> that renders opens after the next commit. A reader then expects a layer that a press opens to open late, with its focus after the press. The runtime opens it within the press. The record also says nothing about focus inside such a dialog.

Source of truth

Correction

The closed-dialog sentence gains a clause: a press opens the layer at once. A new sentence follows it: focus containment counts the focusable content of a closed <dialog> that renders. The rest of the sentence keeps its meaning.

Evidence

Scope

Components: Layer (record only)

  • 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.

Writing rubric results

R1 narration: none. The sentence states what the runtime does, in the present tense.
R2 research: none in the record.
R3 evidence: no evidence cell changed.
R4 rejected alternatives: none.
R5 change references: none.
R6 open questions: none.
R7 project status: none.

Testing

pnpm check:knowledge and Prettier pass at 7b4606b, which sits on main with #11892.

@vercel

vercel Bot commented Nov 15, 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 20, 2026 5:43pm UTC

Request Review

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

astracat-bot Bot commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
🟢 Reviewed (for maintainers only) Nov 20, 2026, 5:42 PM UTC

@github-actions github-actions Bot added the needs:spec-owner-review Current knowledge records await owner approval label Nov 15, 2026
@cixzhang

Copy link
Copy Markdown
Contributor

/approve-spec 62d600a

@github-actions

github-actions Bot commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

PR Analysis Report

🔎 Preview · c80626a

Storybook · Sandbox · built from this PR's head

Package size: no published package changed; no new dependencies.

Not run on this PR: add ci:run-visual for Visual, ci:run-rtl for RTL.


Generated by PR Enrichment workflow | View full report

@github-actions github-actions Bot removed the needs:spec-owner-review Current knowledge records await owner approval label Nov 15, 2026

@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.

Changes requested. The new focus-containment clause describes keyboard behavior that main does not have yet.

  • The clause "its focusable content counts for focus containment" (docs/architecture/layer-runtime.md:132-133) is not true at this head, because the focus trap still treats every control in a closed <dialog> as hidden (packages/core/src/hooks/useFocusTrap.ts:98-109), the record states that it describes the runtime shipped on main (layer-runtime.md:96-99), and the cited isDisplayedWhileClosed and focusInClosedDialog.a11y.browser.spec.ts exist only in the open draft #11892, so land #11892 first and rebase (citing the helper in utils/dialogDisplay.ts, which useFocusTrap.ts reads), or move the clause into #11892.

The press clause matches the runtime, and an engineering owner has approved the record text for this head. Optional: "its" can read as the layer or as the dialog, so a separate sentence ("Focus containment counts the focusable content of a closed <dialog> that renders.") removes the ambiguity.

Claims and files checked

Review mode: same-head; reason: none

  • changed rules (1): Whatever the scope, these are computed over the whole pull request at the issued head; checked: both recipe versions and docs/architecture/layer-runtime.md, no finding.
  • Claim: the record said such a layer opens after the next commit. Verified: the record at the base, lines 130-132.
  • Claim: the runtime opens a layer that a press opens within the press. Verified: useLayer.tsx:1854-1879, and sharedResizeObserver.ts:97-100 calls back synchronously on registration.
  • Claim: the record said nothing about focus in such a dialog. Verified: the record at the base.
  • Claim: the earlier Layer fix makes a press decide in its own task, in show(). Verified: useLayer.tsx:1770-1916.
  • Claim: the focus-trap fix counts a displayed closed dialog's controls through isDisplayedWhileClosed in useLayer.tsx. False at this head: useFocusTrap.ts:98-109 hides those controls, and the open draft #11892 puts the helper in utils/dialogDisplay.ts.
  • Claim: the owners wrote both clauses. Not provable from the repository; an engineering owner approved the text for this head.
  • Claim: two clauses are added and the rest keeps its meaning. Verified: the diff.
  • Claim: a click opens the Popover with its field focused within the click, in Chromium and WebKit. Verified: anchorReadiness.a11y.browser.spec.ts:233-271, which playwright.config.ts:94-97 runs in both engines.
  • Claim: Tab and Shift+Tab wrap inside that Popover, from focusInClosedDialog.a11y.browser.spec.ts. False at this head: the file is not in the tree.
  • Claim: only the record changes, with no runtime, API, visual or policy change. Verified: the diff.
  • Claim: the public text holds no internal context. Verified: the added lines, title, description and commit message.
  • Claim: rubric R1, the sentence states what the runtime does. False for the focus clause. R2 to R7 report none. Verified: the added lines.
  • Claim: pnpm check:knowledge and Prettier pass. Verified: rerun at this head.
  • File docs/architecture/layer-runtime.md: one blocking finding (the focus clause) and one wording suggestion.

Automated review (maintainer link)

Comment thread docs/architecture/layer-runtime.md Resolved
@cixzhang cixzhang added ci:run A maintainer lets this outside contributor's pull request run CI (AST-030 FR17) ci:run-a11y Run the accessibility suite on this PR; write access, next push (AST-030 FR12) labels Nov 15, 2026
The closed-dialog sentence now says what the runtime does for a press.
The decision's commit runs within the press, so the layer opens at
once. Any other show() opens after the next commit.

It also says that focus containment counts the focusable content of a
closed dialog that renders, as the owners decided for the focus-trap
fix.
@vjeux
vjeux force-pushed the docs/layer-runtime-closed-dialog-press-focus branch from 62d600a to 7b4606b Compare November 15, 2026 19:21
@github-actions github-actions Bot added the needs:spec-owner-review Current knowledge records await owner approval label Nov 15, 2026
@cixzhang

Copy link
Copy Markdown
Contributor

/approve-spec 7b4606b

@github-actions github-actions Bot removed the needs:spec-owner-review Current knowledge records await owner approval label Nov 15, 2026

@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 still a draft; it runs once the pull request is marked ready for review.

The earlier requested change is resolved: with #11892 on main, the focus trap counts the controls of a closed <dialog> the page displays (packages/core/src/hooks/useFocusTrap.ts:96), so the new focus sentence states what the runtime does, and the press clause matches packages/core/src/Layer/useLayer.tsx:1844-1868. An engineering owner approved the record text for this head.

Claims and files checked

Review mode: full; reason: rebase

  • Claim: the record said such a layer opens after the next commit. Verified: the record on main, docs/architecture/layer-runtime.md:130-132.
  • Claim: the runtime opens the layer within the press. Verified: packages/core/src/Layer/useLayer.tsx:1844-1868 and anchorReadiness.a11y.browser.spec.ts:233-271.
  • Claim: the record said nothing about focus inside such a dialog. Verified: no such sentence on main.
  • Claim: #11864 makes a press decide in its own task, in show(). Verified: merged; useLayer.tsx:1844-1868.
  • Claim: #11892 makes the focus trap count the controls of a closed dialog that has a box, through isDisplayedWhileClosed in utils/nodeType.ts. Verified: merged; packages/core/src/utils/nodeType.ts:75-76, useFocusTrap.ts:96.
  • Claim: the owners decided both points. Verified: an engineering owner's spec approval for this head.
  • Claim: the sentence gains a press clause and a separate focus sentence, and the rest keeps its meaning. Verified: the diff.
  • Claim: a click in a displayed closed dialog opens the Popover with its field focused within the click, in Chromium and WebKit. Verified: anchorReadiness.a11y.browser.spec.ts:233-271, playwright.config.ts:93-97.
  • Claim: Tab and Shift+Tab wrap inside such a Popover, in Chromium and WebKit. Verified: focusInClosedDialog.a11y.browser.spec.ts:46-77.
  • Claim: documentation only, with no runtime, API, visual or policy change and no internal context. Verified: one Markdown record changes.
  • Claim: the writing rubric results R1 to R7. Verified against the added lines.
  • Claim: the knowledge check and Prettier pass at this head, which sits on main with #11892. Verified: both pass.
  • File docs/architecture/layer-runtime.md: clear.

Automated review (maintainer link)

@github-actions github-actions Bot added the needs:spec-owner-review Current knowledge records await owner approval label Nov 20, 2026
@cixzhang

Copy link
Copy Markdown
Contributor

/approve-spec c80626a

@github-actions github-actions Bot removed the needs:spec-owner-review Current knowledge records await owner approval label Nov 20, 2026

@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 because the pull request is still a draft; it runs once the pull request is marked ready for review.

The merge of main leaves the edited paragraph as it was, and both statements still describe what main does: the press clause matches packages/core/src/Layer/useLayer.tsx:1962-1987, and the focus sentence matches the focus trap's reachability test in packages/core/src/hooks/focusableSelector.ts:78-87. An engineering owner approved the record text for this head.

Claims and files checked

Review mode: full; reason: merge-touches-pr-files

  • Claim: the record said such a layer opens after the next commit. Verified: the record on main, docs/architecture/layer-runtime.md:131-133.
  • Claim: the runtime opens the layer within the press. Verified: packages/core/src/Layer/useLayer.tsx:1962-1987 and anchorReadiness.a11y.browser.spec.ts:233-271.
  • Claim: the record said nothing about focus inside such a dialog. Verified: no such sentence on main.
  • Claim: #11864 makes a press decide in its own task, in show(). Verified: merged; useLayer.tsx:1869-2035.
  • Claim: #11892 makes the focus trap count the controls of a closed dialog that has a box, through isDisplayedWhileClosed in utils/nodeType.ts. Verified: merged; packages/core/src/utils/nodeType.ts:85-86, used by packages/core/src/hooks/focusableSelector.ts:85, which the trap calls.
  • Claim: the owners decided both points. Verified: an engineering owner's spec approval for this head.
  • Claim: the sentence gains a press clause and a separate focus sentence, and the rest keeps its meaning. Verified: the diff.
  • Claim: a click in a displayed closed dialog opens the Popover with its field focused within the click, in Chromium and WebKit. Verified: anchorReadiness.a11y.browser.spec.ts:233-271, playwright.config.ts:94-97.
  • Claim: Tab and Shift+Tab wrap inside that Popover, in Chromium and WebKit. Verified: focusInClosedDialog.a11y.browser.spec.ts:48-77.
  • Claim: documentation only, with no runtime, API, visual or policy change and no internal context. Verified: one Markdown record changes.
  • Claim: the writing rubric results R1 to R7. Verified against the added lines.
  • Claim: the knowledge check and Prettier pass on an earlier commit that sits on main with #11892. Verified: both also pass at this head.
  • File docs/architecture/layer-runtime.md: clear.

Automated review (maintainer link)

@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.

Engineering-owner approval at this exact head (c80626a), posted by Cindy's agent on her instruction. CodeBunny approves at this head and CI is green.

@cixzhang
cixzhang merged commit d7e2f1e into meta:main Nov 20, 2026
197 of 200 checks passed
@vjeux
vjeux deleted the docs/layer-runtime-closed-dialog-press-focus branch November 21, 2026 00:00

This branch was successfully deployed

1 active deployment
Preview — c80626a0 Deployed Nov 20, 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) ci:run-a11y Run the accessibility suite on this PR; write access, next push (AST-030 FR12) 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