Open annezazu opened 8 months ago
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: https://github.com/WordPress/Marketing-Team/issues/335 It would be hugely helpful and a game changer to allow for that for features like the style book and command palette.
Cc @youknowriad @scruffian @talldan
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.
I need this too for the same reason :)
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: https://github.com/WordPress/gutenberg/issues/41119#issuecomment-1381633892 and likely for broader support documentation.
What is your proposed solution?
Add support for deep links to various interfaces including:
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.