Skip to content

docs(spec): AlertDialog records its shipped contract as current - #9305

Merged
cixzhang merged 1 commit into
mainfrom
spec-backfill/AlertDialog
Nov 1, 2026
Merged

cixzhang merged 1 commit into
mainfrom
spec-backfill/AlertDialog

Conversation

@cixzhang

@cixzhang cixzhang commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

Exact decision needed

Promote component:AlertDialog from draft to current with a minimal, record-only diff: keep every requirement, decision, owner, and attribution, and record FR6–FR9 — specified but not yet shipped — as implementation gaps against today's main. No behavior, prop, default, target, or export changes.

Existing authority searched

Decision

component:AlertDialog, authority: current, approved by cixzhang. The FR table's draft-state column is dropped as the current template requires. FR6–FR9 each carry "Implementation gap: not shipped yet", with a matching Current-state impact entry; their verification rows keep the planned evidence and add that no test exists yet. AR1's Tab wrap is recorded as a gap too: Dialog on main does not yet contain Tab. Two Alert Dialog contract expectations (least-destructive first focus, click beside is inert) stay advisory; the AR1 verification row records that spec:AST-020 FR9 makes them required once this record is current. PR1 and the compatibility lines describe main today.

Rejected alternatives

None.

Claim scope and non-goals

No requirement is added, removed, or reworded beyond the gap markers.

Evidence and implementation relationship

AlertDialog.test.tsx, useImperativeAlertDialog.test.tsx, and the Alert Dialog accessibility binding (__tests__/AlertDialog.a11y.test.tsx, __tests__/AlertDialog.a11y.chromium.spec.ts) back FR1–FR5 and AR1. FR6–FR9 have no test because they are not shipped. PR1 is source review only, named as a gap.

Writing rubric results

  • R1 narration: none.
  • R2 research in the record: none.
  • R3 evidence naming a change: none.
  • R4 rejected alternatives over one line or outside a decision: only inside DEC-2 and DEC-3, as drafted.
  • R5 pull request or issue references remaining: none.
  • R6 ruled open questions still listing options: none.

Scope

  • This PR contains specification records only.
  • It records observable behavior and preserves equivalent internal implementations.
  • Any named internal mechanism is intentionally public, names its dependent caller/system, and explains why an equivalent implementation would not satisfy the contract: none.
  • Verification states the evidence layer and failure signal without prescribing CI job/workflow topology.
  • It records one intentional durable decision, not a rescue for a separable tagalong.
  • The canonical knowledge owner, affected current claims, and overlapping open work are named; no ownership collision.
  • Adjacent API, visual, accessibility, composition, and implementation facts remain outside scope unless this exact decision depends on them.
  • Public text and artifacts contain no internal Meta context.

Validation

  • pnpm check:knowledge: aligned
  • Prettier: clean
  • git diff --check: clean

@vercel

vercel Bot commented Nov 1, 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 1, 2026 11:48am UTC

Request Review

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

astracat-bot Bot commented Nov 1, 2026 •

Copy link
Copy Markdown

AI review status for this pull request.

Review status Updated
❓ Needs maintainer input (for maintainers only) Nov 1, 2026, 11:58 AM UTC

@github-actions github-actions Bot added the needs:spec-owner-review Current knowledge records await owner approval label Nov 1, 2026
@cixzhang
cixzhang marked this pull request as ready for review November 1, 2026 11:07

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This review is on hold for an owner decision. Promoting component:AlertDialog to current makes FR1–FR6, FR9, FR7's inert dismissal fade, AR1 and DEC-1–DEC-3 governing, and no current record states them yet. An engineering owner records that decision by commenting /approve-spec <full head SHA> on this pull request, and the author may do so as an engineering owner. Independently of that decision, three record fixes are needed:

  • The readiness row says AR1 ships, but Dialog does not yet contain Tab, so add AR1's Tab wrap as a gap under Current-state impact.
  • AR1's verification row names two tests that are not in AlertDialog.test.tsx and calls the accessibility contract pending; point it at the __tests__/AlertDialog.a11y.* binding and record that two of that contract's expectations become required once this record is current.
  • Keep FR6–FR9's planned verification (the evidence each needs) and add that no test exists yet, instead of replacing it.

[Automated review]

| Builder impact | A phone-width alert is 320 px unless the caller sets `width` (FR9); actions track a slide under every pointer (FR8). |
| Compatibility/readiness | Released behavior as observed; this draft records it and adopts the APG Alert Dialog pattern (AR1) under `spec:AST-020/FR15`. FR6–FR9 change shipped behavior and are specified, not implemented yet. |
| Builder impact | None. |
| Compatibility/readiness | FR1–FR5 and AR1 record shipped behavior. FR6–FR9 are requirements not shipped yet; each is an implementation gap listed under Current-state impact. |

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

AR1 says Tab wraps inside the alert through Dialog FR7, but Dialog.tsx on main has no Tab handling or focus-region call, so Tab from the last button leaves for the browser's interface. Please list this as an AR1 gap under Current-state impact and narrow this row to match.

| FR7 | No test yet; FR7 is not shipped. | a tap during the presentation, Enter and Escape during it, a screen reader's activation, a tap during the dismissal; a mouse click during the presentation under a fine pointer | a held key or assistive-technology action, content made inert during the entrance, a tap that reaches a leaving alert, or a mouse click held under a fine pointer fails | `audit:AlertDialog/behavior` |
| FR8 | No test yet; FR8 is not shipped. | a press on Cancel slid onto the action and lifted, and a press lifted outside the actions, each with a mouse, a pen, and a finger; Enter and Space on each action | the press-start action running after a slide, any action running on a lift outside, or a changed keyboard or assistive-technology activation fails | `audit:AlertDialog/behavior` |
| FR9 | No test yet; FR9 is not shipped. | a phone width and a desktop width, in the default and an alternate theme; a caller `width` at a phone width; a screen narrower than 320 px; a narrow window under a fine pointer; a coarse screen that is not compact | a phone-width alert other than 320 px in any theme without a caller `width`, a caller `width` overridden, a desktop width changed, an alert wider than the viewport, or a 320 px alert in a narrow fine-pointer window or on a non-compact coarse screen fails | `audit:AlertDialog/behavior` |
| AR1 | `AlertDialog.test.tsx` ("renders with alertdialog role", "links title via aria-labelledby", "links description via aria-describedby", "marks cancel as the initial focus target", "keeps the initial focus target on the least destructive action", "calls onOpenChange(false) on Escape", "stacks long destructive action labels above cancel on a narrow fine-pointer screen", "reaches both buttons by Tab, cancel first", "is a modal alertdialog", "does not claim the alertdialog role") and `useImperativeAlertDialog.test.tsx`; the no-backdrop-dismiss outcome and focus delegation under the Alert Dialog accessibility contract (`internal/a11y-spec`, pending) | open modal; after Escape; after Cancel | The role, name link, description link, or Cancel initial focus is lost, or a click outside dismisses the dialog. | `audit:AlertDialog/accessibility` |

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

"renders with alertdialog role" and "links description via aria-describedby" are not in AlertDialog.test.tsx; its comment at lines 96-98 says the binding asserts them. The Alert Dialog accessibility contract and __tests__/AlertDialog.a11y.* are on main, so "pending" is stale. With this record current, AST-020 FR9 makes alertdialog.focus.least-destructive-first and alertdialog.dismissal.click-beside-is-inert required, and both are still advisory. Please name the binding here and in verified_by, and record that as a gap or make both required.

Comment on lines +221 to +224
| FR6, PR2 | No test yet; FR6 is not shipped. | present, dismiss, close during present, reopen during dismiss, Reduce Motion, a fine pointer, a narrow viewport | a curve off its role, a start outside the viewport, a jump on interruption, a scale under Reduce Motion, changed motion under a fine pointer, or an added element fails | `audit:AlertDialog/behavior` |
| FR7 | No test yet; FR7 is not shipped. | a tap during the presentation, Enter and Escape during it, a screen reader's activation, a tap during the dismissal; a mouse click during the presentation under a fine pointer | a held key or assistive-technology action, content made inert during the entrance, a tap that reaches a leaving alert, or a mouse click held under a fine pointer fails | `audit:AlertDialog/behavior` |
| FR8 | No test yet; FR8 is not shipped. | a press on Cancel slid onto the action and lifted, and a press lifted outside the actions, each with a mouse, a pen, and a finger; Enter and Space on each action | the press-start action running after a slide, any action running on a lift outside, or a changed keyboard or assistive-technology activation fails | `audit:AlertDialog/behavior` |
| FR9 | No test yet; FR9 is not shipped. | a phone width and a desktop width, in the default and an alternate theme; a caller `width` at a phone width; a screen narrower than 320 px; a narrow window under a fine pointer; a coarse screen that is not compact | a phone-width alert other than 320 px in any theme without a caller `width`, a caller `width` overridden, a desktop width changed, an alert wider than the viewport, or a 320 px alert in a narrow fine-pointer window or on a non-compact coarse screen fails | `audit:AlertDialog/behavior` |

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

These rows drop the evidence layer each requirement needs: browser tests under a coarse pointer in Chromium and WebKit, a spring-curve oracle, pointer-stream tests with mouse, pen and finger, and theme by width browser tests. Other current records with unshipped claims keep their planned verification. Please restore the base text and add that no test exists yet.

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This review is on hold for an owner decision: promoting component:AlertDialog to current makes FR1–FR6, FR9, FR7's inert dismissal fade, AR1's adopted parts, PR2 and DEC-1–DEC-3 governing, and no current spec states them yet. An engineering owner records that decision by commenting /approve-spec <full head SHA> on this pull request, and the author may do so as an engineering owner. The record's gap entries and evidence rows match main, and no other change is required. When deciding FR7, note that the record does not say where focus sits while the alert's content is inert during the touch dismissal fade.

[Automated review]

@cixzhang

cixzhang commented Nov 1, 2026

Copy link
Copy Markdown
Contributor Author

/approve-spec 375903b

@github-actions github-actions Bot removed the needs:spec-owner-review Current knowledge records await owner approval label Nov 1, 2026
@cixzhang
cixzhang merged commit 224a25f into main Nov 1, 2026
53 checks passed
@cixzhang
cixzhang deleted the spec-backfill/AlertDialog branch November 1, 2026 17:33

This branch was successfully deployed

1 active deployment
Preview — 375903b3 Deployed Nov 1, 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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant