-
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
Cover: Move cover min-height into dimensions panel via SlotFill #34065
Cover: Move cover min-height into dimensions panel via SlotFill #34065
Conversation
Size Change: +73 B (0%) Total Size: 1.05 MB
ℹ️ View Unchanged
|
ab8a037
to
6c0813e
Compare
ff6ca6f
to
95cafdb
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.
I went through and tested this:
✅ There should only be one "Dimensions" panel in the sidebar
✅ The min-height control should display by default under the "Dimensions" panel
✅ Confirm the min-height control continues to function correctly when adjust
❓ Confirm the min-height control behaves appropriately within the context of the ToolsPanel e.g. it can be reset etc.
When I reset all on the dimensions panel, the min height is reset, but the cover block stays at the same height it was set at. Is this expected? My expectation was it would reset to the default height when inserted. This may be the case on trunk so not a new thing.
✅ Ensure the min-height control does not appear in the Group block dimensions panel menu.
cc7e089
to
3386a7d
Compare
95cafdb
to
504dc9d
Compare
Thanks for catching that @apeatling 👍 I wasn't able to replicate this at first until I started playing with the resizable box control. The Cover block's edit component does some odd handling of the min-height unit. I suspect this is a hangover from prior to the UnitControl offering a value inclusive of the CSS unit. Clearing the This PR has also been rebased onto an updated approach to injecting controls into the block support panels in #34157 |
515f33d
to
852267f
Compare
e2f6cdd
to
c103640
Compare
The code change is looking good to me @aaronrobertshaw, and the testing steps all worked for me. I ran into a peculiar issue though clicking between two Cover blocks on the one post, though. I'm wondering if it's to do with selecting between the same kind of block so the ToolsPanel doesn't get unmounted? In the below video, when I click between two Cover blocks a couple of times, the top-most block loses all of the panel items and the panel item header. Clicking away from either cover block and then back to the top cover block restores it: dimensions-panel-switch-between-blocks.mp4 |
c103640
to
6efb585
Compare
Thanks for catching that @andrewserong! It turns out the deregistration of the panel items was occurring after the new panel item, matching the old one's label, was added. This resulted in them both being removed. This problem was addressed in b9c995a for the PR this is based on: #34157. The linked commit fixes the issue for now however there might be a more elegant solution we can iterate on in a future PR. Screen.Recording.2021-08-25.at.4.17.12.pm.mp4 |
Thanks @aaronrobertshaw, that seems to have fixed it for me when clicking between a Group block and a Cover block. However, if I click between two Cover blocks, it still results in the top-most Cover block losing all its panel items: dimensions-panel-switch-between-two-cover-blocks.mp4I also noticed a strange thing when setting Margin on the Group block before clicking on the Cover block. If I haven't set Margin previously, clicking on the Cover block removes it from the Group block again. Since we haven't enabled Margin on the Group block in trunk, this is likely lower priority: dimensions-panel-switch-between-blocks-margin.mp4 |
b79628b
to
4bc9c74
Compare
3707500
to
a875a76
Compare
4bc9c74
to
16d3c0a
Compare
a875a76
to
c9ce368
Compare
16d3c0a
to
31dff94
Compare
2b82740
to
8fea6d9
Compare
574c27b
to
e9bbbed
Compare
8fea6d9
to
7660304
Compare
e9bbbed
to
269b5d1
Compare
7660304
to
2ba3fe5
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.
This is testing nicely @aaronrobertshaw!
✅ The min height control behaves as expected and is displayed in the Dimensions panel
✅ The onDeselect and resetAllFilter behaviour is working as expected
✅ Switching between group and cover blocks, or cover to cover blocks results in the Dimensions panel being updated as expected
I noticed one issue that's unrelated to this PR (it's happening for Group blocks too) and that's that if we copy a block with the Dimensions panel and then paste it elsewhere, the Dimensions panel is then empty. However if you click away from the block and back to it, it restores the behaviour. I don't think this is blocking for this PR, we can look into it separately, but here's a screenshot:
Thanks as always for the thorough testing and reviews @andrewserong. Agreed, let's create an issue for that and address it in an immediate follow up PR. |
Thanks Aaron! I've added a follow-up issue here: #34724 |
Depends on: #34157
Related: #33970
Description
min-height
control into the dimensions block support panel.ToolsPanelItem
component so it can also be reset via theToolsPanel
menu.How has this been tested?
Manually.
min-height
control should display by default under the "Dimensions" panelmin-height
control continues to function correctly when adjustmin-height
control behaves appropriately within the context of theToolsPanel
e.g. it can be reset etc.min-height
control does not appear in the Group block dimensions panel menu.Screenshots
Screen.Recording.2021-08-13.at.3.14.36.pm.mp4
Types of changes
Enhancement
Checklist:
*.native.js
files for terms that need renaming or removal).