Repository navigation
Storybook: Keep Docs before named attached MDX pages - #85308
Merged
Merged
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. Updated as activity occurs, without notifying anyone named here. Add the 📦 Bundle sizeSize Change: 0 B Total Size: 9.05 MB
|
mirka
marked this pull request as ready for review
October 22, 2026 06:08
im3dabasia
approved these changes
Oct 22, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



What?
Keep the Docs page above named attached MDX pages, including TextareaControl's Migration Guide, in the Storybook sidebar.
Follow-up to #84563.
Why?
The existing Docs-first comparison works for entries sharing a title, but the earlier hierarchy comparison treats a named attached MDX page as a standalone page. For example, TextareaControl's Migration Guide is prioritized ahead of neighboring components while its Docs page is sorted alphabetically. These contradictory comparisons allow the migration guide to appear above Docs in the complete index.
How?
Exclude named attached MDX entries from the hierarchy's standalone-MDX priority. Entries named Docs retain that priority, preserving nested documentation pages such as Badge's Usage Guidelines. The existing same-title priority then puts Docs before the migration guide and examples.
This also fixes the same ordering issue in CheckboxControl, InputControl, RadioControl, ToggleControl, Tabs, Menu, and Combobox.
Extend the existing sidebar validator to require every Docs page to precede all other entries in its folder, including nested documentation. Run it against the complete generated index in the existing Storybook CI job.
Testing Instructions
?path=/docs/components-textareacontrol--docs.Screenshots or screencast