opensearch-project / OpenSearch-Dashboards

📊 Open source visualization dashboards for OpenSearch.
https://opensearch.org/docs/latest/dashboards/index/
Apache License 2.0
1.67k stars 871 forks source link

[RFC][Navigation] Introduce `group` in chrome service to group applications and categories. #7029

Closed SuZhou-Joe closed 2 months ago

SuZhou-Joe commented 3 months ago

OpenSearch Dashboards has used a concept of category to group related applications in left navigation:

image

But as the number of plugins and applications grow larger and larger, a single level of grouping is not enough and it has become more and more crowded and noisy for left navigation to host such numerous links. image

For more context, please refer to the #issue(issue_link of UX RFC of navigation)

Introduction

In order to mitigate the issue described above, OpenSearch Dashboards is going to introduce group, a higher level concept to group related features and categories.

Navigation in home page when no group is selected: Home

Navigation when group is selected: Observability

What requirements need to meet

1. Decouple applications and categories.

OpenSearch Dashboards used to have the assumption that an application can only belong to one category, but that's not the case in the new version of left navigation. For example, Dashboards belong to:

  1. dashboard and report category under Security analytics group.
  2. monitor category under observability group.

2. A UX revamp on left navigation.

The left navigation needs a revamp regarding we have group

3. Categories re-org for all the existing applications.

4. Some use cases should be pickable from workspace creation page

image

5. Customers should be able to visit the application through previous deep link

Users may keep deep link like app/${applicationId} and we need to make sure they can still visit the page even when they use the old url.

Interface design

Previously, plugins use the way below to register their applications:

coreSetup.application.register({
    id: DashboardConstants.DASHBOARDS_ID,
    title: 'Dashboards',
    order: 2500,
    euiIconType: 'inputOutput',
    defaultPath: `#${DashboardConstants.LANDING_PAGE_PATH}`,
    updater$: this.appStateUpdater,
    category: DEFAULT_APP_CATEGORIES.opensearchDashboards,
});

Extend chrome_service interface to support group

After we introduce the group, plugins needs to register their applications as:


/* start -- exactly the same as previous code */
coreSetup.application.register({
    id: DashboardConstants.DASHBOARDS_ID,
    title: 'Dashboards',
    order: 2500,
    euiIconType: 'inputOutput',
    defaultPath: `#${DashboardConstants.LANDING_PAGE_PATH}`,
    updater$: this.appStateUpdater,
    category: DEFAULT_APP_CATEGORIES.opensearchDashboards,
});
/* end -- exactly the same as previous code */

// Register dashboards under the `dashboard and report` category under `Security analytics` use case.
coreSetup.chrome.navGroup.addNavLinksToGroup(DEFAULT_USE_CASES.securityAnalytics, [{
    id: DashboardConstants.DASHBOARDS_ID,
    order: 2500,
    category: DEFAULT_APP_CATEGORIES.dashboardAndReport
}]);

// Register dashboards under the `monitor` category under `observability` use case.
coreSetup.chrome.navGroup.addNavLinksToGroup(DEFAULT_USE_CASES.observability, [{
    id: DashboardConstants.DASHBOARDS_ID,
    order: 2500,
    category: DEFAULT_APP_CATEGORIES.monitor,
}]);
ruanyl commented 3 months ago

@SuZhou-Joe Could you attach a screenshot of the left navigation bar with use case(with workspace disabled)?

SuZhou-Joe commented 3 months ago

@ruanyl Sure, done for that.

ashwin-pc commented 3 months ago

I like the idea but we need to make sure that the API isn't a breaking change. Based on your proposal it looks like plugins that previously showed up on the left nav will no longer show there unless they call another API. That would be a breaking change. The previous registration should still work for a plugin if this needs to go into the 2.x line

SuZhou-Joe commented 3 months ago

Hi @ashwin-pc , actually there is no breaking change for current application.register interface, if an application is registered without being assigned to a group by calling addNavToGroup, it behaves exactly the same as what it does today, display in the first-level navigation(no matter group navigation is enabled or not), under the specific category defined in application.register. Only when an application is added to a group and the feature flag is turn on will it display in the second navigation.

BionIT commented 3 months ago

@SuZhou-Joe when will this interface be ready for plugins to use?

SuZhou-Joe commented 3 months ago

@SuZhou-Joe when will this interface be ready for plugins to use?

Hopefully the interface and the feature flag should be ready before 06.25, depends on the PR review process.

ashwin-pc commented 3 months ago

Hi @ashwin-pc , actually there is no breaking change for current application.register interface, if an application is registered without being assigned to a group by calling addNavToGroup, it behaves exactly the same as what it does today, display in the first-level navigation(no matter group navigation is enabled or not)

Ah, sorry didnt see that in the RFC. Thanks for the clarification. Are groups distinct in the UI from apps that arent registered as a part of a group? e.g. What happens if only some applications register as a part of the group and others do not? Visually can i tell apart a group from an app that didnt register itself as a part of the group?

SuZhou-Joe commented 3 months ago

When new navigation is enabled

Those applications do not register as a part of the group will display in the first navigation, just like what it does today. And those do will be collapsed to second navigation. So yes, visually you can easily tell who register as group verses those do not, those do sits in second navigation while those do not sits in first navigation.

kavilla commented 3 months ago

Just to be sure the route isn't changing correct? just purely a ui changed

SuZhou-Joe commented 3 months ago

No, the route won't change. Only UI change.

seraphjiang commented 3 months ago

@SuZhou-Joe what's the different between application_catatory and group from left nav view?

are they all supported top nav menu?

image

Looks like existing application category will expend the sub item under the catatory image

the new Group, will expends to side nav panel next to existing left nav. and in the new second left side nav plane, it can has application category experience like before? e.g. look at new Data administration it has Management, Indexes, Index backup recovery categories, each categories has more items

image

could we confirm if this is expected experience, or it is just current implementation?

if it is expected experience, it is weird to me keep application category co-existing with the new group content. if the goal is to keep left menu less item to avoid noisy.

SuZhou-Joe commented 3 months ago

Hi @seraphjiang , yes it is expected experience, groups is used in first level navigation, by clicking the group, we will have second navigation, which displays features under application category, just like what we have like before.

The main goal is to shrink related features into group so that the first level navigation won't be too noisy to the users(for the initial release, only home, 4 use cases, data administrations and settings setup), more content is shrink into the group detail - second level navigation.