Skip to content

docs(spec): page shortcuts stop at the topmost layer; nested overlays render through a Core layer - #10095

Draft
cixzhang wants to merge 3 commits into
mainfrom
spec/layer-stack-delta
Draft

cixzhang wants to merge 3 commits into
mainfrom
spec/layer-stack-delta

Conversation

@cixzhang

@cixzhang cixzhang commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

Summary

A person inside a dialog presses ⌘F and the page's search opens behind it. An app's own picker opened from a dialog appears but cannot be clicked. The shared dismissal stack already sends Escape, platform close, and outside presses to the topmost layer. This draft extends the same rule to page shortcuts, and states how an overlay nested in a modal renders.

Spec explainer (human view): kept internally with the owner review.

Owner decisions (draft until decided)

  1. Page shortcuts while a layer is open (family:overlay-dismissal FR12, DEC-3, decider pending). Recommended A: a useHotkeys shortcut fires only in the layer that registered it. Alternatives: B, suppress only while a modal is open; C, an opt-in option.
  2. Overlays nested in a modal (architecture:layer-runtime, browser hosts). Recommended A: render through a Core layer; an app body portal is inert by platform design, and no public API is added. Alternative B: export the modal's portal target.

Current-state impact

  • family:overlay-dismissal: new FR12, a verification row, a content-boundary line, DEC-3 (pending), and useHotkeys.test.ts in verified_by. FR1–FR11 are unchanged.
  • architecture:layer-runtime: one paragraph under "Browser hosts and corrective portals". No invariant changes.
  • No code changes. No open pull request claims these lines.

Not in this PR

Related reports that existing records already decide, or that are separate questions, are routed separately (defects, existing cards, and one RFC).

Numbering note: family:overlay-dismissal DEC-3 is taken by the returning-focus decision (#12360); this record takes the next free number (DEC-4) when it is next refreshed.

@vercel

vercel Bot commented Nov 5, 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 22, 2026 1:49pm UTC

Request Review

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

astracat-bot Bot commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
❓ Needs maintainer input (for maintainers only) Nov 22, 2026, 1:51 PM UTC

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

github-actions Bot commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

PR Analysis Report

Current run: The current CI run concluded skipped. Current analysis is unavailable.


Generated by PR Enrichment workflow | View current CI run

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

This pull request needs a maintainer check before review continues.

[Automated review]

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

This spec pull request waits on an engineering owner's decision, and it needs changes before approval whatever that decision is.

FR12, DEC-3, the FR12 verification row and the content-boundary line in family:overlay-dismissal, and the new nested-overlay paragraph in architecture:layer-runtime, add direction that no current record states. An engineering owner records the decision by commenting /approve-spec <full head SHA> on this pull request; the author may do so as an engineering owner.

Blocking findings:

  • FR12 reads as shipped behavior in a current record, and its verification row names useHotkeys.test.ts and a browser check that do not cover it, so label it as a gap the way the FR8 and FR9 rows are labelled.
  • FR12 and DEC-3 replace the documented window-wide useHotkeys behavior with no release class or migration, which spec:AST-017 FR1, FR3, FR5 and FR31 require for a change to a released contract.
  • The description has no ## Writing rubric results section, which every pull request that changes a record must report, and DEC-3 narrates the change ("Today … now fires") instead of stating the system.
  • FR12 is not routed to packages/core/src/hooks/useHotkeys.ts, so pnpm specs:for on the hook never shows the rule (architecture:knowledge-contracts INV26).

Smaller, non-blocking points: FR12 cites FR5 for keys other than Escape, "each document separately" implies a per-document listener, and DEC-3 can name its decider once the decision lands.

Claims and files checked

Review mode: full; reason: spec-record

  • Claim: a page shortcut fires behind an open dialog today: verified (useHotkeys.ts:185 listens on the window and checks no layer).
  • Claim: an app's own picker opened from a dialog cannot be clicked: verified (the layer runtime record states that a native modal makes outside content inert).
  • Claim: the shared stack already sends Escape, platform close and outside presses to the topmost layer: partly accurate; Escape and platform close go through the stack (FR2, FR3), and the outside press reaches only the topmost surface (FR11) through a separate per-document close count.
  • Claim: owner decision 1 is FR12 and DEC-3 with the decider pending: verified (overlay-dismissal.md:248-257, :372-385).
  • Claim: owner decision 2 renders nested overlays through a Core layer and adds no public API: verified (layer-runtime.md:134-140; records only).
  • Claim: the family record gains FR12, a verification row, a boundary line, DEC-3 and a verified_by entry, and FR1 to FR11 are unchanged: verified (diff).
  • Claim: one layer runtime paragraph under "Browser hosts and corrective portals" and no invariant changes: verified.
  • Claim: no code changes: verified (two Markdown records).
  • Claim: no open pull request claims these lines: verified as far as search reaches (no other open pull request mentions useHotkeys).
  • Claim: an explainer accompanies the owner review, and related reports are routed separately: outside the repository, not checked.
  • File docs/families/overlay-dismissal.md: the four blocking findings above.
  • File docs/architecture/layer-runtime.md: held for the owner decision; its facts match the current record, and the merge conflict resolution keeps the paragraph under "Browser hosts and corrective portals".

Automated review (maintainer link)

that closes only the layer leaves focus inside the host: where the closed
layer returns it, or else on the host itself. The rule is the same for a
mouse, a pen, and a finger.
- **FR12 — Page shortcuts stop at the topmost layer.** A `useHotkeys`

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.

FR12 reads as shipped, but useHotkeys.ts still fires every shortcut from one window listener. Add a gap line in the record's gap form, for example "FR12 gap: useHotkeys fires every shortcut from one window listener whatever layer holds focus", and route the hook to FR12 (a path-applicability:v1 block or a concern naming useHotkeys), so pnpm specs:for on the hook shows the rule.

Comment thread docs/families/overlay-dismissal.md Resolved
Comment on lines +377 to +380
dialog. Today every `useHotkeys` shortcut listens on the window, so a page
shortcut such as Cmd-F fires behind an open dialog. A shortcut now fires only
in the layer that registered it (FR12). It reuses the shared stack's topmost
rule, so it adds no public option.

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.

This narrates the change ("Today … now fires") and turns false once it ships; state the system instead, for example: "A page shortcut that fires behind an open layer acts on content the person cannot see or reach, so a shortcut fires only in the layer that registered it (FR12)." DEC-3 also needs the release class and migration for released useHotkeys callers (spec:AST-017 FR1, FR3, FR5, FR31).

…pr10095-m

# Conflicts:
#	docs/families/overlay-dismissal.md

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

This spec pull request waits on an engineering owner's decision, and it needs changes before approval whatever that decision is.

FR12, DEC-3, the FR12 verification row and the content-boundary line in family:overlay-dismissal, and the new nested-overlay paragraph in architecture:layer-runtime, add direction that no current record states. An engineering owner records the decision by commenting /approve-spec <full head SHA> on this pull request; the author may do so as an engineering owner.

Blocking findings:

  • FR12 reads as shipped behavior in a current record, and its verification row names useHotkeys.test.ts and a browser check that do not cover it, so add an FR12 gap: line beside the record's other gap lines and label the row as a gap the way the FR8 and FR9 rows are labelled.
  • FR12 and DEC-3 replace the documented window-wide useHotkeys behavior with no release class or migration, which spec:AST-017 FR1, FR3, FR5 and FR31 require for a change to a released contract.
  • The description has no ## Writing rubric results section, which every pull request that changes a record must report, and DEC-3 narrates the change ("Today … now fires") instead of stating the system.
  • FR12 is not routed to packages/core/src/hooks/useHotkeys.ts, so pnpm specs:for on the hook never shows the rule (architecture:knowledge-contracts INV26).

Smaller, non-blocking points: FR12 cites FR5 for keys other than Escape, "each document separately" implies a per-document listener, and DEC-3 can name its decider once the decision lands.

Claims and files checked

Review mode: full; reason: spec-record

  • Claim: a page shortcut fires behind an open dialog today: verified (useHotkeys.ts:254 listens on the window and checks no layer).
  • Claim: an app's own picker opened from a dialog cannot be clicked: verified (the layer runtime record states that a native modal makes outside content inert).
  • Claim: the shared stack already sends Escape, platform close and outside presses to the topmost layer: partly accurate; Escape and platform close go through the stack, and the outside press reaches only the topmost surface through a separate path.
  • Claim: owner decision 1 is the new shortcut requirement and its decision, with the decider pending: verified (overlay-dismissal.md:259-268, :393-406).
  • Claim: owner decision 2 renders nested overlays through a Core layer and adds no public API: verified (layer-runtime.md:138-144; records only).
  • Claim: the family record gains the requirement, a verification row, a boundary line, the decision and a verified_by entry, and its earlier requirements are unchanged: verified (diff).
  • Claim: one layer runtime paragraph under "Browser hosts and corrective portals" and no invariant changes: verified.
  • Claim: no code changes: verified (two Markdown records).
  • Claim: no open pull request claims these lines: verified as far as search reaches (other open pull requests that edit the family record add a different decision and do not touch these lines).
  • Claim: an explainer accompanies the owner review, and related reports are routed separately: outside the repository, not checked.
  • File docs/families/overlay-dismissal.md: the four blocking findings above.
  • File docs/architecture/layer-runtime.md: held for the owner decision; its facts match the current record.

Automated review (maintainer link)

| FR8 | Source check over Drawer and MobileNav | Drawer and MobileNav rendered from a control in a second document | A page-level surface moves into the second document |
| FR10 | `useBackdropPress.test.tsx`; `BackdropPress.a11y.chromium.spec.ts` | Dialog (`purpose="info"`), Drawer scrim, CommandPalette, BottomSheet (`purpose="info"`), and BottomSheetSwitcher step scrim, with a mouse and a finger: a press that starts and ends on the backdrop, one that starts inside and ends on it, one that starts on it and ends inside, a cancelled pointer, and a backdrop start followed by a press inside | A press that crosses the edge either way dismisses, a cancelled or earlier press carries over, or a press on the backdrop alone does not dismiss |
| FR11 | `useBackdropPress.test.tsx`; `BackdropPress.a11y.chromium.spec.ts` | Dialog (`purpose="info"`), Drawer scrim, BottomSheet (`purpose="info"`), and BottomSheetSwitcher step scrim with a menu open inside, with a mouse and a finger: a backdrop press, then a second one; a Dialog with a Typeahead list, a DateInput calendar, a pinned InfoTip, or a ContextMenu open inside, with a mouse; a DateTimeInput time list whose field blurs at mousedown; a press while a tooltip hides on its own; a press that closes no layer above | A press that closes the menu also closes the host, or the second press leaves the host open |
| FR12 | `useHotkeys.test.ts`; a real-browser check in Chromium and WebKit | A page shortcut with a Dialog, a Popover, a DropdownMenu, and a BottomSheet open and focus inside each; a shortcut registered inside the Dialog; the page shortcut again after the Dialog closes; a page shortcut with only a Tooltip open; an iframe with its own shortcut while the page has a Dialog open | A page shortcut fires behind an open layer, a layer's own shortcut does not fire, or an open Tooltip stops a page shortcut |

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.

None of the 27 tests in useHotkeys.test.ts renders a layer, and the browser check names no file. Label this row as a gap, as the FR8 and FR9 rows at lines 351-352 do, until those tests exist.

cixzhang added a commit that referenced this pull request Nov 26, 2026
…that fits the view, never another target (FR9, DEC-3) (#12360)

* spec(overlay-dismissal): a returning focus reveals a hidden Tab stop, never a region (FR9, DEC-3)

* spec(overlay-dismissal): FR9 reveal covers every input and partly hidden Tab stops; own verification row and FR9 gap

* spec(overlay-dismissal): FR9 reveals only a Tab stop that fits its visible area; a larger target is not scrolled

* spec(overlay-dismissal): DEC-3 heading and gap line state the fit condition

* Merge main into specs/overlay-dismissal-fr9-reveal

* spec(overlay-dismissal): number the returning-focus decision DEC-4; #10095 holds DEC-3

* Merge remote-tracking branch 'origin/main' into l2/12360-merge

# Conflicts:
#	docs/families/overlay-dismissal.md

* spec(overlay-dismissal): fold Popover's and ContextMenu's plain-focus return into the FR9 gap the amended FR9 leaves

* Revert "spec(overlay-dismissal): fold Popover's and ContextMenu's plain-focus return into the FR9 gap the amended FR9 leaves"

This reverts commit 019150d.

* spec(overlay-dismissal): number the returning-focus decision DEC-3, as approved

* Merge remote-tracking branch 'origin/main' into l2/12360-merge

This branch was successfully deployed

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

Labels

CLA Signed This label is managed by the Meta Open Source bot. needs:spec-owner-review Current knowledge records await owner approval

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant