Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Site editor: add support for more deep links for the Site Editor #57312

Open
annezazu opened this issue Dec 21, 2023 · 4 comments
Open

Site editor: add support for more deep links for the Site Editor #57312

annezazu opened this issue Dec 21, 2023 · 4 comments
Labels
[Feature] Site Editor Related to the overarching Site Editor (formerly "full site editing") Needs Dev Ready for, and needs developer efforts [Type] Enhancement A suggestion for improvement.

Comments

@annezazu
Copy link
Contributor

What problem does this address?

I'm working with @adamziel to setup a WordPress Playground instance where I can spin up specific live previews of features that folks can then explore. In doing so, I am running into limitations not due to playground itself but because of limitations with URL params and the lack of deep linking in the Site Editor. For example, I’d love to be able to send someone a live preview of styles open with style book turned on but there isn't support for deep links for this kind of functionality. From what Adam has indicated, creating a feature plugin for this would be difficult because some of these UI states are internal to React components and contexts.

In general, this could also be useful for situations like exposing the Styles UI for classic themes as described here: #41119 (comment) and likely for broader support documentation.

What is your proposed solution?

Add support for deep links to various interfaces including:

  • Styles
  • Style Book
  • Invoking the command palette

I don't know the reasoning for the lack of this support right now so am also generally curious there. Those are the items off the top of my head but kicking this off so I can add to it as I continue to experiment with WP Playground.

@annezazu annezazu added [Type] Enhancement A suggestion for improvement. Needs Dev Ready for, and needs developer efforts [Feature] Site Editor Related to the overarching Site Editor (formerly "full site editing") labels Dec 21, 2023
@annezazu annezazu changed the title Site editor: add support for deep links for the Site Editor Site editor: add support for more deep links for the Site Editor Dec 21, 2023
@annezazu
Copy link
Contributor Author

For even more context, here's a post where I'd love to include a live preview link for folks to immediately see a feature/tool in action from the /News post: WordPress/Marketing-Team#335 It would be hugely helpful and a game changer to allow for that for features like the style book and command palette.

@adamziel
Copy link
Contributor

Cc @youknowriad @scruffian @talldan

@talldan
Copy link
Contributor

talldan commented Dec 22, 2023

The styles are accessible through wp-admin/site-editor.php?path=%2Fwp_global_styles, but I'm guessing the request is for the global styles sidebar in edit mode.

There previously was a deep link to that. I had #38172 open for a very long time with no resolution, and it ended up being resolved differently 😄 See also #49585.

I do wonder whether opening sidebars and modals using a route or query param is good practice. Would it work ok with the back button? History is linear and one dimensional, but sidebars are multi-dimensional since you can have a combination of them open or closed, so I guess the best thing would be for this to not affect the browser history.

Maybe an option is to have a url like http://localhost:8888/wp-admin/site-editor.php?canvas=edit&sidebar=styles, when navigated to the page processes the opening of the sidebar and then immediately replaces the path to remove the sidebar param. Thinking of a good url schema for different parts of the UI becomes pretty complicated.

@carolinan
Copy link
Contributor

I need this too for the same reason :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Site Editor Related to the overarching Site Editor (formerly "full site editing") Needs Dev Ready for, and needs developer efforts [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

No branches or pull requests

4 participants