Make WordPress Core

Opened 4 months ago

Closed 4 months ago

Last modified 4 months ago

#65141 closed defect (bug) (fixed)

Fix alignment for sortable metabox on post and page edit screen with classic editor

Reported by: umesh.nevase Owned by: SergeyBiryukov
Priority: normal Milestone: 7.0
Component: Editor Version: 7.0
Severity: normal Keywords: admin-reskin has-patch dev-feedback fixed-major
Cc: Focuses: ui, css

Description (last modified by sabernhardt)

When the Classic Editor is selected as the default editor in the Writing Settings, the sortable metabox container on the post/page edit screen includes an extra 4px of padding. This results in a 4px misalignment of the metabox container with Classic Editor and other UI elements on the page.

Debugging confirms that this padding is only applied when the Classic Editor is active. Since it serves no identifiable purpose other than for these metaboxes, it can be safely removed to restore alignment. This change was originally introduced in Changeset [61646].

Attachments (3)

post-screen-alignemnt2.png (240.9 KB ) - added by umesh.nevase 4 months ago.
post-screen-alignemnt2.2.png (240.9 KB ) - added by umesh.nevase 4 months ago.
post-screen-alignemnt3.png (208.5 KB ) - added by umesh.nevase 4 months ago.
screenshot for extra padding and misalignment

Download all attachments as: .zip

Change History (28)

@umesh.nevase
4 months ago

screenshot for extra padding and misalignment

This ticket was mentioned in PR #11667 on WordPress/wordpress-develop by @umesh.nevase.


4 months ago
#1

  • Keywords has-patch added

This PR fixes alignment issue for meta-box-sortables with the editor.
In this PR I've remove extra 4px padding added to metabox container.

#2 follow-up: @sabernhardt
4 months ago

  • Description modified (diff)
  • Focuses css added
  • Keywords admin-reskin added
  • Milestone Awaiting Review7.0

[61646] added the 4-pixel padding to sortable metaboxes in the dashboard, classic post editor, and media editor.

Then [61759] set the dashboard widgets' padding to 0, which does not seem necessary if the padding is removed from all of them.

#3 @SergeyBiryukov
4 months ago

  • Owner set to SergeyBiryukov
  • Resolutionfixed
  • Status newclosed

In 62284:

Administration: Correct alignment of meta boxes on the Edit screen with classic editor.

Follow-up to [61646], [61759].

Props umeshnevase, sabernhardt, SergeyBiryukov.
Fixes #65141.

@SergeyBiryukov commented on PR #11667:


4 months ago
#4

Thanks for the PR! Merged in r62284.

#5 @SergeyBiryukov
4 months ago

  • Keywords commit dev-feedback added
  • Resolution fixed
  • Status closedreopened

Reopening for 7.0 consideration.

#6 @peterwilsoncc
4 months ago

  • Keywords dev-reviewed added; dev-feedback removed

r62284 approved for merging to the 7.0 branch.

#7 @peterwilsoncc
4 months ago

  • Resolutionfixed
  • Status reopenedclosed

In 62285:

Administration: Correct alignment of meta boxes on the Edit screen with classic editor.

Follow-up to [61646], [61759].

Reviewed by peterwilsoncc.
Merges r62284 to the 7.0 branch.

Props umeshnevase, sabernhardt, SergeyBiryukov.
Fixes #65141.

#8 in reply to: ↑ 2 ; follow-up: @TobiasBg
4 months ago

  • Resolution fixed
  • Status closedreopened

Replying to sabernhardt:

[61646] added the 4-pixel padding to sortable metaboxes in the dashboard, classic post editor, and media editor.

So, the padding was now removed again, but [61646] also added a negative -4px margin on #poststuff #post-body. I think this should be reverted as well, as it otherwise pulls the editor to the left a bit (with Classic Editor).

This ticket was mentioned in PR #11689 on WordPress/wordpress-develop by @umesh.nevase.


4 months ago
#9

@TobiasBg has suggested to remove negative -4px margin on #poststuff #post-body that pulling post-body to left. This margin is not required.Here

This margin was added in changeset for admin reskin https://core.trac.wordpress.org/changeset/61646

#10 in reply to: ↑ 8 @umesh.nevase
4 months ago

Yes, we can revert negative -4px margin on #poststuff #post-body which is not required. [PR]https://github.com/WordPress/wordpress-develop/pull/11689

@TobiasBg commented on PR #11689:


4 months ago
#11

Thanks for creating a PR! I think the margin declaration can be removed in full, as it was only added via https://core.trac.wordpress.org/changeset/61646/trunk/src/wp-admin/css/edit.css and did not exist before.

#12 @peterwilsoncc
4 months ago

  • Keywords commit dev-reviewed removed

Doing some keyword management to tidy up the workflow report.

This ticket was mentioned in Slack in #core by jorbin. View the logs.


4 months ago

#14 @jorbin
4 months ago

  • Keywords changes-requested added

As noted, the patch needs an update. @umeshnevase - Are you able to handle that?

@umesh.nevase commented on PR #11689:


4 months ago
#15

Thanks for creating a PR! I think the margin declaration can be removed in full, as it was only added via https://core.trac.wordpress.org/changeset/61646/trunk/src/wp-admin/css/edit.css and did not exist before.

Thanks for pointing out that margin declaration, I've removed unwanted margin declaration.

#16 @audrasjb
4 months ago

  • Keywords commit added; changes-requested removed

I think we can go with PR11689.

This ticket was mentioned in Slack in #core-test by r1k0. View the logs.


4 months ago

#18 @jadavsanjay
4 months ago

Test Report

Description

This report validates whether the indicated patch works as expected.

Patch tested: https://github.com/WordPress/wordpress-develop/pull/11689

Environment

  • WordPress: 7.1-alpha-20260507.074835
  • PHP: 7.4.33
  • Server: PHP.wasm
  • Database: WP_SQLite_Driver (Server: 8.0.38 / Client: 3.51.0)
  • Browser: Chrome 148.0.0.0
  • OS: Windows 10/11
  • Theme: Twenty Twenty-Five 1.4
  • MU Plugins: None activated
  • Plugins:
    • Classic Editor 1.6.7
    • Test Reports 1.2.1

Actual Results

  1. ✅ Issue resolved with patch.

Additional Notes

  • After applying the patch, the issue with the alignment of the sortable metabox on the post and page edit screen in the Classic Editor has been fixed.

Supplemental Artifacts

https://i.postimg.cc/kVN7q4TF/patch-1.png https://i.postimg.cc/xkG9nC65/patch-2.png

Last edited 4 months ago by jadavsanjay (previous) (diff)

#19 @khokansardar
4 months ago

## Patch testing report

Patch / PR tested

Environment

  • WordPress: trunk @ ( commit or "Playground PR build" )
  • PHP: 8.2
  • Server: nginx / Playground
  • OS: macOS 15
  • Browser: Chrome 136, Safari 18

Steps

  1. Open Posts → Edit a post that uses the classic metabox layout (or install/enable classic editing if your test site uses blocks only).
  2. Note alignment between editor area and right-hand metabox column at full width and after narrowing the window.
  3. Toggle metabox columns if available; expand/collapse postboxes.
  4. Drag a metabox to reorder (if applicable).

Results

  • Before patch (or on current trunk without PR): describe misalignment if you still see it on trunk
  • With PR #11689: aligned / no regression
  • Drag-and-drop / metabox UI: OK or issue
Last edited 4 months ago by khokansardar (previous) (diff)

#20 @darshitrajyaguru97
4 months ago

Patch Testing Report

Patch tested:
https://github.com/WordPress/wordpress-develop/pull/11689

Environment

  • WordPress: trunk (Playground PR build)
  • PHP: 8.2
  • Server: nginx / Playground
  • OS: Windows 11
  • Browser: Chrome

Testing Performed

  • Opened the post editor using the classic metabox layout
  • Verified editor and metabox column alignment at multiple viewport widths
  • Tested expand/collapse functionality for postboxes
  • Tested metabox column toggling
  • Verified drag-and-drop metabox reordering behavior

Results

  • On current trunk, minor alignment inconsistencies were still noticeable when narrowing the editor width.
  • With PR #11689 applied, the editor area and metabox column alignment appeared consistent across tested layouts and screen sizes.
  • Drag-and-drop functionality and general metabox interactions worked correctly without any noticeable regressions.

Summary

Patch tested successfully and worked as expected in the tested environment.

#21 @gaurangsondagar
4 months ago

Patch Testing Report:

Patch Tested: https://github.com/WordPress/wordpress-develop/pull/11689

Environement:
PHP: 8.2.29
WordPress: trunk (Playground PR build)
Web server: nginx / Playground
Browser: Chrome
OS: Ubuntu 22.04.5 LTS

Steps I Followed:

  • Navigate to Posts and open a post using the classic metabox interface (enable/install the Classic Editor if the site only uses the block editor).
  • Check the alignment between the main editor section and the right-side metabox column in both full-width and resized window views.
  • Test the metabox column layout by toggling available column options and expanding/collapsing the postboxes.
  • Reorder a metabox using drag-and-drop functionality.

Result:

  • On the current trunk without applying PR #11689, the alignment issue is still noticeable.
  • After testing with PR #11689 applied, the alignment appears correct, no regressions were observed, and the metabox drag-and-drop functionality along with the overall UI behavior is working properly.

This ticket was mentioned in Slack in #core by audrasjb. View the logs.


4 months ago

#23 @audrasjb
4 months ago

  • Resolutionfixed
  • Status reopenedclosed

In 62377:

Editor: Remove an unwanted negative margin in Classic Editor metaboxes CSS styles.

This changeset reverts a negative -4px margin on #poststuff #post-body introduced in [61646].

Follow-up to [61646], [61759], [62284].

Props TobiasBg, umeshnevase, audrasjb, jadavsanjay, khokansardar, darshitrajyaguru97, gaurangsondagar.
Fixes #65141.

#24 @audrasjb
4 months ago

  • Keywords dev-feedback fixed-major added; commit removed

Reopening for second committer sign off and backport.

#25 @SergeyBiryukov
4 months ago

In 62381:

Editor: Remove an unwanted negative margin in Classic Editor metaboxes CSS styles.

This changeset reverts a negative -4px margin on #poststuff #post-body introduced in [61646].

Follow-up to [61646], [61759], [62284].

Reviewed by audrasjb, SergeyBiryukov.
Merges [62377] to the 7.0 branch.

Props TobiasBg, umeshnevase, audrasjb, jadavsanjay, khokansardar, darshitrajyaguru97, gaurangsondagar.
Fixes #65141.

Note: See TracTickets for help on using tickets.