Skip to content

Admin: Standardize mobile viewport heights for interactive elements#11750

Open
himanshupathak95 wants to merge 14 commits into
WordPress:trunkfrom
himanshupathak95:fix/64999-mobile-form-elements
Open

Admin: Standardize mobile viewport heights for interactive elements#11750
himanshupathak95 wants to merge 14 commits into
WordPress:trunkfrom
himanshupathak95:fix/64999-mobile-form-elements

Conversation

@himanshupathak95
Copy link
Copy Markdown

@himanshupathak95 himanshupathak95 commented May 7, 2026

Trac ticket: https://core.trac.wordpress.org/ticket/64999

This PR fixes inconsistent interactive element heights to 40px in the admin mobile viewport (≤782px) on:

  • Plugins > Add Plugin: search field, Keyword dropdown, Install button
  • Media Library > Grid: filter dropdowns, search field, Bulk select button
  • Settings > General: Custom date format and time format inputs

Follow-up to [62294].

Tested in Chrome at 782px viewport width (mobile emulation). Before/after
screenshots attached.

Screen / Component Before After
Add Themes > Search field Before Add Themes Search Field After Add Themes Search Field
Settings > General > Custom date/time format inputs Before Custom Date Time Inputs After Custom Date Time Inputs
Plugins > Add Plugin > Search field Before Plugin Search Field After Plugin Search Field
Plugins > Add Plugin > Keyword dropdown Before Plugin Keyword Dropdown After Plugin Keyword Dropdown
Media Library > Grid > Filter dropdowns Before Media Filter Dropdowns After Media Filter Dropdowns
Media Library > Grid > Search input Before Media Search Input After Media Search Input
Media Library > Grid > Bulk select button Before Bulk Select Button After Bulk Select Button

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 7, 2026

Test using WordPress Playground

The changes in this pull request can previewed and tested using a WordPress Playground instance.

WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser.

Some things to be aware of

  • All changes will be lost when closing a tab with a Playground instance.
  • All changes will be lost when refreshing the page.
  • A fresh instance is created each time the link below is clicked.
  • Every time this pull request is updated, a new ZIP file containing all changes is created. If changes are not reflected in the Playground instance,
    it's possible that the most recent build failed, or has not completed. Check the list of workflow runs to be sure.

For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation.

Test this pull request with WordPress Playground.

@himanshupathak95 himanshupathak95 force-pushed the fix/64999-mobile-form-elements branch from dca69f9 to 220cc0c Compare May 8, 2026 08:53
@himanshupathak95 himanshupathak95 marked this pull request as ready for review May 8, 2026 08:56
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 8, 2026

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

Core Committers: Use this line as a base for the props when committing in SVN:

Props abcd95, wildworks.

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@t-hamano t-hamano force-pushed the fix/64999-mobile-form-elements branch from 220cc0c to 3f78edc Compare May 12, 2026 02:21
Copy link
Copy Markdown
Contributor

@t-hamano t-hamano left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR! It looks good for the most part, but there are a few points that need further adjustment.


Media Library (List view): We should be able to use the button-compact class on these two buttons without writing any CSS.

Image

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

Image

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

Image

Comment thread src/wp-admin/css/media.css Outdated
@himanshupathak95 himanshupathak95 force-pushed the fix/64999-mobile-form-elements branch 2 times, most recently from 2545903 to c4e83fc Compare May 12, 2026 07:24
@himanshupathak95
Copy link
Copy Markdown
Author

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 Theme Activate Before Theme Activate After
Plugin Install Button Plugin Install Before Plugin Install After
Mode Before After
Grid Mode
Screen.Recording.2026-05-12.at.13.00.25.mov
Screen.Recording.2026-05-12.at.12.58.19.mov
List Mode
Screen.Recording.2026-05-12.at.13.00.43.mov
Screen.Recording.2026-05-12.at.12.57.58.mov

Copy link
Copy Markdown
Contributor

@t-hamano t-hamano left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the update!

Please note that on mobile layouts, the button height is generally 40px. Therefore, the button height in the following layout is incorrect.

Theme Activate Button:
Theme Activate After

Plugin Install Button:
Plugin Install After

The .buttom-compact class should also be usable in these areas.

Comment thread src/wp-admin/includes/class-wp-media-list-table.php Outdated
Comment thread src/wp-admin/css/list-tables.css Outdated
Comment thread src/wp-includes/css/buttons.css
@himanshupathak95
Copy link
Copy Markdown
Author

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 #11750 (review), 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?

@t-hamano
Copy link
Copy Markdown
Contributor

I intentionally made them 32px in size since you asked the same in #11750 (review), 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.

@himanshupathak95 himanshupathak95 force-pushed the fix/64999-mobile-form-elements branch from c4e83fc to 139d9c4 Compare May 14, 2026 12:34
Comment on lines -122 to -124
min-height: 32px;
line-height: 2.30769231; /* 30px for 32px min-height */
padding: 0 12px;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change is not intended. On the desktop layout, the button size changes from 32px to 40px. Along with the removal of these styles, each button needs the button-compact class. This will ensure that the button height is 32px on the desktop layout and 40px on the mobile layout.

The file to be edited is likely theme-install.php.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants