-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Style panel: use correct revisions count #67180
Style panel: use correct revisions count #67180
Conversation
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 If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.
To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
Size Change: -38 B (0%) Total Size: 1.82 MB
ℹ️ View Unchanged
|
Flaky tests detected in 7855cda. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/11943584777
|
packages/edit-site/src/components/sidebar-navigation-screen-details-footer/index.js
Outdated
Show resolved
Hide resolved
packages/edit-site/src/components/sidebar-navigation-screen-details-footer/index.js
Outdated
Show resolved
Hide resolved
packages/edit-site/src/components/sidebar-navigation-screen-global-styles/index.js
Outdated
Show resolved
Hide resolved
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.
Thanks for looking into this @ramonjd. It fixes the bug. I left a few comments about a few things to check.
packages/edit-site/src/components/sidebar-navigation-screen-global-styles/index.js
Outdated
Show resolved
Hide resolved
…to the footer component. This allows us to remove the globalstyle record selector.
7855cda
to
409b9a3
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.
LGTM
Thanks for the feedback and testing @afercia |
This allows us to remove the globalstyle record selector.
What?
For the styles panel
<SidebarNavigationScreenGlobalStyles />
component, send the correct recordCount via optional prop to the footer component<SidebarNavigationScreenDetailsFooter />
.Props to @afercia for catching it over in #66606 (comment)
Why?
<SidebarNavigationScreenGlobalStyles />
was passing a revision record to<SidebarNavigationScreenDetailsFooter />
. Revision records do not contain a_links
object, and therefore the record history count is not accessible.How?
Pass the correct revisionsCount to the component.
Testing Instructions
The record count for global revisions is not actually used in the side panel, so the way to test is it to log out the revisionsCount in
<SidebarNavigationScreenDetailsFooter />
.Create a few global styles revisions by editing a theme's global styles and saving.
The open up the left-hand style panel in the site editor.
Check the
revisionsCount
in the console.Then click on the "Last modified link" to open revisions in the editor. The number in the revisions pane should match.