Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Post Featured Image: Move width and height controls into the Dimensions panel via SlotFill #36540
Post Featured Image: Move width and height controls into the Dimensions panel via SlotFill #36540
Changes from all commits
55c19b7
5b75caf
735b976
7bbc003
f744a0d
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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'm also seeing the vanishing controls:
I'm not 100% certain, but it seems to be related to the conditional rendering of the
ToolsPanel
.When I remove the wrapper, things work okay:
Relocating the
height
condition also seems to work:Though relocating, and not removing
ToolsPanelItem
above causes aScale
option to the appear in the ToolsPanel options menu even where the control isn't shown.Do we need the scale control to appear in the ToolsPanel options menu at all?
It's "toggleability"™ is determined only by the
height
value as far as I can tell.Maybe we could reset the scale elsewhere, e.g., by detecting changes to the height if need be? 🤷Ignore the above, the scale value resets just fine 😄
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.
Whoa, interesting find! Weird -- I know we have conditionally rendered ToolsPanelItems, like the way we only render enabled controls in the typography panel. Nice spot, I'll play around with this 💯
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 feels a bit off to remove the ToolsPanelItem wrapper, since then we'd have a control in the ToolsPanel which isn't tracked in the menu. I see your point here, though, since its reset is meant to be tightly linked to Height. Unfortunately it also seems to break some of the styling with the single-column height 🤔 If that's the way we go, I can fix that specifically for this block I think.
At the same time it also feels wrong to keep the ToolsPanelItem wrapper and only conditionally render the control for the reason you pointed out -- the option appears in the reset menu even when the control isn't shown.
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.
Yeah, I see what you mean.
I suppose it depends on what folks expect ToolsPanel options menu items to represent.
For example, when controls are not shown by default, we can toggle their visibility/reset their values independent of any sibling control. At least as far as I know!
This wouldn't apply to the Scale control where there is no height value.
The merit I see in adding Scale to the menu is to indicate to users that resetting all controls in the panel will also reset the scale value (which appears to occur anyway).
But resetting all also makes the scale item disappear from the menu itself.
It does introduce a new paradigm. 🤔