fix(ai): UI polish fixes for Jetpack MCP settings page#48524
fix(ai): UI polish fixes for Jetpack MCP settings page#48524
Conversation
|
Are you an Automattician? Please test your changes on all WordPress.com environments to help mitigate accidental explosions.
Interested in more tips and information?
|
|
Thank you for your PR! When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:
This comment will be updated as you work on your PR and make changes. If you think that some of those checks are not needed for your PR, please explain why you think so. Thanks for cooperation 🤖 Follow this PR Review Process:
If you have questions about anything, reach out in #jetpack-developers for guidance! Jetpack plugin: No scheduled milestone found for this plugin. If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack. |
Code Coverage SummaryCoverage changed in 3 files.
Full summary · PHP report · JS report Coverage check overridden by
I don't care about code coverage for this PR
|
- Fix browser Back button: use pushState/popstate so the Back button returns to the hub instead of leaving the AI page entirely - Change quick setup instructions from <ol> to <ul> in the Setup view - Fix 'All enabled' label vertical alignment in category headers - Tighten toggle help-text margin-top from 8px to 4px for more even visual rhythm between tool toggle rows Fixes AIINT-392. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Add NAVIGATION sub-category to Sites section (menus, navigation tools) - Rename SITES sub-category to SITE_INFO, ACCOUNT to PROFILE - Add BILLING as a separate Account sub-category - Move list_themes to SITE_SETTINGS sub-group via tool-ID overrides - Restore <ol> ordered list for quick setup instructions Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…y log URL - Replace exact tool-ID map with prefix-based matching (wpcom-mcp/navigation-, wpcom-mcp/menus-, wpcom-mcp/menu-items- → Navigation sub-group; wpcom-mcp/themes-, wpcom-mcp/theme- → Site settings sub-group) - On self-hosted sites, link activity log to local wp-admin page (admin.php?page=jetpack-activity-log) instead of cloud.jetpack.com Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
16ab6dc to
38a2728
Compare
… to Design card Port the exact same logic from wp-calypso categories.ts: - Navigation, menus and themes tools (category: 'sites') are moved to the Design display card via tool ID prefix matching in getDisplayCategory - Design card gains sub-categories: Themes, Patterns, Templates, Global styles, Navigation, Blocks — ordered and divided exactly as in calypso - Sites card sub-groups revert to: Sites, Plugins, Site settings, Media, Analytics - Account sub-groups revert to: Account, Notifications (billing maps to Account) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
wp-admin resets list-style to none globally; add ul.jetpack-ai-mcp-setup__steps
{ list-style: disc } to restore bullets for the unordered steps list.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
inline-flex aligns to the text baseline by default, which shifts the icon+text span down inside the Badge component. vertical-align: middle centres it correctly. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Setting line-height:1 eliminates the descender space that caused the inline-flex span to drift off the visual centre of the Badge. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The rule was nested inside .jetpack-ai-mcp-setup{} which compiled it to
a descendant selector — no such ancestor exists in the markup, so the
wp-admin ul { list-style: none } reset was winning.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
This PR polishes the Jetpack AI MCP settings admin experience by improving sub-view navigation behavior, refining tool grouping/presentation, and correcting the activity log destination for self-hosted sites.
Changes:
- Update sub-view navigation to use
history.pushState/popstateso browser Back returns to the MCP hub. - Refine MCP UI styling (setup list bullets, toggle spacing, badge/label alignment).
- Adjust tool categorization/sub-grouping to align with wp-calypso and change the self-hosted activity log URL to the local wp-admin page.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| projects/plugins/jetpack/changelog/aiint-392-jetpack-ai-mcp-settings-ui-polish-fixes | Adds a changelog entry for the MCP settings UI polish work. |
| projects/plugins/jetpack/_inc/lib/admin-pages/class-jetpack-ai-page.php | Updates the activity log link behavior to use WPCOM on Atomic and local wp-admin on self-hosted. |
| projects/plugins/jetpack/_inc/client/ai/mcp/style.scss | Tweaks MCP settings page styling for badge alignment, toggle label alignment, help-text spacing, and list bullets. |
| projects/plugins/jetpack/_inc/client/ai/mcp/setup.jsx | Switches quick-setup steps from ordered to unordered lists. |
| projects/plugins/jetpack/_inc/client/ai/mcp/categories.js | Updates tool category/sub-category mapping and routes certain sites tools into the Design card via tool ID prefix matching. |
| projects/plugins/jetpack/_inc/client/ai/main.jsx | Implements pushState-based view navigation and breadcrumb Back behavior. |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
…et_long_description_by_usage_tier() Cast $tier to (int) before using as array key so that null returned by get_next_usage_tier() maps to 0 rather than triggering the PHP 8.1+ "Using null as an array offset is deprecated" notice. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…tch statement Per review feedback: replace the sparse-keyed array + isset pattern with a switch on (int) $tier. Same behavior (null still maps to default), more readable. Also widen the @param to int|null since get_next_usage_tier() documents a null return. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Fixes https://linear.app/a8c/issue/AIINT-392/jetpack-ai-mcp-settings-ui-polish-fixes
Proposed changes
pushStateso the browser Back button returns to the MCP hub rather than leaving the AI admin page entirely. The breadcrumb "AI" link callshistory.back()to pop the same entry, keeping history clean.<ol>(numbered) to<ul>(bulleted) for Claude and Claude Code clients. Addedul.jetpack-ai-mcp-setup__steps { list-style: disc }at top-level scope to restore bullets overridden by the wp-admin global reset.margin-topon.components-base-control__helpfrom 8px to 4px for more even visual rhythm between tool toggle rows.categories.jswith wp-calypso — navigation, menus, and themes tools (API categorysites) are moved to the Design card using tool ID prefix matching (wpcom-mcp/navigation-*,wpcom-mcp/menus-*,wpcom-mcp/menu-items-*,wpcom-mcp/theme-*,wpcom-mcp/themes-*). The Design card gains sub-categories: Themes, Patterns, Templates, Global styles, Navigation, Blocks (divided by CardDividers, no visible labels). Sites and Posts cards also get sub-category dividers.vertical-align: centeron.jetpack-ai-mcp__badge-contentto counteract the inline-flex baseline shift inside the Badge component.wp-admin/admin.php?page=jetpack-activity-logpage instead of the cloud.jetpack.com redirect.Does this pull request change what data or activity we track or use?
No.
Testing instructions
wp-admin/admin.php?page=aion a site with an AI account that has MCP access.