Make WordPress Core

Opened 3 years ago

Last modified 4 months ago

#58335 new defect (bug)

WordPress Dashboard Collapse Menu Transition issue.

Reported by: shuvo52 Owned by:
Priority: low Milestone: Awaiting Review
Component: Administration Version: 5.2
Severity: normal Keywords: has-screenshots has-patch
Cc: Focuses: ui, css

Description

Hi
When I collapse the menu it's showing awkward.
See the video: https://d.pr/v/34K9H4
I think this issue should be fixed as soon as possible.
Regards

Attachments (2)

58335.diff (409 bytes ) - added by pattihis 15 months ago.
Fix admin menu transition jump by standardizing menu item heights
58335.1.diff (352 bytes ) - added by sabernhardt 4 months ago.
removes width and height rules instead of redefining the same values

Download all attachments as: .zip

Change History (8)

#1 @sabernhardt
3 years ago

  • Component GeneralAdministration
  • Focuses accessibility removed
  • Version trunk5.2

Thanks for the report!

The icon dimensions have a discrepancy between the expanded and collapsed states. The expanded link's height increased by 0.2 pixels in [45186], and the width had a 1-pixel difference before then. This is more noticeable on the About pages than any page where you would find an open submenu on the side (because expanding a submenu is a bigger difference).

  • When the menu is collapsed (or "folded"), the icon is in a 35px by 30px container within a 36px by 34px link.
  • When the text shows, the icon's container is 36px by 34px, and the text size makes the link 160px by 34.2px (14px times 1.3 line-height plus 8px padding on the top and bottom).

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


3 years ago

#3 @ironprogrammer
3 years ago

  • Priority normallow

During test triage, it was agreed to mark this ticket's priority to low, but keep it open for a patch. Why low? Triagers noted that the sub-pixel shift was barely noticeable. However, the assessment in comment:1 is a good basis for a patch.

#4 @ironprogrammer
3 years ago

  • Keywords has-screenshots added

Adding has-screenshots as reporter's video does show the shift.

@pattihis
15 months ago

Fix admin menu transition jump by standardizing menu item heights

#5 @pattihis
15 months ago

  • Keywords has-patch added; needs-patch removed

Summary of patch added:

wp-admin/css/admin-menu.css
  1. Lines 237-238: Added box-sizing: border-box; and height: 34px; to the #adminmenu a.menu-top, #adminmenu .wp-submenu-head selector to fix the 0.2px issue
  2. Lines 322-323: Updated .folded #adminmenu div.wp-menu-image from width: 35px; height: 30px; to width: 36px; height: 34px; to maintain consistency

This patch addresses the core issue in ticket #58335 by:

  • Standardizing menu item heights to exactly 34px in both collapsed and expanded states
  • Eliminating the visual "jump" during menu transitions

@sabernhardt
4 months ago

removes width and height rules instead of redefining the same values

#6 @sabernhardt
4 months ago

Related: #65266

  1. PR 11860 edits the line-height to reduce the calculated height.
  2. 58335.1.diff deletes the width and height rules for the .folded style. [26766] reduced the .folded width to 35px for long link text in #26452, but the text wraps to another line more smoothly now.

However, I think the 34-pixel width is worth keeping, between the 782px and 960px CSS breakpoints. That seems to center the icon better horizontally within the narrow column and align it with the W logo in the toolbar.

Note: See TracTickets for help on using tickets.