Repository navigation
Storybook: Stop Settings Page examples moving the docs page on navigation - #87166
Merged
Merged
Conversation
…tion Navigating inside a Settings Page example moved the surrounding docs page in two ways. Focusing the new page region scrolled it into view, and pages of different lengths resized the example, so the reader lost their place. Focus the region with `preventScroll`, and give the example frame a fixed height so `Page` scrolls its own content, as it does in the admin. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
🤖 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.69 MB
|
ciampo
reviewed
Nov 20, 2026
TanStack Router scrolls the window to the top after each navigation. In the Settings Page examples that window is the docs page, so opening a subpage sent the reader to the top of the docs. Opt out with a `scrollRestoration` function that returns false. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ciampo
reviewed
Nov 20, 2026
On short screens a 720px frame could leave a page's fields above the viewport, so the example looked blank. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Vedant-Gandhi
pushed a commit
to Vedant-Gandhi/gutenberg
that referenced
this pull request
Nov 30, 2026
…tion (WordPress#87166) * Storybook: Stop Settings Page examples moving the docs page on navigation Navigating inside a Settings Page example moved the surrounding docs page in two ways. Focusing the new page region scrolled it into view, and pages of different lengths resized the example, so the reader lost their place. Focus the region with `preventScroll`, and give the example frame a fixed height so `Page` scrolls its own content, as it does in the admin. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Storybook: Stop the Settings Page router resetting the docs scroll TanStack Router scrolls the window to the top after each navigation. In the Settings Page examples that window is the docs page, so opening a subpage sent the reader to the top of the docs. Opt out with a `scrollRestoration` function that returns false. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Storybook: Cap the Settings Page example height at the viewport On short screens a 720px frame could leave a page's fields above the viewport, so the example looked blank. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: jameskoster <jameskoster@git.wordpress.org> Co-authored-by: ciampo <mciampini@git.wordpress.org>
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?
Follow up to #86451.
Stops the Settings Page pattern examples from moving the surrounding docs page when you navigate inside them.
Why?
Clicking a navigation item or a subpage row (such as the gateways under "Payment gateways") in the Settings Page examples moved the docs page around the example, so readers lost their place. There were two causes:
Pageregion.focus()also scrolled that region into view, which moved the docs page.How?
{ preventScroll: true }. Focus still moves, so screen readers still announce the new page.block-size: 720pxinstead ofmin-block-size: 640px.Pagealready scrolls its own content with a sticky header, so each example now behaves like an admin screen: the docs page keeps its height, long pages scroll inside the frame, and a new page opens at its top.Testing Instructions
npm run storybook:devand open Design System → Patterns → Settings Page.Testing Instructions for Keyboard
Use of AI Tools
Claude Code (Claude Opus 5.5) diagnosed the issue, wrote the change, and checked it in the running Storybook. I reviewed the result.
🤖 Generated with Claude Code