Skip to content
This repository has been archived by the owner on Jul 12, 2024. It is now read-only.

Hide Settings subnav if no extensions are registered there #5572

Closed
elizaan36 opened this issue Nov 9, 2020 · 9 comments · Fixed by #5630
Closed

Hide Settings subnav if no extensions are registered there #5572

elizaan36 opened this issue Nov 9, 2020 · 9 comments · Fixed by #5630
Assignees
Milestone

Comments

@elizaan36
Copy link
Contributor

Describe the bug
Not necessarily a bug but not a good user experience. Once we roll out the new navigation, there will be a double navigation in Settings - The new navigation subnav on the left, and the core legacy Settings tabs across the top of every Settings screen. This is a bummer for users and could cause confusion (i.e. which settings navigation should I use?)

settings double nav

Solution
Hide the new Settings subnav if there are no extensions registered there. This would hide it in most cases until extensions begin to adopt the new navigation and start registering in the new Settings subnav vs the old legacy tabs. The experience would look like this:

Settings link to legacy tabs
Clicking into the Settings item in the top level nav will open the existing Settings screen on the General tab.

When an extension registers in the new nav settings
Once extensions begin registering in the new nav Settings, we can detect whether the extension is installed and show the new Settings subnav.

interim with double nav
In this interim step, there will be two complete navigations shown. It would be even more confusing to only show one or two links in one nav (in the potential case where we would hide the Core nav items and show extensions.)

Once extensions have all begun adopting the new navigation, we can deprecate the old nav and avoid the double nav issue altogether.

@joshuatf
Copy link
Contributor

joshuatf commented Nov 9, 2020

This is an interesting idea and I see what you mean about the duplicate navigation.

Hide the new Settings subnav if there are no extensions registered there.

I'm a little wary of this approach. We'd have to start defining what the core settings are inside the navigation and we risk getting "out of sync" with what is the default in core.

The good news here is that any extensions who properly register a settings tab/screen will automatically be added to the new Settings menu and do not need to manually register.

Clicking into the Settings item in the top level nav will open the existing Settings screen on the General tab.

I'd prefer to avoid this route if possible since we lose some of the benefits behind the navigation (i.e., adding unnecessary page loads and slowing down the ability to navigate).

What if we removed the navigation tabs on the Settings page? No duplication and we still get all the speed and benefits of the new navigation.

The only issue I see with this is sub-sub-navs (see "Advanced").

Screen Shot 2020-11-09 at 3 21 27 PM

@elizaan36
Copy link
Contributor Author

The good news here is that any extensions who properly register a settings tab/screen will automatically be added to the new Settings menu and do not need to manually register.

That is good news 🎉
This exploration was based on the thinking that extensions had to choose one or the other in Settings, so that changes my opinion about hiding the new nav for the interim.

The only issue I see with this is sub-sub-navs (see "Advanced")

Yep, If we went the route of hiding the legacy top level tabs we've been exploring those possibilities on the design side. The ideal route would be to keep those tertiary level links visible as tabs on the settings screens.

As a possibility, we'd like to introduce the tab component for the tertiary navigation on Settings screens. An example here for Advanced:
image

Can the tertiary tabs remain visible on the Settings screens if the top level tabs are hidden?

@psealock
Copy link
Collaborator

Good call @elizaan36 and introducing the tab component to house tertiary nav items makes sense to me. That could be part of the header. Some design consideration would be needed to handle overlap with the "Help" tab.

Can the tertiary tabs remain visible on the Settings screens if the top level tabs are hidden?

I'm pretty sure we can hide that with CSS when the navigation is turned on. I vote to hide the legacy top level tabs for 1.7.0 and iterate on the tertiary tabs next. Sound good?

@elizaan36
Copy link
Contributor Author

Sounds good. The existing tertiary links are essentially tabs so it makes sense as a first step, then we can update the component in the near future.

@psealock psealock added this to the 1.7.0 milestone Nov 10, 2020
@joelclimbsthings joelclimbsthings self-assigned this Nov 12, 2020
@joelclimbsthings
Copy link
Contributor

@psealock @elizaan36 I spied one issue with this currently, the Tools section:

image

Right now you can access the "System Status" & "Tools" tabs via the side nav, but not "Logs" & "Scheduled Actions." So, if we just hide the top nav we'll lose access to those pages.

Do we just want to take steps to add those items to the side nav as the solution here?

@psealock
Copy link
Collaborator

Nice find @joelclimbsthings, I see the same thing with "Scheduled Actions". Those items aren't being registered for some reason. I think best to track down why that might be.

@joshuatf I also see the System Status tab not being interpreted correctly by the url matching algorithm

Screen Shot 2020-11-13 at 4 49 17 PM

@elizaan36
Copy link
Contributor Author

Yeah, nice catch. One other thing while we're on the topic of missing items - Have y'all seen Products listed in the Settings nav recently? It's missing for me:

missing products

@joshuatf
Copy link
Contributor

Right now you can access the "System Status" & "Tools" tabs via the side nav, but not "Logs" & "Scheduled Actions." So, if we just hide the top nav we'll lose access to those pages.

All of these items are manually registered and added to directly mimic the original designs. If we're planning to update these links and remove the subnavs that exist on the pages, then we'll probably want to remove manual registration and try to populate these a bit more automatically.

We may try and hook into the filter woocommerce_admin_status_tabs to populate this area, but not sure if we'll be able to grab those items since they're probably registered too late.

/cc @jameskoster and @pmcpinto in case you have a different idea of how these submenu items should be added to the nav menus.

I also see the System Status tab not being interpreted correctly by the url matching algorithm

@psealock I see it correctly on the latest main. Can you check that you've pulled the latest? If so and you're still seeing it, we may need to sync up to troubleshoot.

Yeah, nice catch. One other thing while we're on the topic of missing items - Have y'all seen Products listed in the Settings nav recently? It's missing for me:

@joelclimbsthings spotted the fix for this. It has to do with duplicate IDs; we'll get this one fixed shortly.

@pmcpinto
Copy link

I'm not seeing any other way to register these menu items. cc @elizaan36 in case you have any idea

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
5 participants