Skip to content

docs(Toast): a toast does not handle Escape; the topmost present layer receives it - #13812

Merged
cixzhang merged 3 commits into
mainfrom
docs/toast-viewport-escape-comment
Nov 26, 2026
Merged

cixzhang merged 3 commits into
mainfrom
docs/toast-viewport-escape-comment

Conversation

@cixzhang

@cixzhang cixzhang commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

Primary intent

Docs-only source comment fix: the comment above ToastViewport's F6 handler no longer says Escape lets focus leave a toast. A toast does not handle Escape.

User impact

No user-visible change. Maintainers reading the F6 handler now see what the code does: Tab and Shift+Tab move focus out of a toast. A toast does not handle Escape, so the layer stack sends it to the topmost present layer, such as a Dialog that holds the viewport.

Change

  • Changeset: [docs] patch: the comment changed, and behavior didn't.
  • Toast/ToastViewport.tsx: the comment's last sentences now read "Tab and Shift+Tab move focus out. A toast does not handle Escape. The layer stack sends it to the topmost present layer, such as a Dialog that holds the viewport." It used to read "Shift+Tab / Escape let focus leave naturally".

Authority

  • component:Toast FR3 lists the ways to dismiss a toast, and Escape isn't one of them. family:overlay-dismissal doesn't list Toast. Specs asked for the comment to match the current behavior. Whether Escape should dismiss a focused toast is open with the owner (from [RFC] Toast: let Escape dismiss the focused toast #13805).

Evidence

  • Comment-only source diff, plus a [docs] Changeset, which the Changeset coverage check requires for a change to @astryxdesign/core source. No test or build change.

Writing rubric results

  • R1–R7: not applicable. This PR changes no knowledge record.

Scope

Components: Toast (source comment only).

Overlap

Overlap checked: #11517, #8121, #8084 (they change Toast's swipe or AlertDialog motion in other parts of ToastViewport.tsx; this PR rewrites one comment line above the F6 handler and changes no behavior)

Owner and land path

  • Owner: Astryx maintainers, fix-loop lane 1.
  • Land path: draft; Specs, code review, CI, merge.

@vercel

vercel Bot commented Nov 25, 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 26, 2026 12:12am UTC

Request Review

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

astracat-bot Bot commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
🟢 Reviewed (for maintainers only) Nov 26, 2026, 12:51 AM UTC

@cixzhang cixzhang added the lane:1 Astryx fix-loop lane 1 owns this label Nov 25, 2026
@cixzhang

Copy link
Copy Markdown
Contributor Author

/approve-spec c709a96

@github-actions

github-actions Bot commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

PR Analysis Report

🔎 Preview · e66d68b

Storybook · Sandbox · built from this PR's head

Modified components

Component Size LoC Visual · A11y · RTL
Toast · Storybook 110.1 kB (0) · 11.6 kB CSS (0) 1,863 (0) ✓ · ✓ · ✓

Package size: @astryxdesign/core 8.07 MB packed (+100 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

@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: one sentence in the rewritten comment is not accurate yet.

  • ToastViewport.tsx:987-988 says Escape does nothing in a toast, but when the viewport sits in an open Dialog, modal Drawer or scrim sheet, an Escape pressed on a toast reaches the shared layer stack and closes that host, so the sentence should say that a toast does not handle Escape and that the top open layer receives it.

The description's "Escape does nothing in one" needs the same correction. The rest of the comment matches the code: the viewport has no focus trap, and no toast dismisses on Escape.

Claims and files checked

Review mode: full; reason: no-earlier-review

  • Claim: the comment's last sentence now reads as described. Verified.
  • Claim: it used to say Shift+Tab or Escape let focus leave. Verified.
  • Claim: nothing in the toast handles Escape. Verified: no key handler in the Toast folder.
  • Claim: Tab and Shift+Tab move focus out of a toast. Verified: the viewport has no focus trap.
  • Claim: Escape does nothing in a toast. False while a Dialog, Drawer or sheet hosts the viewport.
  • Claim: the Toast record lists no Escape dismissal. Verified.
  • Claim: the overlay-dismissal family does not list Toast. Verified.
  • Claim: whether Escape should dismiss a focused toast is still open. Verified: the linked RFC is open.
  • Claim: comment-only diff with no test or build change. Verified.
  • File: packages/core/src/Toast/ToastViewport.tsx. Blocking finding above.

Automated review (maintainer link)

@cixzhang

Copy link
Copy Markdown
Contributor Author

/approve-spec 0ce3ebe

@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 rewritten comment now matches the code, and only the title still needs the same correction.

  • Miss: the title says "the viewport comment says Escape does nothing in a toast", which the comment no longer says and which is false while a Dialog holds the viewport, and the title becomes the merged commit's subject, so please retitle it, for example to "docs(Toast): a toast does not handle Escape; the top open layer receives it".

The comment's sentences hold at this head: no toast handles Escape, Tab and Shift+Tab leave the viewport, and the layer stack decides where Escape goes. One optional wording note is on line 988.

Claims and files checked

Review mode: incremental; reason: none

  • Changed rules since the last review (0): none.
  • Claim: the comment's last sentences now read as described. Verified.
  • Claim: the comment used to say Shift+Tab or Escape let focus leave. Verified.
  • Claim: a toast does not handle Escape. Verified: no key handler in the Toast code, and the dismiss button passes Escape through.
  • Claim: the layer stack sends Escape to the top open layer, such as a Dialog that holds the viewport. Verified, with the optional wording note about present layers.
  • Claim: Tab and Shift+Tab move focus out. Verified: the viewport has no focus trap.
  • Claim: no user-visible change. Verified: comment only.
  • Claim: the Toast record lists no Escape dismissal. Verified.
  • Claim: the overlay-dismissal family does not list Toast. Verified.
  • Claim: whether Escape should dismiss a focused toast is still open. Verified: the linked RFC is open.
  • Claim: the change was requested so the comment matches current behavior. Context only; not checkable in the code.
  • Claim: comment-only diff with no test or build change. Verified.
  • Claim: no knowledge record changes. Verified.
  • Claim: the listed overlapping pull requests change other parts of the file. Verified: none touches this comment.
  • Claim (title): the comment says Escape does nothing in a toast. False; see the finding above.
  • File: packages/core/src/Toast/ToastViewport.tsx. Clear apart from the optional wording note.

Automated review (maintainer link)

@cixzhang cixzhang changed the title docs(Toast): the viewport comment says Escape does nothing in a toast docs(Toast): a toast does not handle Escape; the top open layer receives it Nov 25, 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, and it starts once the pull request is marked ready for review.

The retitle fixes the one remaining finding: the title now says what the comment says, and every sentence of the comment matches the code. The optional wording note on line 988 still stands: the layer stack picks the topmost present layer, so "the topmost present layer" would be exact in the comment and the title.

Claims and files checked

Review mode: same-head; reason: none

  • Claim (title): a toast does not handle Escape, and the top open layer receives it. Verified, with the optional wording note.
  • Claim: the comment above the F6 handler no longer says Escape lets focus leave a toast. Verified.
  • Claim: no user-visible change. Verified: comment only.
  • Claim: Tab and Shift+Tab move focus out of a toast. Verified: the viewport has no focus trap.
  • Claim: a toast does not handle Escape. Verified: the Toast code handles no key apart from F6, and the dismiss button passes Escape through.
  • Claim: the layer stack sends Escape to the top open layer, such as a Dialog that holds the viewport. Verified, with the optional wording note.
  • Claim: the comment's last sentences now read as quoted, and used to say Shift+Tab or Escape let focus leave. Verified.
  • Claim: the Toast record lists the ways to dismiss a toast, and Escape is not one of them. Verified.
  • Claim: the overlay-dismissal family does not list Toast. Verified.
  • Claim: the change was asked for so the comment matches current behavior. Context only; not checkable in the code.
  • Claim: whether Escape should dismiss a focused toast is still open. Verified: the linked RFC is open.
  • Claim: comment-only diff with no test or build change. Verified.
  • Claim: no knowledge record changes. Verified.
  • Claim: the listed overlapping pull requests change other parts of the file. Verified: none touches this comment.
  • File: packages/core/src/Toast/ToastViewport.tsx. Clear apart from the optional wording note.

Automated review (maintainer link)

@cixzhang
cixzhang marked this pull request as ready for review November 25, 2026 23:24

@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 required lint check fails on this head because the change has no Changeset for @astryxdesign/core.

  • Found by CI: lint fails at "Check Changeset coverage" because packages/core/src/Toast/ToastViewport.tsx ships in @astryxdesign/core and no Changeset names that package, so please add one with a [docs] line saying the comment changed and behavior did not, for example with pnpm changeset:new --packages @astryxdesign/core --category docs.

The comment itself still matches the code, and the optional wording note on line 988 stands: "the topmost present layer" would be exact in the comment and the title.

Claims and files checked

Review mode: same-head; reason: none

  • Claim (title): a toast does not handle Escape, and the top open layer receives it. Verified, with the optional wording note.
  • Claim: the comment above the F6 handler no longer says Escape lets focus leave a toast. Verified.
  • Claim: no user-visible change. Verified: comment only.
  • Claim: Tab and Shift+Tab move focus out of a toast. Verified: the viewport has no focus trap.
  • Claim: a toast does not handle Escape. Verified: the Toast code handles no key apart from F6, and the dismiss button passes Escape through.
  • Claim: the layer stack sends Escape to the top open layer, such as a Dialog that holds the viewport. Verified, with the optional wording note.
  • Claim: the comment's last sentences now read as quoted, and used to say Shift+Tab or Escape let focus leave. Verified.
  • Claim: the Toast record lists the ways to dismiss a toast, and Escape is not one of them. Verified.
  • Claim: the overlay-dismissal family does not list Toast. Verified.
  • Claim: the change was asked for so the comment matches current behavior. Context only; not checkable in the code.
  • Claim: whether Escape should dismiss a focused toast is still open. Verified: the linked RFC is open.
  • Claim: comment-only diff with no test or build change. Verified.
  • Claim: no knowledge record changes, so the writing rubric does not apply. Verified.
  • Claim: the listed overlapping pull requests change other parts of the file. Verified: none touches this comment.
  • Claim: the owner and land path. Context only.
  • File: packages/core/src/Toast/ToastViewport.tsx. Blocking: no Changeset names its package; otherwise clear apart from the optional wording note.

Automated review (maintainer link)

@cixzhang
cixzhang marked this pull request as draft November 26, 2026 00:01
@cixzhang cixzhang changed the title docs(Toast): a toast does not handle Escape; the top open layer receives it docs(Toast): a toast does not handle Escape; the topmost present layer receives it Nov 26, 2026
@cixzhang

Copy link
Copy Markdown
Contributor Author

/approve-spec e66d68b

@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: the required checks are running on this head, and the merge guard waits for them to pass.

The comment above the F6 handler, the title and the [docs] Changeset each match how focus and Escape behave in a toast today, and the Changeset coverage step in CI passes on this head. Nothing else needs to change.

Claims and files checked

Review mode: same-head; reason: none

  • changed rules (0): none
  • Claim (title): a toast does not handle Escape, and the topmost present layer receives it. Verified.
  • Claim: the comment above the F6 handler no longer says Escape lets focus leave a toast. Verified.
  • Claim: no user-visible change. Verified: a comment and a release note only.
  • Claim: Tab and Shift+Tab move focus out of a toast. Verified: the viewport has no focus trap or Tab handler.
  • Claim: a toast does not handle Escape, so the layer stack sends it to the topmost present layer, such as a Dialog that holds the viewport. Verified against the shared layer stack.
  • Claim: the comment's new sentences read as quoted, and it used to say Shift+Tab or Escape let focus leave. Verified.
  • Claim: a docs patch Changeset says the comment changed and behavior did not. Verified.
  • Claim: the Toast record's list of ways to dismiss a toast does not include Escape. Verified.
  • Claim: the overlay-dismissal family does not list Toast. Verified.
  • Claim: the change was asked for so the comment matches current behavior. Context only.
  • Claim: whether Escape should dismiss a focused toast is still open. Verified: the linked RFC is open.
  • Claim: the Changeset coverage check requires the Changeset for a Core source edit, and no test or build changes. Verified: the coverage step passes on this head.
  • Claim: no knowledge record changes, so the writing rubric does not apply. Verified.
  • Claim: the scope is Toast, a source comment only. Verified.
  • Claim: the listed overlapping pull requests change other parts of the file. Verified: none touches this comment.
  • Claim: the owner and land path. Context only.
  • Claim (Changeset): a source comment in the toast viewport now says a toast does not handle Escape and that the topmost present layer receives it; behavior is unchanged. Verified.
  • File: packages/core/src/Toast/ToastViewport.tsx. Clear.
  • File: .changeset/toast-viewport-escape-comment.md. Clear.

Automated review (maintainer link)

@cixzhang
cixzhang marked this pull request as ready for review November 26, 2026 00:33
@cixzhang
cixzhang merged commit 988918d into main Nov 26, 2026
156 checks passed
@github-actions
github-actions Bot deleted the docs/toast-viewport-escape-comment branch November 26, 2026 06:04

This branch was successfully deployed

1 active deployment
Preview — e66d68bd Deployed Nov 26, 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. lane:1 Astryx fix-loop lane 1 owns this

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant