-
Notifications
You must be signed in to change notification settings - Fork 172
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
Convert to grid #6097
Convert to grid #6097
Conversation
#13506 Bundle Size — 62.63MiB (+0.03%).
Warning Bundle contains 70 duplicate packages – View duplicate packages Bundle metrics
|
Current #13506 |
Baseline #13497 |
|
---|---|---|
Initial JS | 45.7MiB (+0.04% ) |
45.68MiB |
Initial CSS | 0B |
0B |
Cache Invalidation | 22.18% |
21.51% |
Chunks | 31 |
31 |
Assets | 34 |
34 |
Modules | 4380 (+0.09% ) |
4376 |
Duplicate Modules | 525 (+0.38% ) |
523 |
Duplicate Code | 31.65% |
31.65% |
Packages | 469 |
469 |
Duplicate Packages | 70 |
70 |
Bundle size by type 2 changes
1 regression
1 improvement
Current #13506 |
Baseline #13497 |
|
---|---|---|
JS | 62.62MiB (+0.03% ) |
62.6MiB |
HTML | 11.16KiB (-0.33% ) |
11.2KiB |
Bundle analysis report Branch feature/convert-to-grid Project dashboard
editor/src/components/inspector/inspector-strategies/inspector-strategies.ts
Outdated
Show resolved
Hide resolved
editor/src/components/common/shared-strategies/convert-to-grid-strategy.ts
Show resolved
Hide resolved
…-strategies.ts Co-authored-by: Federico Ruggi <[email protected]>
Uploading an icon for the "Do Nothing" strategy <img width="598" alt="Screenshot 2024-07-23 at 11 02 13 AM" src="https://github.com/user-attachments/assets/e0602353-2f35-4066-8719-3a6b3fa9fa14">
} | ||
} | ||
|
||
function guessMatchingGridSetup(children: Array<CanvasFrameAndTarget>): { |
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.
I think this should also have a logic branch so that it makes sure that the combined number of resulting cells is >=
than the number of children. For example if you have N children resulting from duplication, all having the exact same coordinates, the resulting grid template would be incorrect (e.g. 1x1 instead of 1xN)
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.
Discussed on a side channel, I'll implement this on a separate PR because that way we'll have a holistic overview of the convert-to-grid strategy
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.
keeping this unresolved so we can find it quickly later
editor/src/components/common/shared-strategies/convert-strategies-common.ts
Outdated
Show resolved
Hide resolved
…ies-common.ts Co-authored-by: RheeseyB <[email protected]>
editor/src/components/common/shared-strategies/convert-to-grid-strategy.ts
Show resolved
Hide resolved
const detectedLayoutSystems = selectedViews.map( | ||
(path) => | ||
MetadataUtils.findElementByElementPath(metadata, path)?.specialSizeMeasurements | ||
.layoutSystemForChildren ?? null, |
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.
Should this return 'none'
rather than null
? I'm genuinely unsure
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.
Completely fair question, I added the ?? null
to remove the | undefined
from the type of specialSizeMeasurements.layoutSystemForChildren
to make it a less noisy type. I didn't add 'none'
to make the type of detectedLayoutSystems
similar to what we'd get if we checked specialSizeMeasurements.layoutSystemForChildren
for a single element. The default value might as well be 'none'
(it wouldn't matter for the downstream checks), but I didn't want to get creative and wanted to stick to the "spirit" of specialSizeMeasurements.layoutSystemForChildren
## Description This PR adds a basic convert-to-grid strategy, makes the flex <-> grid toggle work again, and turns the layout system + button into a menu-on-button where on can pick between grid or flex ### Details/breakdown - add the convert-to-grid strategy (and a remove grid strategy) - make the flex <-> grid toggle work again - add the menu-on-button to choose between grid and flex - add a shortcut that turns a layout into a grid - expose a prop on the radix-based dropdown to align the dropdown element relative to the opener - update tests --------- Co-authored-by: Federico Ruggi <[email protected]> Co-authored-by: McKayla Lankau <[email protected]> Co-authored-by: RheeseyB <[email protected]>
Description
This PR adds a basic convert-to-grid strategy, makes the flex <-> grid toggle work again, and turns the layout system + button into a menu-on-button where on can pick between grid or flex
Details/breakdown