-
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
Limit zoom out toggle to specific post types #65732
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: +31 B (0%) Total Size: 1.77 MB
ℹ️ View Unchanged
|
@@ -75,6 +78,10 @@ function Header( { | |||
}; | |||
}, [] ); | |||
|
|||
const canBeZoomedOut = [ 'post', 'page', 'wp_template' ].includes( |
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.
Another case for this issue #61622
How do we see that longer term?
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.
It should be a thing supported by the CPT. This inclusion list above is a "temporary" hack that also keeps out zoom out even for CPTs that are perfectly valid 🤷🏻
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.
That's fine by me.
This PR is hiding the button but still allowing zoom-out to be triggered programmatically or in some particular flows. I guess that's intended?
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.
Works as expected, thanks!
CleanShot.2024-09-30.at.10.10.14.mp4
Yes, it's mostly aimed as a band aid for the fact we do not have a path for these situations. If one triggered programmatically zoom out view in an unsupported CPT maybe they also know how to work with it. |
Hey all 👋 Would it not have made more sense to provide a specific disallow list with the ability to filter it? as someone who works with a lot of custom post types this is something I would want to be available for the large majority of them. |
@fabiankaegy you may be right actually. I opted for an allow list because this feature is quite incipient and it should be honed on some basic assumptions first and then open to other situations. Ideally, like Riad also mentioned, composability should be a support of the post type (see #61622 and #65732). Pherhaps the best next step is to open an issue to serve as an anchor for a follow up - definitely this is not a final shape. |
Yes, this should be something broadly available. I think we should also aim at it being the default for any post type that supports "content". |
Co-authored-by: draganescu <[email protected]> Co-authored-by: youknowriad <[email protected]> Co-authored-by: richtabor <[email protected]> Co-authored-by: ajlende <[email protected]>
Co-authored-by: draganescu <[email protected]> Co-authored-by: youknowriad <[email protected]> Co-authored-by: richtabor <[email protected]> Co-authored-by: ajlende <[email protected]>
This reverts commit 44b09af.
Co-authored-by: draganescu <[email protected]> Co-authored-by: youknowriad <[email protected]> Co-authored-by: richtabor <[email protected]> Co-authored-by: ajlende <[email protected]>
What?
Fixes #61044
Why?
How?
Hardcodes the post types we want the mode to be available for and does not render the affordance to access it for the others.
Testing Instructions
Testing Instructions for Keyboard
N/A
Screenshots or screencast
selective-zoom-out-control.mp4