Repository navigation
docs(spec): page shortcuts stop at the topmost layer; nested overlays render through a Core layer - #10095
docs(spec): page shortcuts stop at the topmost layer; nested overlays render through a Core layer#10095cixzhang wants to merge 3 commits into
Conversation
… in a modal render through a Core layer
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
PR Analysis Report
Generated by PR Enrichment workflow | View current CI run |
There was a problem hiding this comment.
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.tsand 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
useHotkeysbehavior with no release class or migration, whichspec:AST-017FR1, FR3, FR5 and FR31 require for a change to a released contract. - The description has no
## Writing rubric resultssection, 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, sopnpm specs:foron the hook never shows the rule (architecture:knowledge-contractsINV26).
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:185listens 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_byentry, 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".
| 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` |
There was a problem hiding this comment.
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.
| 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. |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.tsand a browser check that do not cover it, so add anFR12 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
useHotkeysbehavior with no release class or migration, whichspec:AST-017FR1, FR3, FR5 and FR31 require for a change to a released contract. - The description has no
## Writing rubric resultssection, 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, sopnpm specs:foron the hook never shows the rule (architecture:knowledge-contractsINV26).
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:254listens 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_byentry, 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.
| | 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 | |
There was a problem hiding this comment.
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.
…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
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)
family:overlay-dismissalFR12, DEC-3, decider pending). Recommended A: auseHotkeysshortcut fires only in the layer that registered it. Alternatives: B, suppress only while a modal is open; C, an opt-in option.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), anduseHotkeys.test.tsinverified_by. FR1–FR11 are unchanged.architecture:layer-runtime: one paragraph under "Browser hosts and corrective portals". No invariant changes.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-dismissalDEC-3 is taken by the returning-focus decision (#12360); this record takes the next free number (DEC-4) when it is next refreshed.