-
Notifications
You must be signed in to change notification settings - Fork 4.4k
Latest posts: change panel body to tools panel #70200
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
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. |
@t-hamano I'm following up on #67931 that you reopened, the updates are nearly done but there's one item that could not figure out. In the PR notes I have a before and after. When the image size options are wrapping with the |
Size Change: +243 B (+0.01%) Total Size: 1.85 MB
ℹ️ View Unchanged
|
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 the PR!
I've left some feedback, so I'd appreciate it if you could check it.
When the image size options are wrapping with the
ToolsPanelItem
component the spacing between elements is removed and I can't seem to find a solution.
I think this is because the ImageSizeControl
component itself is not suitable for the ToolsPanelItem
component. If #70202 is merged, this problem will be solved.
@t-hamano thanks for the feedback. All changes are made, but I have noticed another issue that I will come back to later today when I have more time. |
Thanks for the update, @troychaplin! I think it's mostly OK.
Can't we solve this by making the following changes? diff --git a/packages/block-library/src/latest-posts/edit.js b/packages/block-library/src/latest-posts/edit.js
index fa958655a1..f92c5ea16c 100644
--- a/packages/block-library/src/latest-posts/edit.js
+++ b/packages/block-library/src/latest-posts/edit.js
@@ -478,8 +478,8 @@ function Controls( { attributes, setAttributes, postCount } ) {
order: 'desc',
orderBy: 'date',
postsToShow: 5,
- categories: [],
- selectedAuthor: '',
+ categories: undefined,
+ selectedAuthor: undefined,
columns: 3,
} )
} |
Unfortunately not @t-hamano, right now when I do a reset the block markup looks like this following, but I haven't had much change to dive back into this one yet though.
|
The changes I suggested were insufficient. How about these changes? diff --git a/packages/block-library/src/latest-posts/edit.js b/packages/block-library/src/latest-posts/edit.js
index fa958655a1..a6224cd2b1 100644
--- a/packages/block-library/src/latest-posts/edit.js
+++ b/packages/block-library/src/latest-posts/edit.js
@@ -478,8 +478,8 @@ function Controls( { attributes, setAttributes, postCount } ) {
order: 'desc',
orderBy: 'date',
postsToShow: 5,
- categories: [],
- selectedAuthor: '',
+ categories: undefined,
+ selectedAuthor: undefined,
columns: 3,
} )
}
@@ -499,8 +499,8 @@ function Controls( { attributes, setAttributes, postCount } ) {
order: 'desc',
orderBy: 'date',
postsToShow: 5,
- categories: [],
- selectedAuthor: '',
+ categories: undefined,
+ selectedAuthor: undefined,
} )
}
isShownByDefault |
@troychaplin, since now #70202 has been merged, can you rebase this PR using the trunk branch? This should solve the following problem:
|
Thanks @t-hamano, this is fixed in my branch now. I hope to have some time in over the next couple of evening to investigate the last outstanding issue with the reset and how it impacts the block markup. |
@t-hamano you were right, using |
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! I think everything works as expected.
* update: latest posts tools panel * change: updates based on feedback * fix: featured image alignment * fix: issue with author attr * fix: attr in markup on reset Co-authored-by: troychaplin <areziaal@git.wordpress.org> Co-authored-by: t-hamano <wildworks@git.wordpress.org> Co-authored-by: fabiankaegy <fabiankaegy@git.wordpress.org>
What?
Closes #67931
Why?
Following up on some additional work in refactoring block panels as per #67813 and a comment for additional work.
How?
Panels for
Feature image
andSorting and filtering
were removed and replaced withToolsPanel
andToolsPanelItem
.Testing Instructions
Featured image
panel and use dropdown to reset optionsSorting and filtering
panel and use dropdown to reset optionsScreenshots or screencast