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

Push intended bounds for empty elements #4359

Merged
merged 54 commits into from
Oct 24, 2023
Merged

Push intended bounds for empty elements #4359

merged 54 commits into from
Oct 24, 2023

Conversation

ruggi
Copy link
Contributor

@ruggi ruggi commented Oct 11, 2023

Fixes #4364

Problem:

This PR extends the true up logic so that it goes beyond just group bounds.

For reviewers: the majority of the diff is just renames, while the actual logic changes happening in editor/src/components/canvas/commands/push-intended-bounds-and-update-targets-command.ts, editor/src/components/editor/actions/actions.tsx, and editor/src/core/model/true-up-targets.ts (plus the tests).

What this does:

  1. Introduce a PushIntendedBoundsTarget to discriminate between different targets: currently, groups and hugging elements
  2. Split the logic of the runPushIntendedBoundsAndUpdateTargets into multiple steps, one for each type of PushIntendedBoundsTarget. The new commands are triggered by TRUE_UP_ELEMENTS (renamed from TRUE_UP)
  3. For groups, nothing changed
  4. For hugging elements, if they are
    • empty, and
    • they don't cascade-delete, and
    • they are not fragments/groups, and
    • they are hugging
      → set their x/y/w/h so that they match the last non-empty bounds.

Notes:
The explicit use of a _group type is more for backwards compatibility and in the future it could make sense to extend it to any element that can behave like a group, but for now I think it's fine to have it like that so it's clear what's being changed.

@github-actions
Copy link
Contributor

github-actions bot commented Oct 11, 2023

Try me

@relativeci
Copy link

relativeci bot commented Oct 11, 2023

Job #8825: Bundle Size — 63.66MiB (+0.04%).

6ea21c1(current) vs 5957b21 master#8824(baseline)

Warning

Bundle contains 64 duplicate packages – View duplicate packages

Bundle metrics  Change 3 changes Regression 2 regressions
                 Current
Job #8825
     Baseline
Job #8824
Regression  Initial JS 35.94MiB(+0.06%) 35.92MiB
No change  Initial CSS 0B 0B
No change  Cache Invalidation 20.01% 20.01%
No change  Chunks 28 28
No change  Assets 32 32
Change  Modules 4016(+0.05%) 4014
Regression  Duplicate Modules 455(+0.22%) 454
No change  Duplicate Code 31.45% 31.45%
No change  Packages 409 409
No change  Duplicate Packages 64 64
Bundle size by type  Change 1 change Regression 1 regression
                 Current
Job #8825
     Baseline
Job #8824
Regression  JS 63.65MiB (+0.04%) 63.63MiB
Not changed  HTML 11.54KiB 11.54KiB

View job #8825 reportView feat/true-up-empty branch activity

@github-actions
Copy link
Contributor

github-actions bot commented Oct 11, 2023

Performance test results:
(Chart1)
(Chart2)

@ruggi ruggi marked this pull request as ready for review October 12, 2023 13:08
@ruggi ruggi marked this pull request as draft October 23, 2023 09:04
ruggi added 11 commits October 23, 2023 11:04
# Conflicts:
#	editor/src/components/canvas/canvas-strategies/strategies/convert-to-absolute-and-move-strategy.tsx
#	editor/src/components/canvas/commands/push-intended-bounds-and-update-targets-command.ts
@github-actions
Copy link
Contributor

Performance test results:

@github-actions
Copy link
Contributor

Performance test results:

@ruggi ruggi marked this pull request as ready for review October 23, 2023 11:30
@ruggi ruggi merged commit eba413e into master Oct 24, 2023
12 checks passed
@ruggi ruggi deleted the feat/true-up-empty branch October 24, 2023 10:12
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.

Don't shrink dynamic containers when becoming empty
4 participants