WordPress.org

Make WordPress Core

Opened 3 weeks ago

Last modified 9 days ago

#50699 new enhancement

Fix and improve arranging metaboxes

Reported by: azaozz Owned by:
Milestone: 5.6 Priority: normal
Severity: normal Version:
Component: Administration Keywords: needs-patch
Focuses: ui, accessibility Cc:

Description

Follow-up to #49288.

In 5.5 the drop-areas when dragging/arranging of metaboxes on the Dashboard and the old Edit Post screen were fixed/improved. However that introduced an always visible drop-area on the Dashboard when only one metabox is visible.

Seems better to fix that bug and at the same time improve/enhance how metaboxes are dragged/moved/arranged in general.

Change History (6)

#1 @azaozz
3 weeks ago

Generally the dragging/arranging of metaboxes functionality is part of the "Screen Options". It is not "primary" or needed for the application to work, and is seldomly used. In that terms metabox drop areas should (probably) only be visible when the "Screen Options" tab is open.

It also seems to make sense to disable dragging/moving of the metaboxes when "Screen Options" tab is closed.

#2 follow-up: @pbiron
3 weeks ago

However that introduced an always visible drop-area on the Dashboard when only one metabox is visible.

I may be misunderstanding this, but even when there is only metabox visible, I may still want to drag it from the 1st column and drop it in the 2nd.

So, I think having the drop areas visible regardless of the number of visible metaboxes is not a bug.

#3 in reply to: ↑ 2 @azaozz
3 weeks ago

Replying to pbiron:

I may be misunderstanding this, but even when there is only metabox visible, I may still want to drag it from the 1st column and drop it in the 2nd.

Right, this is going to be "fixed" with this ticket. All drop areas should be visible when Screen Options are open, and not visible otherwise. Also thinking dragging/arranging of metaboxes should not be possible when not setting the screen options.

On the code side that means Sortables will be enabled only when the screen-meta-active class is present on the button#show-settings-link.

#4 follow-up: @afercia
3 weeks ago

All drop areas should be visible when Screen Options are open, and not visible otherwise.

I'd agree this would remediate to a historical inconsistency, where the visibility of the drop areas always worked differently in the Dashboard and in the Classic editor page.

I do think that the drop areas should be visible also while dragging though, which is one of the main purposes of the changes introduced in 5.5

Also thinking dragging/arranging of metaboxes should not be possible when not setting the screen options.

Hm, I think we should think a bit more in depth at this :) Making it behave that way would likely make re-arranging very difficult with keyboard only.

#5 in reply to: ↑ 4 @azaozz
3 weeks ago

Replying to afercia:

I do think that the drop areas should be visible also while dragging

Of course. This is also the default when using Sortables, users should be able to see where to "drop".

Also thinking dragging/arranging of metaboxes should not be possible when not setting the screen options.

Hm, I think we should think a bit more in depth at this :) Making it behave that way would likely make re-arranging very difficult with keyboard only.

Yeah, this will be a change to how it works currently. Thinking the Screen Options tab need a bit more text/explanation what is it for and what can be set/changed. Currently it only has "Boxes" and a row of chackboxes underneath. Not that helpful...

Screen Options are rarely set/changed. Many users don't ever look there, and if they do, it is not very clear. Thinking that adding some text at the top (a subtitle?) would be beneficial. Also explaining that "boxes" can be enabled/disabled by clicking on a checkbox and arranged by dragging or clicking the arrows in the box heading would make it a lot easier to understand.

Last edited 3 weeks ago by azaozz (previous) (diff)

#6 @afercia
9 days ago

Regarding the visibility of the Sortable areas, quoting some considerations from #49288 that maybe worth considering in this ticket.

1
On the dashboard, there's some JS in place to make the Sortable areas not visible when there's only one visible postbox. Historically, this was the case for the subscriber role. Also, users can always hide all postboxes except one. The JS implements a check for visible == 1 where visible is the amount of visible postboxes.
However, since the introduction of the "WordPress Events and News" dashboard widget, this check doesn't make much sense because the subscriber role now sees two widgets by default. At the very least, it should check for 2 or the whole behavior be rethinked.

2
In the Classic editor page and everywhere else the advanced Sortable area is in place, I think it's important to take into consideration this historical reconstruction from @azaozz, see: ticket:49288#comment:72

Right. The drop areas on the old Edit Post screen are actually three. However the second and third are always shown together. If I remember correctly the reason the third is three is that postboxes added by plugins were put by default in it; at the bottom under the editor. Also think at some point (over 10 years ago) that area used to be shown separately, but now is always shown together with the second area. So when dragging of postboxes was added to that screen, the three areas were kept as back-compat, but the third was (mostly) disabled. The users could drag boxes out but there's no reason for them to add boxes back in it, as they would show and work in exactly the same way as when in the second area. In that terms the changes here can either maintain the previous behavior or make the third area "droppable" again. This won't change how the screen works.

So maybe one option could be considering to remove the advanced area entirely.

Note: See TracTickets for help on using tickets.