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

Grids: presetve repeat from inspector changes #6388

Merged
merged 4 commits into from
Sep 19, 2024

Conversation

ruggi
Copy link
Contributor

@ruggi ruggi commented Sep 18, 2024

Problem:

As a followup to #6380 , we should preserve repeat functions & co. when altering the grid template from the inspector inputs too.

Fix:

  1. Factored out the logic to alter a table from the resize strategy to helper functions in grid-helpers.ts
  2. Adjusted the logic to support removing elements too
  3. Refactored the callbacks in the inspector section to use the new helpers

Fixes #6387

Copy link
Contributor

github-actions bot commented Sep 18, 2024

Try me

Copy link

relativeci bot commented Sep 18, 2024

#14293 Bundle Size — 62.65MiB (-0.14%).

c769e59(current) vs 916e8b9 master#14274(baseline)

Warning

Bundle contains 70 duplicate packages – View duplicate packages

Bundle metrics  Change 5 changes Improvement 2 improvements
                 Current
#14293
     Baseline
#14274
Improvement  Initial JS 45.78MiB(-0.19%) 45.86MiB
No change  Initial CSS 0B 0B
Change  Cache Invalidation 22.47% 22.36%
No change  Chunks 30 30
No change  Assets 33 33
Change  Modules 4382(-0.09%) 4386
Improvement  Duplicate Modules 520(-0.76%) 524
Change  Duplicate Code 31.62%(-0.19%) 31.68%
No change  Packages 472 472
No change  Duplicate Packages 70 70
Bundle size by type  Change 2 changes Improvement 2 improvements
                 Current
#14293
     Baseline
#14274
Improvement  JS 62.64MiB (-0.14%) 62.73MiB
Improvement  HTML 11.12KiB (-0.32%) 11.16KiB

Bundle analysis reportBranch feat/grid-resize-keep-repeat-ins...Project dashboard


Generated by RelativeCIDocumentationReport issue

@@ -207,51 +190,6 @@ export const resizeGridStrategy: CanvasStrategyFactory = (
}
}

type DimensionIndexes = {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

all this stuff now lives in grid-hepers.ts

@ruggi ruggi marked this pull request as ready for review September 18, 2024 16:31
@ruggi ruggi changed the title Keep repeat from inspector changes Grids: presetve repeat from inspector changes Sep 18, 2024
type: 'REMOVE'
}

export type AlterGridTemplateDimensionAction =
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't really like the Action terminology, we use that for our dispatchable actions, someone would easily think these actions are EditorActions too.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ah good point

}, [] as ExpandedGridDimension[])
}

function alterGridDimensions(params: {
Copy link
Contributor

Choose a reason for hiding this comment

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

This function does not generally alters the grid dimensions, but it alters the repeats, I would express this in the name

Copy link
Contributor Author

Choose a reason for hiding this comment

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

it does alter them, you can replace or remove any dimension, not just repeats.

@ruggi ruggi merged commit 96795b0 into master Sep 19, 2024
14 checks passed
@ruggi ruggi deleted the feat/grid-resize-keep-repeat-inspector branch September 19, 2024 14:26
liady pushed a commit that referenced this pull request Dec 13, 2024
**Problem:**

As a followup to #6380 , we should preserve `repeat` functions & co.
when altering the grid template from the inspector inputs too.

**Fix:**

1. Factored out the logic to alter a table from the resize strategy to
helper functions in `grid-helpers.ts`
2. Adjusted the logic to support removing elements too
3. Refactored the callbacks in the inspector section to use the new
helpers

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

Keep repeats when editing grid templates via the inspector
3 participants