gutenberg icon indicating copy to clipboard operation
gutenberg copied to clipboard

Focus mode for content types needs means to immediately "go back" to full site editing view

Open getdave opened this issue 2 years ago • 10 comments

Some content types have a "focus mode" which allows you to edit just the content related to that content type. Examples of this include Template Parts and Navigation Menus.

However, once you enter this mode and the left hand site "Site View" sidebar is collapsed it is very difficult to know how you can get back to the Site Editor view for the entire site.

Reproduction Steps

A good example of this is when you edit a template part from the Site Editor.

  • Click "Header" template part
  • Click "Edit" in block toolbar
  • Land in "Focus Mode" for the Header template part.
  • There is no obvious route back to the full Site view.
  • Click the "W" icon to open the left hand "Site View" sidebar
  • Notice that you now have to click the "<" (back) arrow several times to get back to the full site editing view

Suggested Solution

There needs to be a "Back to Site Editor" option which immediately takes you back to the Site Editor for the entire site (or at least immediately back to where you were before you entered focus mode).

Screenshots

https://github.com/WordPress/gutenberg/assets/444434/a2d37bbe-bff5-44f9-87fd-dd195e9d050a

https://github.com/WordPress/gutenberg/assets/444434/40f1029d-e3b7-475e-b234-6b6aa4c765f9

getdave avatar Nov 15 '23 15:11 getdave

We had a hallway hangout this week to chat about using focus mode + list view in place of the navigation mode and this issue came up when thinking about adding focus mode to more container blocks https://github.com/WordPress/gutenberg/issues/45264. Here's the part of the call where we talked about this:

https://github.com/WordPress/gutenberg/assets/26996883/0c58a7a7-0828-4c73-b867-d7997feb090c

Specifically, the back button currently just drops you without focus back into the Site Editor and the ideal would be that it returned you to a state of focus on the edit button once more where you started.

annezazu avatar Nov 17 '23 18:11 annezazu

The back button that's shown in that hallway hangout video isn't showing for all templates. I think that's what this issue is about? For example, when clicking through to edit Header from the home template in TT4, there's no back button in the focused editor. I'm not sure at what point the regression happened; it seems to work fine in WP 6.4 but not in the latest Gutenberg. It would be great to bring it back (and also to solve the focus situation on clicking the back button!)

tellthemachines avatar Dec 04 '23 03:12 tellthemachines

The back button that's shown in that hallway hangout video isn't showing for all templates.

The way the BackButton component works is that it's looking for for a fromTemplateId in location.state, otherwise it won't render.

The fromTemplateId is meant to indicate that a user has drilled-down from a template. It's set in a hook that renders the "Edit" button in the toolbar, e.g., https://github.com/WordPress/gutenberg/blob/trunk/packages/edit-site/src/hooks/navigation-menu-edit.js#L46

fromTemplateId doesn't exist when navigating from the "Manage all..." pages, or when landing on a template part/navigation post type in editing mode. The button, therefore, won't show.

Edit: I put up a semi-related PR in https://github.com/WordPress/gutenberg/pull/56741, though it may not 100% fix this issue, addresses the situation where a user edits an in-place template area where postId doesn't exist in the URL params.

ramonjd avatar Dec 04 '23 05:12 ramonjd

In https://github.com/WordPress/gutenberg/pull/55657 I am using the "Back" button in the top toolbar rather than this "in canvas" version.

Screen Shot 2023-12-04 at 10 17 56

Why? Because I spoke with @jasmussen and he advised that this should become the default back button UI.

getdave avatar Dec 04 '23 09:12 getdave

Yes, it seems a better place for it, compared to the canvas where the breadcrumbs-like behavior isn't surfaced.

jasmussen avatar Dec 04 '23 09:12 jasmussen

Oh great. I'm happy to cull https://github.com/WordPress/gutenberg/pull/56741 if the existing Back button is going to be purged in favour of the header navigation bar there, which I think is a good idea :D

ramonjd avatar Dec 04 '23 22:12 ramonjd

Oh so is the plan to add the Back button to that top-center toolbar in all views? That would be great in terms of the button being easier to find 😄

tellthemachines avatar Dec 05 '23 00:12 tellthemachines

Oh so is the plan to add the Back button to that top-center toolbar in all views? That would be great in terms of the button being easier to find 😄

That's nice, though it does not tend to the actual issue reported:

When you are in a focus view, the <- Back should always take you back to the view that the focus view was invoked from. Currently it acts as a "Back" action, which if not immediately invoked will not take you back to the initial view.

It's particularly rough when you start from a refresh, as you can't ever get back.

https://github.com/WordPress/gutenberg/assets/1813435/79740ab8-6518-4196-ab1d-259d61d00f51

richtabor avatar Dec 05 '23 18:12 richtabor

While testing https://github.com/WordPress/gutenberg/pull/58528, I noticed that because I had top toolbar enabled, this was completely hidden unless I hid the block toolbar settings:

https://github.com/WordPress/gutenberg/assets/26996883/fc520baf-a2bf-4b33-ace0-b45b1b81c51f

Something to consider as we improve this experience and change where the back button is shown! For those using the top toolbar, it's incredibly difficult to find a way to return. Happy to open a separate issue if folks prefer.

annezazu avatar Feb 12 '24 21:02 annezazu

I have an example that I ran into which was very confusing for me. This does not seem related to the in-canvas back button.

Steps:

  1. Click Templates
  2. Edit a template
  3. Click W site icon
  4. Click on Header
  5. Click back button (I'm lost because I'm not where I was before)
  6. Click back button again (Still lost because I'm not where I was before)
  7. Click Templates (to get back to where I was)

https://github.com/WordPress/gutenberg/assets/618551/8f814729-8901-4e84-8f1c-2f0a54e5b67a

davewhitley avatar May 01 '24 19:05 davewhitley