Site editor: obviate sidebar context#69172
Draft
stokesman wants to merge 2 commits into
Draft
Conversation
|
Size Change: -56 B (0%) Total Size: 1.84 MB
ℹ️ View Unchanged
|
6 tasks
Contributor
|
Hi @stokesman, I'd like to confirm that this PR is still necessary, as #68929 has been fixed by #69413. |
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?
The moves some state into the router so that it can be accessed without a context provider.
Why?
This should facilitate fixing some style issues and improving the markup in the site editor by getting rid of the need for components that rely on this state having to be nested within the sidebar.
Closes #68929
How?
Moves the state from the sidebar and its context provider to the router. A new helper hook is introduced and used in place of the
navigatefunction that was provided by the sidebar context.Right now this is based on #69103 because it does a similar thing and includes a change needed here too (exposing the router’s location.state through the
useLocationhook.).Testing Instructions
Maintained functionality of trunk (non-mobile-sized viewports)
These are keyboard instructions because otherwise focus rings aren’t visible.
As a fix for #68929
Bonus fix for mobile size viewports
Right now, the sidebar focus management fails in mobile sized viewports. I’ll get back to this later…