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

Correctly Aligned Grid Controls #6484

Merged
merged 4 commits into from
Oct 9, 2024

Conversation

seanparsons
Copy link
Contributor

@seanparsons seanparsons commented Oct 7, 2024

Problem:
It was initially found that adding alignContent: 'center' causes a skew in the placeholder boundaries, but this also affects the resize handles.

Fix:
This involves several fixes:

  • Changing out border for outline in GridControl so that it would not affect the content held within and removed the slight shifting of that element to cater for the border.
  • Supply an appropriate type for alignContent as there are values which were being filtered out.

Before:
image

After:
image

Commit Details:

  • alignContent in getSpecialMeasurements now isn't filtered by getFlexJustifyContent.
  • Added justifyContent and alignContent to GridResizingProps.
  • In GridResizing, the main div now includes paddingRight, paddingBottom,
    justifyContent and alignContent.
  • GridControl now uses range to build the placeholders value.
  • Removed position shifting from GridControl and changed the border to
    an outline as those were causing the content to be repositioned.
  • Added range utility function.
  • SpecialSizeMeasurements.alignContent is now typed to AlignContent | null instead
    of FlexJustifyContent | null as that is more correct.

Manual Tests:
I hereby swear that:

  • I opened a hydrogen project and it loaded
  • I could navigate to various routes in Play mode

- `alignContent` in `getSpecialMeasurements` now isn't filtered by `getFlexJustifyContent`.
- Added `justifyContent` and `alignContent` to `GridResizingProps`.
- In `GridResizing`, the main div now includes `paddingRight`, `paddingBottom`,
  `justifyContent` and `alignContent`.
- `GridControl` now uses `range` to build the `placeholders` value.
- Removed position shifting from `GridControl` and changed the `border` to
  an `outline` as those were causing the content to be repositioned.
- Added `range` utility function.
- `SpecialSizeMeasurements.alignContent` is now typed to `string | null` instead
  of `FlexJustifyContent | null` as that type is wildly incorrect.
Copy link
Contributor

github-actions bot commented Oct 7, 2024

Try me

Copy link

relativeci bot commented Oct 7, 2024

#14669 Bundle Size — 57.74MiB (~+0.01%).

57a6a40(current) vs 916e8b9 master#14667(baseline)

Warning

Bundle contains 70 duplicate packages – View duplicate packages

Bundle metrics  Change 2 changes Regression 1 regression
                 Current
#14669
     Baseline
#14667
Regression  Initial JS 40.74MiB(~+0.01%) 40.74MiB
No change  Initial CSS 0B 0B
Change  Cache Invalidation 18.84% 17.95%
No change  Chunks 21 21
No change  Assets 23 23
No change  Modules 4113 4113
No change  Duplicate Modules 213 213
No change  Duplicate Code 27.41% 27.41%
No change  Packages 475 475
No change  Duplicate Packages 70 70
Bundle size by type  Change 2 changes Regression 1 regression Improvement 1 improvement
                 Current
#14669
     Baseline
#14667
Regression  JS 57.73MiB (~+0.01%) 57.73MiB
Improvement  HTML 7.37KiB (-0.25%) 7.39KiB

Bundle analysis reportBranch fix/correctly-aligned-grid-contr...Project dashboard


Generated by RelativeCIDocumentationReport issue

@seanparsons seanparsons marked this pull request as ready for review October 7, 2024 13:06
@seanparsons seanparsons requested a review from liady October 7, 2024 13:06
@@ -892,19 +908,19 @@ export const GridControl = React.memo<GridControlProps>(({ grid }) => {
gridPath: gridPath,
})

const placeholders = Array.from(Array(grid.cells).keys())
const placeholders = range(0, grid.cells)
Copy link
Contributor

Choose a reason for hiding this comment

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

🪄

@seanparsons seanparsons merged commit 9dce309 into master Oct 9, 2024
3 checks passed
@seanparsons seanparsons deleted the fix/correctly-aligned-grid-controls branch October 9, 2024 12:53
liady pushed a commit that referenced this pull request Dec 13, 2024
- `alignContent` in `getSpecialMeasurements` now isn't filtered by
`getFlexJustifyContent`.
- Added `justifyContent` and `alignContent` to `GridResizingProps`.
- In `GridResizing`, the main div now includes `paddingRight`,
`paddingBottom`,
  `justifyContent` and `alignContent`.
- `GridControl` now uses `range` to build the `placeholders` value.
- Removed position shifting from `GridControl` and changed the `border`
to
  an `outline` as those were causing the content to be repositioned.
- Added `range` utility function.
- `SpecialSizeMeasurements.alignContent` is now typed to `AlignContent |
null` instead
  of `FlexJustifyContent | null` as that is more correct.
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.

4 participants