Repository navigation
docs(Toast): a toast does not handle Escape; the topmost present layer receives it - #13812
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
|
/approve-spec c709a96 |
PR Analysis Report🔎 Preview ·
|
| 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
There was a problem hiding this comment.
Changes requested: one sentence in the rewritten comment is not accurate yet.
ToastViewport.tsx:987-988says 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.
|
/approve-spec 0ce3ebe |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Changes requested: the required lint check fails on this head because the change has no Changeset for @astryxdesign/core.
- Found by CI:
lintfails at "Check Changeset coverage" becausepackages/core/src/Toast/ToastViewport.tsxships in@astryxdesign/coreand no Changeset names that package, so please add one with a[docs]line saying the comment changed and behavior did not, for example withpnpm 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.
|
/approve-spec e66d68b |
There was a problem hiding this comment.
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.
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
[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:ToastFR3 lists the ways to dismiss a toast, and Escape isn't one of them.family:overlay-dismissaldoesn'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
[docs]Changeset, which the Changeset coverage check requires for a change to@astryxdesign/coresource. No test or build change.Writing rubric results
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