Skip to content

fix: WordPress 7.0 admin UI compatibility#401

Merged
imantsk merged 8 commits into
core-betafrom
fix/wp7-admin-ui-compat
Jun 11, 2026
Merged

fix: WordPress 7.0 admin UI compatibility#401
imantsk merged 8 commits into
core-betafrom
fix/wp7-admin-ui-compat

Conversation

@imantsk

@imantsk imantsk commented Jun 8, 2026

Copy link
Copy Markdown
Member

Summary

WordPress 7.0 ships the "modern" admin redesign, which enlarges native form controls (40px vs 30/32px), reduces corner radius (2px vs 3/4px), recolours secondary buttons (transparent + modern-blue #3858E9) and changes link/icon metrics. Our admin UI was designed against the classic WP-6.9 control metrics + brand accent (#2271b1), so the redesign misaligned spacing, colours and icons across the Code Snippets screens.

This adds a small WP-admin compatibility layer that restores the classic control metrics on our admin pages only, plus targeted fixes for bespoke controls. Verified against three environments — local WP 7.0, local WP 6.9, and the remote WP 6.9 reference — with the remote as source of truth.

What's included

  • feat: common/_wp-admin.scss compatibility layer (generic inputs/selects/buttons), imported into each admin bundle and ordered so it sits above WP core defaults but below the plugin's own per-control rules.
  • fix: Go Pro menu button alignment + icon.
  • fix: snippets list table — priority field, row-action links, status-filter (.subsubsub) and active-name colours.
  • fix: Community Cloud "Pro Only" button keeps its brand-orange fill.
  • fix: truncate-row-values class now reaches the list <table> (a ListTable prop-forwarding regression — the screen option did nothing on any WP version).
  • fix: import drop-zone icon spacing.
  • chore: row-action styling consolidated into the component partials (removes duplication with the compat layer).
  • chore: hardcoded control colours/sizes extracted to theme variables.

Scoping / safety

  • Compat bundles load only on Code Snippets pages; the two admin-wide files (menu, admin-bar) contain only CS-prefixed selectors. Verified other plugins (ACF, WPForms) + core screens keep their native WP 7.0 appearance.
  • The compat layer overrides WP core but defers to the plugin's bespoke rules via source order, so no per-element exclusions are needed.

Verification

Computed-style + visual checks across edit-snippet, snippets list, settings, import and community-cloud on WP 6.9 / 7.0 / remote. No regression on WP 6.9. src/dist/ is CI-built (not committed).

@code-snippets-bot code-snippets-bot marked this pull request as ready for review June 11, 2026 08:26
@code-snippets-bot code-snippets-bot added the run-tests Trigger automated tests label Jun 11, 2026
@imantsk imantsk closed this Jun 11, 2026
@imantsk imantsk reopened this Jun 11, 2026
@imantsk imantsk merged commit bec1f00 into core-beta Jun 11, 2026
25 of 35 checks passed
@imantsk imantsk deleted the fix/wp7-admin-ui-compat branch June 11, 2026 10:18
@github-actions

Copy link
Copy Markdown

PHPUnit Test Failure

One or more PHP version targets failed in this workflow run.

See all PHPUnit errors (click to expand)

Affected PHP version: 7.4, 8.0, 8.3, 8.4

PHPUnit\Framework\ExpectationFailedException
Code_Snippets\Tests\Cloud_API_Featured_Test::test_empty_filters_produce_same_cache_key
Empty filter values should hash identically to no filters.
Failed asserting that two strings are identical.
--- Expected
+++ Actual
@@ @@
-'cs_featured_snippets_v1781173252444.3_p1_pp10_d751713988987e9331980363e24189ce'
+'cs_featured_snippets_v1781173252444.2_p1_pp10_d751713988987e9331980363e24189ce'

/home/runner/work/code-snippets/code-snippets/tests/phpunit/test-cloud-api-featured.php:383
phpvfscomposer:///home/runner/work/code-snippets/code-snippets/src/vendor/phpunit/phpunit/phpunit:106

Please review the failing jobs and fix the issues before merging.

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

Labels

run-tests Trigger automated tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants