Repository navigation
fix(Toast): a toast inset edge of 0 replaces the provider's inset on that edge - #13112
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
|
/approve-spec f54437f |
PR Analysis Report🔎 Preview ·
|
| Component | Size | LoC | Visual · A11y · RTL |
|---|---|---|---|
| Toast · Storybook | 107.0 kB (0) · 11.5 kB CSS (0) | 1,835 (+3) | ✓ · ✓ · ✓ |
Package size: @astryxdesign/core 7.86 MB packed (+219 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: the zero-inset fix works on the stack's own edge and on start/end, but the same checks now also write a zero on the edge opposite the position.
- A
0on the block edge oppositepositionnow moves the whole toast stack across the screen (ToastViewport.tsx:859-864): with the defaultbottomEnd,toast.inset={{top: 0}}or all four edges set to0puts toasts at the top, where onmainthat zero did nothing, so writetoponly for top positions andbottomonly for bottom positions (or keep a zero there a no-op) and have the new test expect no inline opposite edge. Toast.spec.mdstill says the zero case is broken: the FR6 row (line 199) keeps "atoast.insetedge set to 0 does not replace the provider's value" as an implementation gap and line 291 still lists it as having no focused test, so drop both and name the new case in the FR6–FR8 verification row.
The intended path checks out: the new case fails on main and passes here, each reverted check fails its own edge, and unset edges still follow the provider. CI has not run on this head yet.
Claims and files checked
Review mode: same-head; reason: none
- Claim: builders who set an edge to zero got the provider's inset there, with no warning. Verified in a browser check on
main(an 80 px declared bar kept the viewport 80 px up). - Claim: a zero edge now puts the toast viewport flush to that edge. Verified for the stack's own block edge and both inline edges; on the opposite block edge it moves the stack instead (first finding).
- Claim: the viewport wrote each edge only under a truthiness check, so zero counted as unset. Verified (
ToastViewport.tsx:859-870onmain). - Claim: the checks now test for a value, and an unset edge keeps the provider's value. Verified (unset frames identical on both sides; the existing inset case passes).
- Claim: the layer viewport-inset spec has a set edge replace the provider's value. Verified (its FR6 text).
- Claim: the Toast record listed this as a known gap and the change removes it. False in part: the bullet is removed, but the FR6 row and the no-focused-test list still state it (second finding).
- Claim: the opposite-edge sentence describes unchanged behavior. False for zero values (first finding).
- Claim: the smallest restoration is four checks, one test in both directions, one record bullet and a changeset. Verified.
- Claim: the new case fails on
mainat its first edge. Verified (ltr top: expected '' to match /^0(px)?$/). - Claim: the new case passes for all four edges in both directions. Verified.
- Claim: the existing inset case and every Toast unit case pass (8 files, 171 tests). Verified.
- Claim: reverting any one check fails the case for that edge. Verified (four single-revert runs).
- Claim: one defect is restored, with no separable tagalongs. Verified for scope; the restoration itself carries the first finding.
- Claim: no new public API, visual representation, default or interaction model. Public API verified (no surface change); the opposite-edge zero changes where the stack renders (first finding).
- Claim: public text carries no internal context. Verified.
- Claim: the other open Toast pull requests named do not change how inset edges are read. Verified from their file patches.
- Claim (release note): patch release for the core package. Verified.
- Claim (release note): a zero edge now puts toasts flush to that edge, where before the provider's inset stayed. Verified for the stack's own and inline edges; the opposite edge is the first finding.
- File
packages/core/src/Toast/ToastViewport.tsx: first finding. - File
packages/core/src/Toast/ToastViewport.test.tsx: first finding (thetopiteration renders a bottom stack and expects an inlinetop). - File
docs/specs/components/Toast/Toast.spec.md: second finding. - File
.changeset/toast-zero-inset.md: clear.
…hing; the record drops the zero-inset gap
|
/approve-spec 27249b2 |
There was a problem hiding this comment.
Approved pending CI: CI is still running on this head, and its required checks must pass before merge.
A 0 on the stack's own block edge or on an inline edge now replaces the provider's inset, and a 0 on the edge opposite the position leaves the stack where it was. The code is unchanged since the last review, and the record change has an engineering owner's approval for this head.
Claims and files checked
Review mode: same-head; reason: none
- Claim: builders who set an edge to zero got the provider's inset there instead. Verified in the base source (each edge was gated on truthiness) and in a browser check (a declared 80 px bar kept the toast viewport 80 px up).
- Claim: a zero edge now puts the toast viewport flush to that edge. Verified for the stack's own block edge and both inline edges, in both directions, in unit tests and a browser check.
- Claim: the viewport read each edge under a truthiness check, so zero counted as unset. Verified in the base source.
- Claim: the checks now test for a value, and an unset edge keeps the provider's value. Verified (the guards in
ToastViewport.tsx, the unchanged unset frame, and the existing inset case). - Claim: on the block edge opposite the position a zero still writes nothing, as on the base. Verified (the new opposite-edge case, and identical base and head frames for a zero opposite the position).
- Claim: the layer viewport-inset spec has a set edge replace the provider's value. Verified against its FR6 text.
- Claim: the Toast record drops the zero-inset gap, and the opposite-edge sentence stays as its own bullet. Verified in the record's Current-state list, FR6 row, verification row and untested list.
- Claim: the smallest restoration is the inset checks, two unit cases, the record edits and a patch changeset. Verified.
- Claim: before the change, the new case fails at its first edge. Verified (
ltr top). - Claim: the new case passes for all four edges in both directions. Verified.
- Claim: every Toast unit case passes (8 files, 172 tests). Verified.
- Claim: reverting any one of the four checks fails the case for that edge. Verified with four single-revert runs.
- Claim: one defect is restored, with no tagalongs and no new public API, visual representation, default or interaction model. Verified (no API surface change; only zero-edge placement changes).
- Claim: public text carries no internal context. Verified.
- Claim: the open Toast pull requests named do not change how inset edges are read. Verified from their current file patches.
- Claim (release note): a patch release of the core package. Verified.
- Claim (release note): a zero edge now puts toasts flush to that edge, where before the provider's inset stayed. Verified for every edge the provider's inset placed.
- File
packages/core/src/Toast/ToastViewport.tsx: clear. - File
packages/core/src/Toast/ToastViewport.test.tsx: clear. - File
docs/specs/components/Toast/Toast.spec.md: clear. - File
.changeset/toast-zero-inset.md: clear.
User impact
Builders who set a
toast.insetedge to0, to put toasts flush to an edge while the app declares a floating bar elsewhere, got the provider's inset on that edge instead. Toasts sat where the app said they should not, with no warning. Now a0edge puts the toast viewport flush to that edge.Problem and solution fit
ToastViewportwrote eachtoast.insetedge only under a truthiness check (if (inset?.top)and the same for the other edges), so0counted as unset and the provider'slayerInsetstayed. The checks now test for a value (!= null), so0is written like any other number; an unset edge still keeps the provider's value. On the block edge opposite the position (topfor a bottom stack,bottomfor a top stack) a zero still writes nothing, so it cannot move the stack, as onmain.Expected behavior and authority
spec:AST-059FR6: "Atoast.insetedge, when set, replaces the provider's value for the toast viewport on that edge." A0edge is set.component:Toastlisted this as a known gap ("A zero toast inset does not override the provider"); this change removes that bullet. The bullet's other sentence (an inset edge opposite the position moves the stack) is unchanged behavior and stays as its own bullet.Smallest restoration
ToastViewport.tsx: the inline and own-side block checks become!= null; on the block edge opposite the position, a zero is skipped.ToastViewport.test.tsx: one case sets each edge to0on its own (topwith a top stack), in LTR and RTL, and expects the viewport's inline style to carry it; one case setstopandbottomto0and expects nothing on the edge opposite the position.Toast.spec.md: the zero-inset gap is removed from the known gaps, the FR6 row and the untested list; FR6 now says a zero opposite the position writes nothing; the FR6–FR8 verification row names the new cases.[fix]patch.Evidence
main'sToastViewport.tsx, the new case fails at its first edge (ltr top: expected '' to match /^0(px)?$/).bottom: 24, start: 24, end: 40in LTR and RTL) and every other Toast unit case pass (8 files, 172 tests).Scope
Components: Toast
Overlap checked: #13070, #11966, #11517, #11463, #8121 (open Toast work: a release interaction check, the mixed-body announcement, the swipe model and its preview, and the swipe-claim perf change; none changes how
toast.insetedges are read inToastViewport.tsx, so this one-defect fix stays separate)Also checked: #12337 and #12728 (spec text and the lazy client root; no overlap with this change), #13058 (merged;
Toast.tsxonly).Testing
pnpm vitest run --project ui packages/core/src/Toast(172 passed); the new case run againstmain'sToastViewport.tsx(fails as above).