Skip to content

Plugins: Fix search box margin when filter links wrap on Add Plugins/Media screens#12687

Open
irozum wants to merge 1 commit into
WordPress:trunkfrom
irozum:enhancement/64143-plugin-search-box-lacks-margin
Open

Plugins: Fix search box margin when filter links wrap on Add Plugins/Media screens#12687
irozum wants to merge 1 commit into
WordPress:trunkfrom
irozum:enhancement/64143-plugin-search-box-lacks-margin

Conversation

@irozum

@irozum irozum commented Jul 25, 2026

Copy link
Copy Markdown

On the Add Plugins screen (plugin-install.php) and the Media Library (upload.php), the filter-links row and the search box are laid out with flexbox and flex-wrap: wrap, but the container had no row-gap. When the filter-links row is long enough to wrap onto its own line — which happens once enough tabs are present (e.g. after a search adds a "Search Results" tab, or a plugin like WooCommerce adds extra tabs) — the search box below it has no separation and sits flush against the wrapped row. A prior fix (#64809) patched this only below a fixed 1250px viewport width, but the underlying wrap point depends on tab content length, not a fixed breakpoint, so the same bug still reproduces above 1250px with a long enough filter-links row.

This replaces that fragile fixed-breakpoint rule with row-gap: 11px on the flex container itself, so spacing is applied automatically whenever the row wraps, at any viewport width. The old @media (max-width: 1250px) rule targeting .plugin-install-search is removed as redundant — worse, it was stacking with the new row-gap to produce a 22px gap instead of 11px in that specific case.

Note on scope: this ticket's title refers to the Installed Plugins screen's search box (plugins.php), and the currently open PR #10414 targets that page specifically. I found that page already has correct margin (p.search-box { margin: 11px 0; }, added in 2024) and PR #10414's selector (.wp-filter .search-form.search-plugins) doesn't match anything there — that page's search form isn't nested inside a .wp-filter container. The actual reproducible bug described by the original commenters (using the "Search Results"/"Beta Testing" tabs, which only exist on the Add Plugins screen) is on plugin-install.php and upload.php, which is what this PR fixes.

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

Use of AI Tools

AI assistance: Yes
Tool(s): Claude Code
Model(s): Claude Sonnet 5
Used for: Investigation (including determining that the ticket's original proposed fix and PR #10414 don't address a reproducible bug), implementation, and PR description. Reviewed by Igor Rozum.


This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.

Copilot AI review requested due to automatic review settings July 25, 2026 01:20
@github-actions

Copy link
Copy Markdown

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 irozum.

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

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes cramped layout on the Add Plugins (plugin-install.php) and Media Library (upload.php) admin screens when the .wp-filter flex container wraps, ensuring the search box doesn’t sit flush against wrapped filter links.

Changes:

  • Adds row-gap: 11px to the wrapping flex .wp-filter container on plugin-install.php and upload.php.
  • Removes the older @media (max-width: 1250px) margin rule that became redundant and could double the spacing.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 1387 to 1391
@media only screen and (max-width: 1138px) {
.wp-filter .search-form {
margin: 11px 0;
}
}
@github-actions

Copy link
Copy Markdown

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.

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