feat(elements): Enable Blueprint animations#4718
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
WalkthroughAdds a reusable ChangesBlueprint animations
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant Storybook
participant AnimationDecorator
participant BlueprintProvider
participant Story
Storybook->>AnimationDecorator: render story
AnimationDecorator->>BlueprintProvider: set animation phases enabled
BlueprintProvider->>Story: render wrapped story
Possibly related PRs
Suggested labels: Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.storybook/preview.tsx:
- Around line 33-47: Update withBlueprintAnimations in .storybook/preview.tsx so
Chromatic explicitly disables both animationsPhase1Enabled and
animationsPhase2Enabled for all wrapped components, including their nested
BlueprintProvider instances; retain the existing enabled configuration for
non-Chromatic runs.
In `@src/elements/common/withBlueprintAnimations.tsx`:
- Around line 15-26: Update the WithBlueprintAnimations wrapper to destructure
enableBlueprintAnimations before rendering Component, forwarding only the
remaining props so the HOC-only control prop cannot reach wrapped DOM elements.
Add a regression test using a DOM-facing child that verifies the control prop is
not rendered as an attribute.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: c2c55441-2ad1-43c4-b541-7dc19de20c7f
📒 Files selected for processing (11)
.storybook/preview.tsxsrc/elements/common/__tests__/withBlueprintAnimations.test.tsxsrc/elements/common/withBlueprintAnimations.tsxsrc/elements/content-explorer/ContentExplorer.tsxsrc/elements/content-picker/ContentPicker.jssrc/elements/content-preview/ContentPreview.jssrc/elements/content-sharing/ContentSharing.jssrc/elements/content-sharing/ContentSharingV2.tsxsrc/elements/content-sidebar/ContentSidebar.jssrc/elements/content-uploader/ContentUploader.tsxsrc/features/presence/PresenceAvatarList.tsx
f5221ff to
ee33922
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/elements/common/withBlueprintAnimations.tsx`:
- Around line 9-16: Rename the exported control prop in BlueprintAnimationsProps
and its resolution in withBlueprintAnimations to enableBlueprintAnimations,
preserving the existing boolean and per-phase behavior. Update
src/elements/common/withBlueprintAnimations.tsx lines 9-16 and the resolver at
line 53; replace animationsEnabled inputs in
src/elements/common/__tests__/withBlueprintAnimations.test.tsx lines 50-105 and
verify enableBlueprintAnimations is not forwarded to the rendered element.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: d33b4ab9-8aa0-4c19-a746-3baf8b1b850b
⛔ Files ignored due to path filters (1)
src/features/presence/__tests__/__snapshots__/Presence.test.js.snapis excluded by!**/*.snap
📒 Files selected for processing (11)
.storybook/preview.tsxsrc/elements/common/__tests__/withBlueprintAnimations.test.tsxsrc/elements/common/withBlueprintAnimations.tsxsrc/elements/content-explorer/ContentExplorer.tsxsrc/elements/content-picker/ContentPicker.jssrc/elements/content-preview/ContentPreview.jssrc/elements/content-sharing/ContentSharing.jssrc/elements/content-sharing/ContentSharingV2.tsxsrc/elements/content-sidebar/ContentSidebar.jssrc/elements/content-uploader/ContentUploader.tsxsrc/features/presence/PresenceAvatarList.tsx
🚧 Files skipped from review as they are similar to previous changes (8)
- src/elements/content-picker/ContentPicker.js
- src/elements/content-sidebar/ContentSidebar.js
- src/elements/content-sharing/ContentSharingV2.tsx
- src/elements/content-uploader/ContentUploader.tsx
- src/elements/content-preview/ContentPreview.js
- src/elements/content-explorer/ContentExplorer.tsx
- .storybook/preview.tsx
- src/elements/content-sharing/ContentSharing.js
ee33922 to
0bce84c
Compare
Animations will be turned on by default in all elements. Opt out with `animationsEnabled={false}`.
0bce84c to
4ff5fa3
Compare
| } | ||
|
|
||
| export default withBlueprintModernization(ContentSharing); | ||
| export default withBlueprintAnimations(withBlueprintModernization(ContentSharing)); |
There was a problem hiding this comment.
I don't think V2 AND V1 both need the providers right? V1 doesn't have any blueprint components in it. it's just calling v2
There was a problem hiding this comment.
Removed the wrapper from V1 and put it around V2 instead.
| await waitFor(() => { | ||
| expect(screen.getByRole('heading', { name: 'Share ‘Box Development Guide.pdf’' })).toBeVisible(); |
There was a problem hiding this comment.
are you able to just await the expect? or does it actually need the waitFor?
| await waitFor(() => { | |
| expect(screen.getByRole('heading', { name: 'Share ‘Box Development Guide.pdf’' })).toBeVisible(); | |
| await expect(screen.getByRole('heading', { name: 'Share ‘Box Development Guide.pdf’' }).toBeVisible(); |
There was a problem hiding this comment.
Unfortunately await expect won't work because it will find the element but the opacity won't be high enough to count as visible. waitFor will keep retrying until it becomes visible
| * - `false`: all phases off | ||
| * - object: per-phase overrides (omitted keys default on) | ||
| */ | ||
| animationsEnabled?: boolean | BlueprintAnimationPhases; |
There was a problem hiding this comment.
consumers pass this prop in from the root element right?
such as:
<ContentPreview ... animationsEnabled={...} />
if that's the case, I think coderabbits suggestion is better. something like enableBlueprintAnimations:
- it matches the modernization prop
- it specifies that this is specifically for blueprint
Enables Blueprint animations in Elements (Explorer, Picker, Preview, Sidebar, Uploader, Sharing, Presence)
animationsEnabled={false}.animationsEnabled={{ animationsPhase1Enabled: true }}Followup: animations phase 3 is in progress in Blueprint, we should add when they ship it.
Summary by CodeRabbit
New Features
Tests