-
Notifications
You must be signed in to change notification settings - Fork 171
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feat/animate grid #6046
Feat/animate grid #6046
Conversation
# Conflicts: # editor/src/components/canvas/controls/grid-controls.tsx
#13296 Bundle Size — 62.6MiB (+0.15%).
Warning Bundle contains 51 duplicate packages – View duplicate packages Bundle metrics
|
Current #13296 |
Baseline #13292 |
|
---|---|---|
Initial JS | 45.66MiB (+0.2% ) |
45.57MiB |
Initial CSS | 0B |
0B |
Cache Invalidation | 23.87% |
21.61% |
Chunks | 30 |
30 |
Assets | 33 |
33 |
Modules | 4349 (+0.6% ) |
4323 |
Duplicate Modules | 524 |
524 |
Duplicate Code | 31.72% (-0.06% ) |
31.74% |
Packages | 450 |
450 |
Duplicate Packages | 51 |
51 |
Bundle size by type 2 changes
1 regression
1 improvement
Current #13296 |
Baseline #13292 |
|
---|---|---|
JS | 62.59MiB (+0.15% ) |
62.5MiB |
HTML | 11.16KiB (-0.33% ) |
11.2KiB |
Bundle analysis report Branch feat/animate-grid Project dashboard
this is super slick. well done 👏 |
@@ -1479,7 +1479,8 @@ describe('record variable values', () => { | |||
}) | |||
|
|||
describe('specialSizeMeasurements.globalFrameWithTextContent', () => { | |||
it('includes the size of a contained text node', async () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cc @seanparsons for future reference
# Conflicts: # editor/src/core/model/element-metadata.spec.browser2.tsx
@@ -516,7 +519,7 @@ export const EditorComponentInner = React.memo((props: EditorProps) => { | |||
overflowX: 'hidden', | |||
}} | |||
> | |||
<DesignPanelRoot /> | |||
<DesignPanelRoot animationScope={props.animationScope} /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why the prop drilling here? couldn't / shouldn't this be in a context? is props.animationScope referentially stable?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what about this b60e41e ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👨🎨
**Problem:** When rearranging grid elements, they should animate along the X/Y axii to indicate the completed movement. Moreover, we don't have a way to animate rendered canvas elements. **Fix:** This PR introduces a way to animate canvas elements programmatically, without having to inject anything inside the rendered components themselves. After doing that, the PR uses the new logic to animate the grid rearrange as a first test subject. The goal is to be able to arbitrarily animate canvas elements using the same framer motion API we use elsewhere, explicitly. In order to avoid manipulating the rendered elements, the targeting capabilities of `useAnimate` are used here. 1. Create the animation scope and animation function with `useAnimate` 2. Connect the scope with the `DesignPanelRoot` component 3. Store the animation function in a new `AnimationContext` context 4. `useCanvasAnimation` can now be used to target specific canvas elements and animate them, selecting them from the DOM by their `data-uid` prop 5. 🎈 https://github.com/concrete-utopia/utopia/assets/1081051/ab70b016-a91b-47f8-95ec-bec00bdca838
Problem:
When rearranging grid elements, they should animate along the X/Y axii to indicate the completed movement.
Moreover, we don't have a way to animate rendered canvas elements.
Fix:
This PR introduces a way to animate canvas elements programmatically, without having to inject anything inside the rendered components themselves. After doing that, the PR uses the new logic to animate the grid rearrange as a first test subject.
The goal is to be able to arbitrarily animate canvas elements using the same framer motion API we use elsewhere, explicitly. In order to avoid manipulating the rendered elements, the targeting capabilities of
useAnimate
are used here.useAnimate
DesignPanelRoot
componentAnimationContext
contextuseCanvasAnimation
can now be used to target specific canvas elements and animate them, selecting them from the DOM by theirdata-uid
propUntitled.mov