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

Remove .components-item-group selector in edit-site components[2] #67575

Merged
merged 3 commits into from
Dec 8, 2024

Conversation

im3dabasia
Copy link
Contributor

Fixes: #67369

What

The .components-item-group selector has been replaced with a custom class (.edit-site-sidebar-navigation-screen__item-group) that is scoped specifically to the sidebar navigation screen.

This change does not affect other components outside of the sidebar navigation screen and will prevent unintended side effects if the ItemGroup component is used elsewhere in the future.

As requested in the earlier PR now closed (#67384), to apply horizontal negative margins in 4 more places (Reference)

  1. Navigation
  2. Pages
  3. Templates
  4. Patterns

Screenshots

Screenshot 2024-12-04 at 6 33 57 PM

Screenshots of the negatively applied margins.

Navigation Screen
Picture 1

Pages Screen
Picture 2

Templates Screen
Picture 3

Patterns Screen
Picture 4

… in edit-site components

Applied horizontal margins to the following screens
1. Navigation
2. Pages
3. Templates
4. Patterns
@im3dabasia im3dabasia marked this pull request as ready for review December 4, 2024 13:27
Copy link

github-actions bot commented Dec 4, 2024

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: im3dabasia <[email protected]>
Co-authored-by: t-hamano <[email protected]>
Co-authored-by: afercia <[email protected]>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@im3dabasia
Copy link
Contributor Author

Hi @t-hamano ,

If you have a moment, could you please review my PR? I would really appreciate your feedback.

Thank you so much!

@t-hamano t-hamano added [Type] Code Quality Issues or PRs that relate to code quality [Package] Edit Site /packages/edit-site labels Dec 7, 2024
Copy link
Contributor

@t-hamano t-hamano left a comment

Choose a reason for hiding this comment

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

Thanks for the PR!

Sorry, maybe my explanation in #67384 was insufficient. Can you just do the following two things?

  • Create a new packages/edit-site/src/components/sidebar-navigation-screen-templates-browse/style.scss file and move the following styles into it:
    .edit-site-sidebar-navigation-screen-templates-browse {
    	margin-left: -$grid-unit-20;
    	margin-right: -$grid-unit-20;
    }
  • Rearrange the import statements in the packages/edit-site/src/style.scss file. It's a good idea to group import statements with the sidebar-navigation-screen prefix:
    @import "./components/sidebar-navigation-screen/style.scss";
    @import "./components/sidebar-navigation-screen-details-footer/style.scss";
    @import "./components/sidebar-navigation-screen-navigation-menu/style.scss";
    @import "./components/sidebar-navigation-screen-patterns/style.scss";
    @import "./components/sidebar-navigation-screen-main/style.scss";
    @import "./components/sidebar-navigation-screen-templates-browse/style.scss";

@im3dabasia
Copy link
Contributor Author

Thank you @t-hamano ,

I’ve addressed both of the changes you requested. Please review the updated work when you have a moment.

  • Rearrange the import statements in the packages/edit-site/src/style.scss file. It's a good idea to group import statements with the sidebar-navigation-screen prefix:

There was one more file

@import "./components/sidebar-navigation-screen-navigation-menus/style.scss";

Since it shares the same sidebar-navigation-screen prefix, I’ve moved it accordingly as well.

Looking forward to your feedback!

@im3dabasia im3dabasia requested a review from t-hamano December 7, 2024 09:39
Copy link
Contributor

@t-hamano t-hamano left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks for working with it through to the end 👍

Note: Native E2E test failures are not related to this PR. See #67595

@t-hamano t-hamano merged commit 7cf1ced into WordPress:trunk Dec 8, 2024
61 of 63 checks passed
@github-actions github-actions bot added this to the Gutenberg 19.9 milestone Dec 8, 2024
@afercia
Copy link
Contributor

afercia commented Dec 11, 2024

@im3dabasia @t-hamano looks like the ItemGroup in the first level of the navigation panel isn't aligned correctly and misses the negative margins. Can you please have a look at it? Screenshot from latest trunk:

Screenshot 2024-12-11 at 09 54 48

@im3dabasia
Copy link
Contributor Author

Hi @afercia,

I checked the latest trunk, and the negative margins are applied correctly on my end. I’ve attached a screenshot for reference.

image

@afercia
Copy link
Contributor

afercia commented Dec 11, 2024

@im3dabasia based on your screenshot, the negative margins are applied to the .components-item-group selector. That is not used any longer on latest trunk. Avoiding the usage of components-item-group was the whole point of this PR so I'm not sure you're looking at the actual latest trunk.

@im3dabasia
Copy link
Contributor Author

Yeah @afercia , I had the latest trunk version, I restarted the repo and then checked and yes what you claim holds true. The negative margins are not applied in the 'Design' menu.

I'll work on this right away.

@t-hamano
Copy link
Contributor

Thanks for noticing. This issue is a regression introduced by #66851. Just adding the edit-site-sidebar-navigation-screen-main CSS class here should solve it.

@im3dabasia I'll be happy to review your PR.

@im3dabasia
Copy link
Contributor Author

@afercia,

It looks like the issue occurred due to this commit which was merged recently, where the className="edit-site-sidebar-navigation-screen-main" I introduced in was removed. This seems to have caused the negative margins not to apply.

Here's the relevant diff.

Would it be helpful if I opened a new PR to reintroduce the className, or is there a different approach you would prefer to resolve this?

@im3dabasia
Copy link
Contributor Author

@im3dabasia I'll be happy to review your PR.

Sure @t-hamano , I'll raise a new PR and cc you ASAP.

@afercia
Copy link
Contributor

afercia commented Dec 11, 2024

It looks like the issue occurred due to this commit which was merged recently,

Yes thanks, I do see that commit removed the newsly added class. Please do feel free to raise a quick PR to re-add it and kindly reference this PR and #66851 in your new PR, thanks!

@im3dabasia
Copy link
Contributor Author

@afercia , Here is the link to the new PR #67825

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Package] Edit Site /packages/edit-site [Type] Code Quality Issues or PRs that relate to code quality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remove usage of .components-item-group CSS selector from edit-site components
3 participants