-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Try: Sticky header and pagination on Patterns page #52663
Conversation
bbf5c91
to
e520e9e
Compare
Size Change: +107 B (0%) Total Size: 1.44 MB
ℹ️ View Unchanged
|
I was thinking about putting a similar PR together myself ❤️ How do you feel about making the pagination controls sticky too? |
Thanks for the advice! I had forgotten about the pagination 😅 Updated PR and fixed pagination. d747056db2b4db5f3e76dc3f4094e025.mp4 |
border: 1px solid $gray-800; | ||
border-left: 1px solid $gray-800; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I could not get the save button and pagination height to match exactly when there is a 1px border across the entire pattern canvas. Therefore, I applied the border only to the left side.
// Small top padding required to avoid cutting off the visible outline | ||
// when hovering items. | ||
padding-top: $border-width-focus-fallback; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In this PR, the pattern list has enough padding so this small padding should be unnecessary.
Sorry for that distraction, but buttons should all be either 32px or 40px, the save button needs updating (separately). I think we can still line everything up by using the right padding values, or |
I see. In principle, that means it should be a multiple of 8, right? In order to match the current save button height, it was necessary to use math.div, but in 40fa2db, the size of the pagination button was returned to 32px. |
Flaky tests detected in 7600e90. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/5599387118
|
@t-hamano apologies for the detour here. Since the save area dimensions are 'incorrect' due to the 36px button, we shouldn't align the pagination with that afterall. That's probably a detail to tackle separately – fix the save button height, and adjust the pagination spacing. For now we can probably revert the last couple of commits and go back to the design you had here (#52663 (comment)). Then I think we're good to get more reviews. Apologies again! |
Thank you for your detailed explanation. So in this PR, is it okay if we don't force the height to fit the incorrect save button area? |
Yes that's correct. We can do that in a follow-up PR :) |
Updated! Currently, the heights are:
Whether the height of the save button changes to 32px or 40px, I think we can adjust the height with padding. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This tested well for me - this is a great change, thanks for implementing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was looking forward to seeing this polish being added to the Patterns page. Nice work @t-hamano ✨
Tests well for me also.
Whether the height of the save button changes to 32px or 40px, I think we can adjust the height with padding.
Is it worth making this tweak now, so until the save button height is updated things align? The misalignment does stick out a little awkwardly.
I think it's probably okay to proceed, if we follow-up quickly to address the alignment in a new PR. Do you have bandwidth to work on that @t-hamano? If not I can probably take a look. |
Thank you all for your reviews and feedback!
Yes, I will merge this PR as I will submit a follow-up PR soon. |
Closes: #52431
What?
This PR sticks the header (pattern category title, pattern category description, search box, and sync statues) on the Patterns page of the Site Editor so that they are not affected by scrolling.
edit: Additionally, I fixed the pagination as well.
Why?
In the Site Editor's left sidebar navigation and template (parts) list pages, the header and title sections are fixed and are not affected by scrolling. Similarly, I believe that fixing the header on the pattern list page will make it easier to filter patterns and switch between synced categories.
I would appreciate your input on whether this change makes sense.
How?
This PR makes no changes to the logic of the component. Just added some wrap elements to achieve Sticky Header and added some styles.
edit: To fix pagination, I also split and moved components.
Screenshots or screencast
Desktop view
desktop.mp4
Mobile view
mobile.mp4