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

Convert group child percentage pins to pixel based pins. #4314

Merged
merged 1 commit into from
Oct 4, 2023

Conversation

seanparsons
Copy link
Contributor

Fixes #4299

Problem:
Percentage based pins for the children of a group don't really make any sense.

Fix:
In the following cases we now replace the pins of the children of a group with pixel based pins regardless of whatever they had before:

  • When creating a group around some existing elements.
  • When adjusted the size of a group, which in turn updates properties on the children.

Should a percentage based pin be replaced in this way, we show a toast indicating that one or more of those has been replaced.

Commit Details:

  • Added whenReplacingPercentageValues property to SetCssLengthProperty.
  • runSetCssLengthProperty now adds an appropriate toast when replacing a percentage based property and when it is instructed to warn in this particular case.
  • setElementPins now replaces the children's pin values with pixel based ones in all cases regardless of what was there before.
  • runPushIntendedBoundsAndUpdateGroups ensures that any toasts are carried forward in the editor state patch.
  • The patching part of runShowToastCommand has been extracted into a utility function addToastPatch.

- Added `whenReplacingPercentageValues` property to `SetCssLengthProperty`.
- `runSetCssLengthProperty` now adds an appropriate toast when
  replacing a percentage based property and when it is instructed to
  warn in this particular case.
- `setElementPins` now replaces the children's pin values with pixel based ones
  in all cases regardless of what was there before.
- `runPushIntendedBoundsAndUpdateGroups` ensures that any toasts are carried
  forward in the editor state patch.
- The patching part of `runShowToastCommand` has been extracted into a utility
  function `addToastPatch`.
@@ -265,7 +265,7 @@ describe('Keyboard Absolute Resize E2E', () => {
})
})

it('keeps trueuing up groups as directions change', async () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

haha it's like queueing but trueueing

@github-actions
Copy link
Contributor

github-actions bot commented Oct 4, 2023

Try me

@relativeci
Copy link

relativeci bot commented Oct 4, 2023

Job #8415: Bundle Size — 62.81MiB (~+0.01%).

7ab15f2(current) vs 5957b21 master#8413(baseline)

Warning

Bundle contains 64 duplicate packages - View duplicate packages

Bundle metrics (2 changes)
                 Current
Job #8415
     Baseline
Job #8413
Initial JS 35.08MiB(~+0.01%) 35.08MiB
Initial CSS 0B 0B
Cache Invalidation 19.37% 0%
Chunks 27 27
Assets 31 31
Modules 3974 3974
Duplicate Modules 425 425
Duplicate Code 30.92% 30.92%
Packages 409 409
Duplicate Packages 64 64
Bundle size by type (1 change)
                 Current
Job #8415
     Baseline
Job #8413
CSS 0B 0B
Fonts 0B 0B
HTML 11.43KiB 11.43KiB
IMG 0B 0B
JS 62.8MiB (~+0.01%) 62.8MiB
Media 0B 0B
Other 0B 0B

View job #8415 reportView feature/convert-group-child-perc... branch activity

@github-actions
Copy link
Contributor

github-actions bot commented Oct 4, 2023

Performance test results:
(Chart1)
(Chart2)

@seanparsons seanparsons merged commit 0c140fb into master Oct 4, 2023
@seanparsons seanparsons deleted the feature/convert-group-child-percentage-pins branch October 4, 2023 13:43
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.

If a group child has a size of 100% then the group handling breaks.
3 participants