Skip to content

chore(Drawer): migrate to stable motion APIs#31668

Merged
layershifter merged 8 commits intomicrosoft:masterfrom
layershifter:chore/drawer-motion
Jul 29, 2024
Merged

chore(Drawer): migrate to stable motion APIs#31668
layershifter merged 8 commits intomicrosoft:masterfrom
layershifter:chore/drawer-motion

Conversation

@layershifter
Copy link
Member

@layershifter layershifter commented Jun 11, 2024

Previous Behavior

@fluentui/react-drawer uses @fluentui/react-motion-preview.

New Behavior

  • @fluentui/react-drawer uses @fluentui/react-motion 💪
  • OverlayDrawer gets backdropMotion & surfaceMotion slots, InlineDrawer gets surfaceMotion for customizing motions
  • Stories have been updated

Related Issue(s)

Fixes #30696.


Note on VR regressions

Visual regression tool reports visual regressions in Drawer:

image

All of them related to a missing box-shadow which should be tokens.shadow64. To confirm it, I went to a PR deployment & real docsite and changed value of --shadow64 token to rgb(85, 91, 255) 0px 0px 0px 3px, rgb(31, 193, 27) 0px 0px 0px 6px, rgb(255, 217, 19) 0px 0px 0px 9px, rgb(255, 156, 85) 0px 0px 0px 12px, rgb(255, 85, 85) 0px 0px 0px 15px:

image

And the result matches:

image

Seems to be a glitch with VR tool 💥

@github-actions github-actions bot added this to the April Project Cycle Q1 2024 milestone Jun 11, 2024
@fabricteam
Copy link
Collaborator

fabricteam commented Jun 11, 2024

Perf Analysis (@fluentui/react-components)

No significant results to display.

All results

Scenario Render type Master Ticks PR Ticks Iterations Status
Avatar mount 643 653 5000
Button mount 299 306 5000
Field mount 1144 1120 5000
FluentProvider mount 724 713 5000
FluentProviderWithTheme mount 79 92 10
FluentProviderWithTheme virtual-rerender 34 36 10
FluentProviderWithTheme virtual-rerender-with-unmount 82 77 10
MakeStyles mount 862 848 50000
Persona mount 1818 1731 5000
SpinButton mount 1433 1393 5000
SwatchPicker mount 1628 1677 5000

@fabricteam
Copy link
Collaborator

fabricteam commented Jun 11, 2024

📊 Bundle size report

Package & Exports Baseline (minified/GZIP) PR Change
react-components
react-components: Button, FluentProvider & webLightTheme
0 B
0 B
69.141 kB
20.157 kB
🆕 New entry
react-components
react-components: Accordion, Button, FluentProvider, Image, Menu, Popover
0 B
0 B
212.254 kB
61.167 kB
🆕 New entry
react-components
react-components: FluentProvider & webLightTheme
0 B
0 B
44.442 kB
14.607 kB
🆕 New entry
react-components
react-components: entire library
0 B
0 B
1.094 MB
269.97 kB
🆕 New entry
react-portal-compat
PortalCompatProvider
0 B
0 B
8.39 kB
2.64 kB
🆕 New entry
react-timepicker-compat
TimePicker
0 B
0 B
106.611 kB
35.546 kB
🆕 New entry

🤖 This report was generated against ceacd96379e6d7268d1807a318a9b6f7c48f519b

@layershifter layershifter force-pushed the chore/drawer-motion branch from cfe6efc to 3119a3f Compare June 11, 2024 16:24
@layershifter layershifter marked this pull request as ready for review June 12, 2024 13:37
@layershifter layershifter requested review from a team and marcosmoura as code owners June 12, 2024 13:37
@layershifter
Copy link
Member Author

@marcosmoura can you please help with reviewing this PR? 🙏

@marcosmoura
Copy link
Contributor

@layershifter There is also a Motion Disabled stories example that is not working anymore. How can we implement a way to disable animations on the user side?

@layershifter
Copy link
Member Author

@layershifter There is also a Motion Disabled stories example that is not working anymore. How can we implement a way to disable animations on the user side?

Good catch 👍 This should be supported with #30700.


Considering that there are at least three items related to #30700 in this PR, IMO it makes sense to implement first it.

@marcosmoura I will put this PR on hold and will work on #30700. Thanks for feedback ❤️

@marcosmoura
Copy link
Contributor

@layershifter Might be for another PR, but another thing is the Multiple Levels example. Since we are moving the whole Drawer package to not use the hooks anymore, we should start thinking of a way to achieve a similar experience using the new Motion API.

@layershifter layershifter marked this pull request as draft June 12, 2024 14:33
@layershifter layershifter force-pushed the chore/drawer-motion branch from 3119a3f to 3078741 Compare July 17, 2024 16:12
@layershifter layershifter force-pushed the chore/drawer-motion branch 3 times, most recently from ad1d868 to 5aae06d Compare July 18, 2024 10:09
@layershifter layershifter force-pushed the chore/drawer-motion branch 2 times, most recently from 02ddca6 to 4022110 Compare July 18, 2024 11:51
@layershifter
Copy link
Member Author

@layershifter There is also a Motion Disabled stories example that is not working anymore. How can we implement a way to disable animations on the user side?

@marcosmoura updated it, it's just null now 🙌 See an example below (the story was also updated 💪):

<Drawer
  backdropMotion={null}
  surfaceMotion={null}
 />

@layershifter
Copy link
Member Author

@layershifter Might be for another PR, but another thing is the Multiple Levels example. Since we are moving the whole Drawer package to not use the hooks anymore, we should start thinking of a way to achieve a similar experience using the new Motion API.

I updated that story, too 🐱

@layershifter layershifter force-pushed the chore/drawer-motion branch 3 times, most recently from 6ecfb88 to 1691a31 Compare July 18, 2024 15:55
@layershifter layershifter force-pushed the chore/drawer-motion branch 2 times, most recently from 4c714eb to 591dcd5 Compare July 18, 2024 16:59
@layershifter layershifter marked this pull request as ready for review July 18, 2024 17:22
@layershifter layershifter requested review from a team and mltejera as code owners July 18, 2024 17:22
@marcosmoura marcosmoura self-requested a review July 19, 2024 12:56
@layershifter layershifter force-pushed the chore/drawer-motion branch from 63f4acf to 5cc2a2e Compare July 25, 2024 14:01
@layershifter layershifter merged commit f903b6d into microsoft:master Jul 29, 2024
@layershifter layershifter deleted the chore/drawer-motion branch July 29, 2024 16:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[chore]: migrate InlineDrawer & OverlayDrawer to use @fluentui/react-motions-preview

5 participants