Repository navigation
Admin UI: Include Page component documentation in MCP component manifest - #86615
Conversation
🤖 PR meta 🤖🎉 PropsIf you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. Props Bot commandsYou can trigger Props Bot actions by commenting on this PR:
Updated as activity occurs, without notifying anyone named here. Add the 📦 Bundle sizeSize Change: 0 B Total Size: 8.65 MB
⚡ PerformanceShow the resultsClient side metrics exclude the server response time. front-end-block-theme
front-end-classic-theme
media-processing
media-upload
post-editor
site-editor
🏁 Flaky testsSome tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information. Actions are reachable via RIGHT/LEFT arrow keys (Site Editor v2) in
|
| For these reasons, even if the `Tabs` component is fully extensible, we don't recommend using `Tabs` with links, and we don't currently provide any related Storybook example. | ||
|
|
||
| We may provide a dedicated component for tabs-like links in the future based on the feedback received. | ||
| To switch between sections of an admin screen that each have their own URL, use the `navigation` prop of [`Page`](?path=/docs/admin-ui-page--docs) from `@wordpress/admin-ui` instead. |
There was a problem hiding this comment.
Thanks for this!
❤️
For what it's worth, the original comment isn't totally invalid. We may still want a dedicated UI component for this. What was implemented for Page was intentionally limited for Page use-cases until this matured a bit more. But our documentation should be more helpful to point people to the options that exist today.
|
I'll defer to Marco on actual approval, but thanks for working on this. The inclusion of the term "tabs" is useful, SEO wise, because while this horizontal row of navigation items isn't tabs in the strict technical sense, it is likely people will still search for that word and need guidance towards the right componentry. |
That's a good call-out. The pull request in its current state doesn't actually use the word "tabs" when describing the page navigation. Do you have any suggestions on how to incorporate this into the current proposed text?
Maybe something like "links to the sections of the screen (presented in a tabs-like layout)". It's a fine line between "SEO"-like optimization for how this would be described by people in the real world, vs. it not actually being tabs 😅 . |
ciampo
left a comment
There was a problem hiding this comment.
"links to the sections of the screen (presented in a tabs-like layout)".
This could work, let's give it a try 🚀
Separately, should I pick up #80446 ? It may inherently help to have the actual Tabs alternative at the @wordpress/ui level?
Yes it's something like this that I was thinking. And there are lots of clever ways you can include the "keyword" without even being shady about it. It could be something like:
The above is too verbose, quickly put together, and purely an example. But the point is, it includes the keywords while still being useful. |
It could be good insofar that people are starting to use these abstractions, and they may be overly limited by what the Page component currently supports. That could be improved through the UI primitive, but could also be improved through Page itself if we want to continue exploring it at the higher-level abstraction. Were there particular blockers or concerns around the implementation of #80446, or was it more about prioritization? |
|
I pushed a few small language refinements in f07b9b7 and cda8fcc, to incorporate this "tab-style" qualifier, and to make the usage guidelines a bit more clear. Currently, usage guidelines aren't incorporated into what AIs see through the MCP server, but this is something we should plan to incorporate (needs a dedicated issue, but @simison pushed an exploration in #85203). I waffled whether to include a note that there may be a separate UI primitive component added to support this that we could reference in the Tabs usage guidelines, but opted to omit it. Once we have a component we should plan to mention it there. |
Prioritisation - we decided to pause work in order to give The other blocker is a lack of design spec. I'll follow-up in the PR. |
cda8fcc to
e8639b9
Compare
ciampo
left a comment
There was a problem hiding this comment.
Two small follow-ups for the published examples.
| component: Page, | ||
| id: 'admin-ui-page', | ||
| title: 'Design System/Admin UI/Page', | ||
| tags: [ 'manifest' ], |
There was a problem hiding this comment.
The breadcrumb snippets omit the router context supplied by withRouter, so they fail when copied into an app without that context. Could we document that prerequisite in their story descriptions, or exclude those stories from the manifest for now?
| component: Page, | ||
| id: 'admin-ui-page', | ||
| title: 'Design System/Admin UI/Page', | ||
| tags: [ 'manifest' ], |
There was a problem hiding this comment.
The breadcrumb and headerless examples have neither title nor ariaLabel, so their page regions have no accessible name. Could we add explicit ariaLabel values to those story args?
There was a problem hiding this comment.
The breadcrumb and headerless examples have neither
titlenorariaLabel, so their page regions have no accessible name. Could we add explicitariaLabelvalues to those story args?
This is also something where I'd like to move away from this being a Page-level concern (see #77628 (comment) and #86701 (comment)), but I think a solution there is still abstract and the stories here are quite contradictory with our documented recommendations. For example, the ariaLabel description already says it should be provided in the case of breadcrumbs (the description was added in this pull request), so we should be at least consistent there.
|
@ciampo Thanks for the feedback and sorry for the delay in addressing them; I'll plan to open some pull requests tomorrow for this. |
…est (WordPress#86615) * Admin UI: Include Page component documentation in MCP component manifest * Admin UI: Update Page story to use publicly-accessible types * Add "tab-style" qualifier for describing links in Page header * Refine language around Tabs best practices Co-authored-by: aduth <aduth@git.wordpress.org> Co-authored-by: ciampo <mciampini@git.wordpress.org> Co-authored-by: jasmussen <joen@git.wordpress.org>
What?
Improves documentation for the
Pagecomponent in@wordpress/admin-uiand makes it available in the component manifest used by the Design System MCP server.Why?
Tabscomponent when implementing page navigation. This is despite there being guidance against this practice. But because AI agents don't have a clearly documented alternative, this is the best it can work with.Pagecomponent as what should be used to build settings pages, but AI agents currently have no access to documentation about the component using the MCP server.How?
@wordpress/componentsand@wordpress/uidespite this already being untrue, since the MCP server already documents components from@wordpress/dataviews. New language uses inclusive phrasing "such as".@wordpress/ui, but we should at least be clear that there is an option available today to create navigation throughPage.Testing Instructions
Verify updated content for accuracy.
Using the Storybook Preview link in the PR meta comment of this pull request, you should be able to navigate to the Storybook's
/manifests/components.jsonpath and see that it includes documentation for Page and its props now.Use of AI Tools
Researched and implemented in coordination with Claude Code + Opus 5.5.