-
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
Show movers next to block switcher #22673
Conversation
Size Change: +497 B (0%) Total Size: 1.13 MB
ℹ️ View Unchanged
|
I didn't have that thought until you mentioned it, and even now I don't think too much of it, because just like popovers extending from the toolbar it's made of the same material. I did notice it's 50x50 instead of 48x48 though, which I'll probably patch right up :) Good thoughts, I'll try and push some polish today. |
In 571e077 I polished drag and drop: I think it works well, but I expect you'll have thoughts on this. Lay them on me. |
Thank you Zeb, good feedback. The changes to the button size and such I agree need to happen but they require a little tinkering that I thought I'd postpone until there's some agreement on a path forward (which appears to be forming!) Also agree on the draggable area. The new dark handle, I know it's a big change, but if you're able to compare this with master or even 5.4, I'm actually liking it a fair bit. It helps indicate where you need to drop the block in order to actually move it. It's also not "muddy" in that it has a solid background, whereas the block you're moving does not (because we can't know which color to apply there). I'm definitely open to more thoughts on that feeling, so I hear you, and it's why I opened the PR even while not totally baked yet. |
571e077
to
bcc2798
Compare
Good catch, Paal. I'll show the movers as disabled when they can't be moved, that feels appropriate. |
f859ff1
to
6924547
Compare
Props @zebulandstanphill Co-authored-by: Zebulan Stanphill <zebulanstanphill@protonmail.com>
ac74d0b
to
27e548a
Compare
@@ -12,7 +12,7 @@ import { withSafeTimeout } from '@wordpress/compose'; | |||
const dragImageClass = 'components-draggable__invisible-drag-image'; | |||
const cloneWrapperClass = 'components-draggable__clone'; | |||
const cloneHeightTransformationBreakpoint = 700; | |||
const clonePadding = 20; |
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.
These 20 appear to have been picked at random, back in the day, and almost certainly due to there being side UI and margins. Because there is neither anymore, I've now set this to zero, instead of cmopensating for it.
background: transparent; | ||
pointer-events: none; | ||
z-index: z-index(".components-draggable__clone"); | ||
|
||
> * { | ||
opacity: 0.8; | ||
// This needs specificity as a theme is meant to define these by default. | ||
margin-top: 0 !important; |
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 know that you must never use !important. Except in this case. Themes can define block margins, and when they do, the draggable clone will be as offset from the mouse cursor position as the theme margin decides. By explicitly and with high specificity setting these, this is unlikely to break.
In ffe28be I simplifid the on-drag handle positioning math. There was some old stuff we don't need anymore that I was able to reduce and convert to variables. Shaun I believe this fixes the discrepancies you saw. 2019: 2020: |
Uh. I commented on the wrong post.. |
Let's get this in and I will address any followups. |
Like perhaps drag & drop hot zones...:) |
Can you clarify? |
Thinking this: There are multiple issues intertwined into each other. |
Ah. There's lots to explore for drag and drop still, yes! |
Fixes #21935.
One of the most important things the new UI (as detailed in #18667) did, was to unify on a single toolbar, meaning the mover control was included. This afforded a number of benefits:
The downside was a wider block toolbar, which we compensated for by hiding the mover control until you hover the block switcher. However the feedback was clear, that the basic mover control was used often enough that it should not be hidden.
This PR unhides it:
The PR takes the most simple approach discussed to unhiding it. This approach does not preclude tweaking the design further — but it can serve as a good baseline, because it is so trivial to implement. And instead of discussing what the best appraoch is ad nauseum, a PR is an excellent way to try this out, and please do try it out, don't just look at the GIFs. As I was working on this, it struck me as feeling intuitive and natural, and not in need of any more visual affordances.
Still todo: