-
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
Global styles revisions: add pagination #56799
Conversation
Size Change: +644 B (0%) Total Size: 1.71 MB
ℹ️ View Unchanged
|
Flaky tests detected in cc20a31. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/7282037588
|
0a671f7
to
0eef736
Compare
0a61895
to
c11233f
Compare
packages/edit-site/src/components/global-styles/screen-revisions/index.js
Show resolved
Hide resolved
5d90667
to
5556a41
Compare
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.
Few thoughts here so far.
I think we should keep the button on each revision as "Apply", and as the primary color button. Definitely keep the spacing and sizing the same a other buttons and in alignment:
Others may want it as a secondary button or a link, but I think this will get us moving forward for now..
Also, the pagination I think should always stick to the bottom of the window, and not creep up if there are a smaller number of revisions:
Finally, let's make the pagination look like Joen's example here, so no outlines (include the extra arrows):
b54c599
to
d4be421
Compare
Thanks for the review @apeatling I think I've addressed the points above. |
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.
Visually this is looking way better, very nice!
I ran into a couple of bugs that I don't remember being present previously.
- A couple of my revisions don't have an Apply button.
- The pagination numbering is not changing
Screen.Recording.2023-12-18.at.8.02.13.PM.mov
I'll double check, but I suspect they won't have an apply button because they match the styles already loaded in the editor. I think in a previous commit I had some text in these items e.g.,
Hmm, I can't replicate this (yet). I have tried with 14 Revisions — the same number as that in your screencast — and 20+. |
I think we need something there, it felt broken without it. |
Happy to debug the pagination issue tomorrow. I did try a fresh build of the branch but it was the same. I will try nuking it tomorrow to see if that fixes it. |
I think a disabled Apply button, along with the text below in a smaller font "These changes match the current editor styles" would do it? |
Agree that we need something. I'll throw up a commit 👍🏻 |
Holy smokes! Good catch. I'll fix that. |
00710e7
to
b8a000e
Compare
@@ -101,11 +101,11 @@ | |||
} | |||
|
|||
.edit-site-sidebar-fixed-bottom-slot { | |||
position: sticky; | |||
position: absolute; |
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.
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.
Nice work on this @ramonjd! I think the code looks good to me so giving this one a ✅
Fudge the button
Creating an internal state for revisions to avoid refreshing
Shifting "Apply" button to the single item so that we don't have to deal with it being next to the pagination row.
Restyle apply button Reinstate fixed bottom slot
added pagination tests
8edc3ca
to
cc20a31
Compare
Resolves #53621
Part of:
What?
Now that we have a revisions API in Core Data, let's add paginated results to global styles revisions!
Uploading 2023-12-19 15.40.44.mp4…
Why?
Good question. Because currently, there is a hard limit of 100 results for global styles revisions coming straight from the REST response.
Paginated results not only reduces the amount of space revisions take up in the sidebar, but allows users to access any number of revisions.
How?
per_page
andpage
values touseGlobalStylesRevisions()
to get paginated results.Testing Instructions
Requires a block theme like 2024.
In the Site Editor:
Because I've abstracted the pagination component from the Patterns page, check that there are no regressions between trunk and this PR:
Testing Instructions for Keyboard
It should be possible to tab down the revision items and access the pagination navigation buttons.
TODO
shouldShowRevisions