Make WordPress Core

Opened 5 months ago

Closed 6 weeks ago

#64999 closed defect (bug) (fixed)

Admin reskin: Form elements are not standardized in the mobile viewport.

Reported by: wildworks Owned by: wildworks
Priority: normal Milestone: 7.0.1
Component: General Version: 7.0
Severity: normal Keywords: admin-reskin has-patch dev-reviewed
Cc: Focuses:

Description

Related ticket: #64308

In the new admin design system, interactive elements are expected to have a base height of 24px, 32px, or 40px. Furthermore, in WordPress 6.9, most interactive elements were unified to a height of 40px in mobile views. However, in 7.0, many elements have inconsistent heights in mobile views. This ticket aims to identify and fix elements that do not adhere to the new standard sizes in mobile views.

Attachments (6)

comparison-in-mobile.png (65.6 KB ) - added by wildworks 5 months ago.
button-size-comparison.png (253.4 KB ) - added by wildworks 3 months ago.
buttom-size-comparison
Before post.png (40.6 KB ) - added by andrewssanya 3 months ago.
Before
After post.png (42.6 KB ) - added by andrewssanya 3 months ago.
After
Before page.png (47.0 KB ) - added by andrewssanya 3 months ago.
Before under pages
After page.png (38.5 KB ) - added by andrewssanya 3 months ago.
After under pages

Download all attachments as: .zip

Change History (61)

#1 @wildworks
5 months ago

I think it will be difficult to resolve everything at once. I suggest submitting patches on a page-by-page or component-by-component basis.

This ticket was mentioned in PR #11461 on WordPress/wordpress-develop by @sainathpoojary.


4 months ago
#2

  • Keywords has-patch added

Fixes inconsistent heights on interactive elements in the admin mobile viewport (≤782px) on list table pages (Posts, Pages, etc.).

Trac ticket: #64999

This ticket was mentioned in PR #11471 on WordPress/wordpress-develop by @abcd95.


4 months ago
#3

This ticket was mentioned in PR #11497 on WordPress/wordpress-develop by @abcd95.


4 months ago
#4

#5 @abcd95
4 months ago

https://core.trac.wordpress.org/browser/trunk/src/wp-admin/css/customize-widgets.css#L572

This element has height: 39px, but it lives inside @media screen and (max-height: 700px) and (min-width: 981px) so that's most probably a compact mode for small-screen desktops/laptops, not the mobile breakpoint. So just wante to confirm if its intentional compact sizing and out of scope for this ticket or not.

@abcd95 commented on PR #11497:


4 months ago
#6

Thanks for the PR. Personally, I think it might be better to standardize on the 32px size.

Thanks for looking into this. 32px does look more mobile-centric. Incorporated in https://github.com/WordPress/wordpress-develop/pull/11497/commits/954f6c9f9073bbd27dbc1e5d5b056829a7dda908

@wildworks commented on PR #11497:


4 months ago
#7

Thanks for the update! However, I personally suggest the following two changes.

  • I propose changing the button height to 32px for non-mobile viewports as well. The 40px button size feels too large for the customizer header.
  • Use the new button-compact class: This should eliminate the need to hard-code various styles.

@abcd95 commented on PR #11497:


4 months ago
#8

Thanks for the update! However, I personally suggest the following two changes.

  • I propose changing the button height to 32px for non-mobile viewports as well. The 40px button size feels too large for the customizer header.
  • Use the new button-compact class: This should eliminate the need to hard-code various styles.

Thanks for the feedback, @t-hamano!
I have now added the button-compact class to the button variations. The need for hardcoding styles is no longer needed now. Also updated the desktop margin from 3px to 7px to vertically center.

#9 @wildworks
4 months ago

  • Milestone Awaiting Review7.0

We may not be able to fix all issues in the 7.0 release, but let's do our best to address as many as possible.

#10 @abcd95
4 months ago

Hello!

Here are the places that I investigated and confirmed no fix needed:

  • common.css line 4244 — .wp-filter .button.drawer-toggle { height: 28px } in tablet media query: This is dead CSS. min-height: 40px from buttons.css mobile base already wins, rendering the element at exactly 40px. No change required.
  • list-tables.css line 1908 — .view-switch a at 36px: Parent is display: none on mobile. Not visible to users.
  • customize-widgets.css.widget-reorder-nav span: This is in a desktop compact media query (min-width: 783px and max-width: 1100px), not the mobile breakpoint. Out of scope.

found soem dead CSS also -

  • edit.css:1883.post-format-options a div: No PHP/JS generates this markup
  • edit.css:1976.wp_themeSkin a.mceButton: Legacy TinyMCE 3.x selector; WordPress uses TinyMCE 4.x

I am not sure regarding this place - https://core.trac.wordpress.org/browser/trunk/src/wp-admin/css/customize-controls.css#L2890

Do we need to update this too?

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


4 months ago

#12 @mosescursor
4 months ago

Upon inspection, I actually agree more with @abcd95. This fix is actually not needed. I have not seen the consistency in bug behavior

Environment

  • WordPress: 7.1-alpha-20260427.062049
  • PHP: 7.4.33
  • Server: PHP.wasm
  • Database: WP_SQLite_Driver (Server: 8.0.38 / Client: 3.51.0)
  • Browser: Brave 1.88.136 (Official Build) (arm64)
  • OS: macOS
  • Theme: Twenty Twenty-Five 1.4
  • MU Plugins: None activated
  • Plugins:
    • Test Reports 1.2.1

#13 @SergeyBiryukov
3 months ago

In 62294:

Admin Reskin: Standardize theme install overlay button height on mobile.

Follow-up to [61646].

Props abcd95, wildworks, mosescursor, sainathpoojary, SergeyBiryukov.
See #64999.

@SergeyBiryukov commented on PR #11497:


3 months ago
#14

Thanks for the PR! Merged in r62294.

#15 follow-up: @wildworks
3 months ago

I propose to backport [62294] to 7.0, as this will align the customizer's publish button with its size. See [62295].

#16 in reply to: ↑ 15 @mosescursor
3 months ago

Replying to wildworks:

I propose to backport [62294] to 7.0, as this will align the customizer's publish button with its size. See [62295].

I will agree with @wildworks on this

#17 @wildworks
3 months ago

It seems that [62294] can be backported to 7.0. However, please note that [62294] alone cannot close this ticket, as there are still many issues to address within this ticket.

#18 @wildworks
3 months ago

  • Keywords dev-reviewed added

This is a second committer sign-off. Approving [62294] for 7.0 backport.

#19 @jorbin
3 months ago

I think It would be best to get all of the remaining issues resolved so that it can be backported in one go before the next beta

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


3 months ago

#21 @jorbin
3 months ago

  • Priority normalhigh

Moving up in priority since as @wildworks notes "there are still many issues to address within this ticket"

#22 @wildworks
3 months ago

The priority for correction should be the unintended reduction in the height of interactive elements to less than 40px in the mobile layout due to the application of the new design system.

I don't think elements that weren't previously 40px need to be standardized to 40px right away.

#23 @abcd95
3 months ago

I was taking a look at addressing some of the remaining issues for this ticket, specifically investigating .customize-control .date-time-fields select, which is hardcoded to height: 39px in the mobile. Upon inspecting the computed styles, the element actually resolves to a total height of 40px, and this happens because the global min-height of 40px is applied to select from the core forms. Everything else appears to either be intentional or correctly saved by the global min-height.

could you point out which specific pages or components you have noticed are still experiencing the unintended height reduction to less than 40px?

#24 @wildworks
3 months ago

could you point out which specific pages or components you have noticed are still experiencing the unintended height reduction to less than 40px?

I used AI to identify interactive elements that were unintentionally made smaller than 40px.

  • Appearance > Themes: Search field
  • Plugins > Add Plugin: Search field, Keyword dropdown, Pager input field, Install button
  • Media Library > Grid: Filter dropdown, Bulk select button, Search field
  • General Settings > Date format input field, Time format input field

@wildworks
3 months ago

buttom-size-comparison

#25 @wildworks
3 months ago

I propose that we address all issues with the following two PRs:

  • PR 11461: This focuses on fixing the list table page.
  • Submit a new PR to fix all other issues.

After these two are addressed, we can backport these two commits to 7.0 in a single commit.

This ticket was mentioned in PR #11750 on WordPress/wordpress-develop by @abcd95.


3 months ago
#26

#27 @wildworks
3 months ago

  • Priority highnormal

Perhaps it might be better to introduce utility classes for form elements first. See #65207.

This would also make it easier to address this ticket. Fortunately, there are no major layout issues on the mobile layout, so let's revert the priority to normal.

@abcd95 commented on PR #11750:


3 months ago
#28

Thanks @t-hamano for the suggestions and catching the leftovers.

I've tried to use classes and avoid hardcoding as much as possible.

Area Before After
Theme Activate Button https://github.com/user-attachments/assets/10fd927f-c400-4b18-9260-1bdb61f99276 https://github.com/user-attachments/assets/b8dbb815-2ca0-49cf-bd68-5372e0c38f8b
Plugin Install Button https://github.com/user-attachments/assets/be429cb3-f154-4e17-b6f9-242d9fdae943 https://github.com/user-attachments/assets/3cf17d8d-ce5f-42e8-b5de-e85a20dbf619
Mode Before After
Grid Mode <video src="https://github.com/user-attachments/assets/73392b1d-cc37-456d-bc96-fcabc3f616b9" controls width="420"></video> <video src="https://github.com/user-attachments/assets/d8b4eca6-0027-4e7e-af53-611a55e0edfe" controls width="420"></video>
List Mode <video src="https://github.com/user-attachments/assets/b00914c7-6db0-4aa7-95f4-d930e7f1c7ca" controls width="420"></video> <video src="https://github.com/user-attachments/assets/638e7e4f-3296-4544-9b40-4279adbb2126" controls width="420"></video>

@abcd95 commented on PR #11750:


3 months ago
#29

Thanks @t-hamano for the reply.

Please note that on mobile layouts, the button height is generally 40px. Therefore, the button height in the following layout is incorrect.
The .button-compact class should also be usable in these areas.

I intentionally made them 32px in size since you asked the same in https://github.com/WordPress/wordpress-develop/pull/11750#pullrequestreview-4268836283, specifically -

Install Themes: These buttons should be 32px in size.
Install Plugins: These buttons should be 32px in size.

I also feel like they should have .button-compact class and should be 40px for consistency, but your review suggested otherwise. So, just to be sure, we still want this to be 40px, right?

@wildworks commented on PR #11750:


3 months ago
#30

I intentionally made them 32px in size since you asked the same in https://github.com/WordPress/wordpress-develop/pull/11750#pullrequestreview-4268836283, specifically -

Install Themes: These buttons should be 32px in size.
Install Plugins: These buttons should be 32px in size.

I also feel like they should have .button-compact class and should be 40px for consistency, but your review suggested otherwise. So, just to be sure, we still want this to be 40px, right?

Apologies, there was an error in my explanation. What I meant to say is that all buttons should always be 40px on mobile. This means that a button with a 32px size in the desktop layout should change to a 40px size in the mobile layout. To achieve this, I wanted to suggest that the "button-compact" CSS class would be appropriate.

#31 @wildworks
3 months ago

The issue we are trying to resolve with this ticket is not critical. It does not prevent the functionality of the mobile layout and simply corrects the height of an interactive element. It can likely be postponed to 7.0.1 without any issues.

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


3 months ago

@andrewssanya
3 months ago

Before

@andrewssanya
3 months ago

After

@andrewssanya
3 months ago

Before under pages

@andrewssanya
3 months ago

After under pages

#33 @andrewssanya
3 months ago

  • Versiontrunk

Patch Testing Report

Patch Tested: https://core.trac.wordpress.org/ticket/64999

Environment

  • WordPress: 7.1-alpha-62366
  • 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 (Mobile)
  • OS: macOS
  • Theme: Twenty Twenty-Five 1.5
  • MU Plugins: None activated
  • Plugins:
    • Test Reports 1.2.1

Steps taken

  1. Used the Post section
  2. Used the Page section

Screenshots/Screencast with results

https://core.trac.wordpress.org/attachment/ticket/64999/Before%20page.png https://core.trac.wordpress.org/attachment/ticket/64999/After%20page.png

https://core.trac.wordpress.org/attachment/ticket/64999/Before%20post.pnghttps://core.trac.wordpress.org/attachment/ticket/64999/After%20post.png

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


3 months ago

@abcd95 commented on PR #11750:


3 months ago
#35

There are still places where styles are breaking -

https://github.com/user-attachments/assets/6cd864a4-e3dc-4b2a-93eb-32c87145c80d

https://github.com/user-attachments/assets/8717a07d-225e-4998-b0a2-978e11977ff6


I think it would be better to tackle one screen at a time rather than doing all in one. What do you think, @t-hamano?
From this PR, maybe we can ship what's done and then tackle one screen at a time in subsequent PRs.

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


3 months ago

#37 @audrasjb
3 months ago

Ok so we have one commit waiting for backport, and several PRs that need review and testing.
My feeling is that we should just backport the patch already committed and move the rest of the ticket to 7.0.1.

Therefore I'm backporting [62294] right now.

#38 @audrasjb
3 months ago

In 62378:

Admin Reskin: Standardize theme install overlay button height on mobile.

Follow-up to [61646].

Reviewed by audrasjb.
Merges [62294] to the 7.0 branch.
Props abcd95, wildworks, mosescursor, sainathpoojary, SergeyBiryukov.
See #64999.

#39 @audrasjb
3 months ago

  • Milestone 7.07.0.1

Moving to 7.0.1 for further improvements.

#40 @audrasjb
3 months ago

  • Keywords dev-reviewed removed

#41 @audrasjb
3 months ago

Removing trunk version as this is not going to be shipped with WP 7.0 but in the next releases.

@wildworks commented on PR #11750:


3 months ago
#42

@himanshupathak95 Thanks for the update!

I think it would be better to tackle one screen at a time rather than doing all in one. What do you think, @t-hamano?

From this PR, maybe we can ship what's done and then tackle one screen at a time in subsequent PRs.

As far as I can see, this PR addresses most of the issues, so there isn't much additional work required, and I believe everything can be handled within this PR. However, there is a slight overlap between this PR and #11461. It might be best to update this PR after committing #11461 to address any remaining issues. #11461 should be ready for release soon.

@abcd95 commented on PR #11750:


3 months ago
#43

https://github.com/user-attachments/assets/64fd0deb-2cc7-4448-a0c0-2d4e85c3c479

@t-hamano In classic themes, there is also this Customizer screen issue that looks unaddressed. Do you think it can be taken up in a separate PR? Since this one already has a very long conversation.

#44 @wildworks
3 months ago

In 62400:

Admin Reskin: Fix mobile list table control heights.

On the mobile admin viewport, interactive elements on list table pages had inconsistent heights. Give them a consistent height.

Follow-up to [61645].

Props andrewssanya, sainathpoojary, wildworks.
See #64999.

#45 @wildworks
3 months ago

Here is the latest update on this ticket.

trunk branch 7.0 branch
PR 11497 Commited in r62294 Commited in r62378
PR 11461 Commited in r62400 Needs second commenter's sign-off.
PR 11750 Under review
Last edited 3 months ago by wildworks (previous) (diff)

@wildworks commented on PR #11461:


3 months ago
#46

This PR was committed in r62400.

@wildworks commented on PR #11750:


3 months ago
#47

@himanshupathak95, since https://github.com/WordPress/wordpress-develop/pull/11461 has been merged, can we resolve the conflicts with this PR? Thank you!

@wildworks commented on PR #11750:


2 months ago
#49

Thanks for the update, but just a little more adjustment is needed.

Theme preview > Install button

This button is special and is expected to be 32px in mobile layout, not 40px, due to the header having a reduced height. Adding the button-compact class applies a 40px height in the mobile layout via high CSS specificity. Perhaps we can remove the button-compact class from this button and apply min-height: 32px instead?

My apologies, this was my mistake. By removing .button-compact, the button height for the "Add Themes" unexpectedly changed from 32px to 40px.

https://github.com/user-attachments/assets/5c97b68d-d65b-4930-a371-9586b8260ae5

We should probably restore the .button-compact class that was removed in 34b1f5f174bf9d9ac6d0eecb9bee9565bc80edaa.

Another issue we need to address is the theme action button.

https://github.com/user-attachments/assets/9565c73a-d989-4fc4-89b3-6ca3175917e7

The buttons that are automatically registered based on the menu also need the .button-compact class.

<details><summary>Diff</summary>

  • src/wp-admin/themes.php

    diff --git a/src/wp-admin/themes.php b/src/wp-admin/themes.php
    index 226acc94a0..a9f24765ce 100644
    a b if ( is_array( $submenu ) && isset( $submenu['themes.php'] ) ) {  
    381381                       $menu_hook           = get_plugin_page_hook( $submenu[ $item[2] ][0][2], $item[2] );
    382382
    383383                       if ( file_exists( WP_PLUGIN_DIR . "/{$submenu[$item[2]][0][2]}" ) || ! empty( $menu_hook ) ) {
    384                                $current_theme_actions[] = "<a class='button$class' href='admin.php?page={$submenu[$item[2]][0][2]}'>{$item[0]}</a>";
     384                               $current_theme_actions[] = "<a class='button button-compact$class' href='admin.php?page={$submenu[$item[2]][0][2]}'>{$item[0]}</a>";
    385385                       } else {
    386                                $current_theme_actions[] = "<a class='button$class' href='{$submenu[$item[2]][0][2]}'>{$item[0]}</a>";
     386                               $current_theme_actions[] = "<a class='button button-compact$class' href='{$submenu[$item[2]][0][2]}'>{$item[0]}</a>";
    387387                       }
    388388               } elseif ( ! empty( $item[2] ) && current_user_can( $item[1] ) ) {
    389389                       $menu_file = $item[2];
    390390
    391391                       if ( current_user_can( 'customize' ) ) {
    392392                               if ( 'custom-header' === $menu_file ) {
    393                                        $current_theme_actions[] = "<a class='button hide-if-no-customize$class' href='customize.php?autofocus[control]=header_image'>{$item[0]}</a>";
     393                                       $current_theme_actions[] = "<a class='button button-compact hide-if-no-customize$class' href='customize.php?autofocus[control]=header_image'>{$item[0]}</a>";
    394394                               } elseif ( 'custom-background' === $menu_file ) {
    395                                        $current_theme_actions[] = "<a class='button hide-if-no-customize$class' href='customize.php?autofocus[control]=background_image'>{$item[0]}</a>";
     395                                       $current_theme_actions[] = "<a class='button button-compact hide-if-no-customize$class' href='customize.php?autofocus[control]=background_image'>{$item[0]}</a>";
    396396                               }
    397397                       }
    398398
    if ( is_array( $submenu ) && isset( $submenu['themes.php'] ) ) {  
    402402                       }
    403403
    404404                       if ( file_exists( ABSPATH . "wp-admin/$menu_file" ) ) {
    405                                $current_theme_actions[] = "<a class='button$class' href='{$item[2]}'>{$item[0]}</a>";
     405                               $current_theme_actions[] = "<a class='button button-compact$class' href='{$item[2]}'>{$item[0]}</a>";
    406406                       } else {
    407                                $current_theme_actions[] = "<a class='button$class' href='themes.php?page={$item[2]}'>{$item[0]}</a>";
     407                               $current_theme_actions[] = "<a class='button button-compact$class' href='themes.php?page={$item[2]}'>{$item[0]}</a>";
    408408                       }
    409409               }
    410410       }

</details>

I apologize for the delay in the review, but we would appreciate it if you could check it.

#50 @wildworks
2 months ago

  • Owner set to wildworks
  • Resolutionfixed
  • Status newclosed

In 62516:

Admin Reskin: Fix interactive control heights on mobile.

Give interactive elements a consistent 40px height in the admin mobile viewport on the Add Plugins, Media Library grid, Settings > General, and Add Themes screens.

Follow-up to [61645].

Props abcd95, wildworks.
Fixes #64999.

#51 @wildworks
2 months ago

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

Here is the latest update on this ticket. All issues have been resolved, but there are two commits that have not yet been backported to 7.0.

trunk branch 7.0 branch
PR 11497 Commited in r62294 Commited in r62378
PR 11461 Commited in r62400 Needs second commenter's sign-off.
PR 11750 Commited in r62516 Needs second commenter's sign-off.

#52 @masteradhoc
7 weeks ago

@cbravobernal Could you take care of the backporting for the commits Aki mentioned?

#53 @joedolson
6 weeks ago

  • Keywords dev-reviewed added; dev-feedback removed

Reviewed & approving [62400] and [62516] for backport to 7.0 branch.

#54 @joedolson
6 weeks ago

In 62602:

Admin Reskin: Fix mobile list table control heights.

On the mobile admin viewport, interactive elements on list table pages had inconsistent heights. Give them a consistent height.

Follow-up to [61645].

Reviewed by joedolson.
Merges [62400] to the 7.0 branch.

Props andrewssanya, sainathpoojary, wildworks.
See #64999.

#55 @joedolson
6 weeks ago

  • Resolutionfixed
  • Status reopenedclosed

In 62603:

Admin Reskin: Fix interactive control heights on mobile.

Give interactive elements a consistent 40px height in the admin mobile viewport on the Add Plugins, Media Library grid, Settings > General, and Add Themes screens.

Follow-up to [61645].
Reviewed by joedolson.
Merges [62516] to the 7.0 branch.

Props abcd95, wildworks.
Fixes #64999.

Note: See TracTickets for help on using tickets.