Repository navigation
Conversation
A caller may set the sheet's transition timing with longhands, such as transitionDuration, or with the transition shorthand. Unit cases check that a drag's suppression holds over either form, and that the caller's form is back at rest. A Chromium and WebKit case, on a new browser fixture story, reads the longhands after a real touch drag and its settle. They fail until the next commit.
The drag suppressed the sheet's transitions with the transition shorthand, merged before the caller's style. Its reset cleared a caller's longhands, and React never wrote them again. A caller's own shorthand replaced the suppression for the whole drag. React also warned about the conflict. The gesture now suppresses through transition-property, only while it suppresses. The panel writes the suppression after the caller's style, in the caller's own form: the shorthand over a caller's shorthand, else the longhand. So it holds while the drag lasts and leaves the caller's style alone.
|
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.
Changes requested: the fix keeps timing for callers who set transition longhands alone or the transition shorthand alone, but a caller who sets both loses the longhand after a drag.
- Shorthand plus longhand loses timing: with
style={{transition: 'transform 300ms linear', transitionDuration: '410ms'}}, the shorthand branch'stransition: 'none'(BottomSheetPanel.tsx:1272-1273) resets the longhand and only the shorthand is written back, so after one drag the sheet settles at 300ms instead of 410ms and React logs its shorthand/longhand warning (reproduced locally with a touch drag in Chromium), which makes the title, the changeset's first and last sentences and the description's "leaves the caller's style as it was" untrue; either drop the caller'stransition*longhands from the merged style while the suppression holds and add a case for that form, or narrow those claims to longhands alone or the shorthand alone.
Two changed comments could follow the source-comment rules more closely: BottomSheetPanel.tsx:1266-1268 restates the merge order without its reason, and the changed sentence at useSheetGestures.ts:2054-2059 runs to 36 words; rewrites are suggested inline. Everything else checked out locally: both new unit cases fail on the base and pass here, the BottomSheet suite passes 642 of 642 without React's conflict warnings, and a real Chromium drag keeps longhand-only and shorthand-only timing and no longer animates a shorthand-styled sheet under the finger.
Claims and files checked
Review mode: full; reason: no-earlier-review
- Claims
- Title, the sheet keeps a caller's transition timing through a drag: false for a caller who sets the shorthand with a longhand (local Chromium drag).
- Changeset, timing kept with longhands or with the shorthand: false for the same caller.
- Changeset, before the fix a drag cleared longhands and a caller's shorthand turned the suppression off: verified (local Chromium drag on the base).
- Changeset, React no longer warns about the shorthand beside the longhands: verified for the BottomSheet suite (102 warnings on the base, none here); false for a caller who sets both forms.
- Description, user impact (longhands reset at the drag's start and cleared at its end, a caller's shorthand animating under the finger, 102 warnings in the suite): verified locally.
- Description, the suppression goes after the caller's style in the caller's form: verified (
BottomSheetPanel.tsx:1269-1275,:1312); that it leaves the caller's style as it was: false for the shorthand-plus-longhand caller. - Description, the hook says a drag turns off the panel's transition: verified (
useSheetGestures.ts:2041-2063); that no current record decides the interaction: not adopted, since the public component API's preserved-consumer-props invariant and the touch spec's finger-tracking requirement cover it. - Description, the gesture writes
transitionProperty, eight sheet assertions, a gesture unit and a snapshot read it, and a hidden fixture story sets longhands: verified. - Description, no API, default or visual change: verified (API surface comparison, unchanged default path, identical frames at rest).
- Description, red-first unit cases fail at the first commit and pass at the head: verified locally; the browser test's red and green runs in Chromium and WebKit: reported.
- Description, 642 of 642 in the BottomSheet suite and the unchanged no-style path: verified locally; unit cases failing when the suppression merges first: reported.
- Description, typecheck, strict ESLint and Prettier: verified locally; 837 of 837 with the keyboard suite, the browser pass counts, and the knowledge, changeset, repository and pre-review checks: reported.
- Description, scope checklist (one component, no tagalongs, no new API or default, no internal context): verified; four open pull requests on these files with clean trial merges: reported.
- Files
.changeset/bottomsheet-caller-transition-longhands.md: finding (claim)apps/storybook/stories/BottomSheet.stories.tsx: clearpackages/core/src/BottomSheet/BottomSheet.test.tsx: clearpackages/core/src/BottomSheet/BottomSheetPanel.tsx: finding (shorthand branch), comment suggestionpackages/core/src/BottomSheet/BottomSheetResizeDuringSettle.test.tsx: clearpackages/core/src/BottomSheet/__tests__/BottomSheetCallerTransition.interaction.browser.spec.ts: clearpackages/core/src/BottomSheet/useSheetGestures.test.ts: clearpackages/core/src/BottomSheet/useSheetGestures.ts: comment suggestion
| const dragSuppression = | ||
| isInteractive && suppression != null | ||
| ? style?.transition != null | ||
| ? {transition: suppression} |
There was a problem hiding this comment.
When the caller sets transition together with a longhand (say transitionDuration: '410ms'), this branch writes only transition: 'none'. That resets the longhand, and when the drag ends React writes back only the shorthand, so the sheet settles at the shorthand's 300ms from then on, with React's shorthand/longhand warning (reproduced locally with a touch drag in Chromium).
One fix: while the suppression holds, also set each transition* longhand key the caller's style has to undefined, so React writes the shorthand and then those longhands back when the drag ends, and add a case for that form. Otherwise, narrow the title, changeset and description to longhands alone or the shorthand alone.
| // The drag's suppression goes after the caller's style, in the caller's own | ||
| // form: the shorthand over a caller's shorthand, else the longhand. It holds | ||
| // during the drag. After the drag, the caller's style is unchanged. |
There was a problem hiding this comment.
Non-blocking: this restates the merge order the code shows and leaves out why. A rewrite that keeps only the reason:
// A shorthand write resets every transition longhand, and its removal clears
// them. So the suppression comes last, in the caller's form: the shorthand
// over a caller's shorthand, else `transition-property`.| // would apply to that transform too, cutting the exit. Reduced motion | ||
| // is the panel's own stylesheet's to honor (its transform transition | ||
| // collapses under the preference), not an inline `none` here: the | ||
| // shorthand would also silence the panel's opacity transition, the | ||
| // reduced-motion cross-fade on a coarse pointer. | ||
| transition: | ||
| // collapses under the preference), not an inline `none` here: that | ||
| // would also silence the panel's opacity transition, the | ||
| // reduced-motion cross-fade on a coarse pointer. The longhand leaves | ||
| // a caller's own transition timing alone. |
There was a problem hiding this comment.
Non-blocking: the changed sentence from "Reduced motion" on runs to 36 words, over the 25-word limit for source comments. A split:
// The panel's stylesheet honors reduced motion: its transform transition
// collapses under the preference. An inline `none` here would also stop the
// opacity cross-fade on a coarse pointer. The longhand keeps a caller's
// transition timing.
User impact
A caller can set a
BottomSheet's transition timing with longhands, such asstyle={{transitionDuration: '410ms'}}, or with thetransitionshorthand. A drag broke both. Itstransition: nonereset a caller's longhands when the drag started, and React's removal of it cleared them when the drag ended. A caller's own shorthand replaced the drag'snone, so the sheet animated under the finger. React also warned about the conflict, 102 times in the sheet's unit suite.Problem and solution fit
transitionshorthand, merged before the caller's style.Now the drag's suppression goes after the caller's style, in the caller's form:
transition: 'none'over a shorthand, elsetransitionProperty: 'none'. It holds for the drag and leaves the caller's style as it was.Expected behavior and authority
The hook says a drag moves the sheet live and turns off the panel's transition. No current record decides how that suppression meets a caller's transition style: the BottomSheet record's FR18, FR19 and FR27 and
spec:AST-094do not. This is flagged for the spec owners.Smallest restoration
The gesture's
transitionbecomestransitionProperty. Eight BottomSheet assertions, a gesture unit and a snapshot readtransitionPropertynow. A hidden browser fixture story sets a caller's longhands. There is no API, default or visual change.Evidence
none.Scope
Components: BottomSheet
Of four open pull requests on these two files, one by another author also writes the sheet's inline
transition-property, during a Reduce Motion cross-fade. Trial merges add no conflict.Testing
--ignore-path /dev/null --checkon them, and a misformatted control file in the same run fails.pnpm check:knowledge,check:changesets,check:repoandreview:prepass.Drafted with an AI coding agent; the tests were run as described.