Skip to content
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

Keep span when reordering grid items #6642

Merged
merged 5 commits into from
Nov 14, 2024
Merged

Keep span when reordering grid items #6642

merged 5 commits into from
Nov 14, 2024

Conversation

ruggi
Copy link
Contributor

@ruggi ruggi commented Nov 14, 2024

Problem:

Spans (or otherwise 1+ sized elements) are not preserved when using gridReorderStrategy.

Fix:

When running the reorder strategy, instead of nuking all positioning props only nuke the ones which are not used and, for elements that occupy multiple cells, set the respective width or height using the span syntax on the correct shorthand.

I also took this chance to move the reorder tests to their own file (and added the new tests there).

Fixes #6641

Copy link
Contributor

github-actions bot commented Nov 14, 2024

Try me

Copy link

relativeci bot commented Nov 14, 2024

#15140 Bundle Size — 58.08MiB (~+0.01%).

092c1fe(current) vs d1d46c1 master#15133(baseline)

Warning

Bundle contains 70 duplicate packages – View duplicate packages

Bundle metrics  Change 2 changes Regression 1 regression
                 Current
#15140
     Baseline
#15133
Regression  Initial JS 41.05MiB(~+0.01%) 41.05MiB
No change  Initial CSS 0B 0B
Change  Cache Invalidation 18.13% 18.54%
No change  Chunks 20 20
No change  Assets 22 22
No change  Modules 4169 4169
No change  Duplicate Modules 213 213
No change  Duplicate Code 27.3% 27.3%
No change  Packages 477 477
No change  Duplicate Packages 70 70
Bundle size by type  Change 2 changes Regression 1 regression Improvement 1 improvement
                 Current
#15140
     Baseline
#15133
Regression  JS 58.07MiB (~+0.01%) 58.07MiB
Improvement  HTML 7.37KiB (-0.25%) 7.39KiB

Bundle analysis reportBranch feat/grid-span-reorderProject dashboard


Generated by RelativeCIDocumentationReport issue

@ruggi ruggi marked this pull request as ready for review November 14, 2024 14:01
const height = gridConfig?.originalCellBounds.height ?? 1

let propsToUpdate: PropertyToUpdate[] = []
propsToUpdate.push(propertyToDelete(PP.create('style', 'gridColumnStart')))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

where are these mutations coming from? 🙂 I think we usually do an array literal with spreads and ternaries to achieve conditional elements

Copy link
Contributor Author

@ruggi ruggi Nov 14, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

they come from what I thought was better readability, but no problem, updated in 092c1fe (#6642)

@ruggi ruggi merged commit 0bd1759 into master Nov 14, 2024
15 checks passed
@ruggi ruggi deleted the feat/grid-span-reorder branch November 14, 2024 15:46
seanparsons pushed a commit that referenced this pull request Nov 18, 2024
**Problem:**

Spans (or otherwise 1+ sized elements) are not preserved when using
`gridReorderStrategy`.

**Fix:**

When running the reorder strategy, instead of nuking all positioning
props only nuke the ones which are not used and, for elements that
occupy multiple cells, set the respective width or height using the
`span` syntax on the correct shorthand.

I also took this chance to move the reorder tests to their own file (and
added the new tests there).

Fixes #6641
liady pushed a commit that referenced this pull request Dec 13, 2024
**Problem:**

Spans (or otherwise 1+ sized elements) are not preserved when using
`gridReorderStrategy`.

**Fix:**

When running the reorder strategy, instead of nuking all positioning
props only nuke the ones which are not used and, for elements that
occupy multiple cells, set the respective width or height using the
`span` syntax on the correct shorthand.

I also took this chance to move the reorder tests to their own file (and
added the new tests there).

Fixes #6641
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.

Preserve span when reordering
3 participants