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

Add side navigation component for serverless search #156465

Merged
merged 18 commits into from
May 5, 2023

Conversation

tsullivan
Copy link
Member

@tsullivan tsullivan commented May 3, 2023

Summary

This PR implements a side navigation tree for Serverless Enterprise Search in a way that uses the earliest deliverables from the AppEx Shared UX team.

Technical doc for Side Nav: https://docs.google.com/document/d/1ew8KYl6ROs_V7jeIXgeP_C9YgkYK2IPtuceo6KVF_jE/edit#

Screenshots

Before
Screenshot 2023-05-02 at 10 32 49 PM

After
Screenshot 2023-05-02 at 10 33 04 PM

Known issues

  1. Page scroll is not working when Chrome renders in serverless project mode. This issue exists prior to this PR
  2. Highlighting the active link in the nav, and rendering the correct breadcrumb trail, is planned for a future PR

Checklist

Delete any items that are not applicable to this PR.

@tsullivan tsullivan force-pushed the serverless/nav-component/search branch from e62acc5 to d7da5f0 Compare May 3, 2023 05:29
@tsullivan tsullivan force-pushed the serverless/nav-component/search branch from d7da5f0 to 0493ffb Compare May 3, 2023 05:32
name: '',
id: 'root',
items: [
{ id: 'overview', name: 'Overview', href: '/app/enterprise_search/overview' },
Copy link
Member Author

@tsullivan tsullivan May 3, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NOTE: These links were copied from the serverless Search nav from an earlier POC: 89bd09c#diff-a3106909413d188596dc1162e4fc5d4f884f4fd9b3a4eca6c03666bb5d35dbb9R24-R45

@tsullivan tsullivan requested review from sebelga and Dosant May 3, 2023 05:34
@tsullivan tsullivan added release_note:skip Skip the PR/issue when compiling release notes Team:SharedUX Team label for AppEx-SharedUX (formerly Global Experience) Project:Serverless Work as part of the Serverless project for its initial release labels May 3, 2023
icon: 'logoEnterpriseSearch',
},
]}
activeNavItemId="search_project_nav.root.overview"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Question: is this hardcoded string needed for now? Shouldn't we leave it empty until we receive this state from the Chrome service?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I left code in to set the activeNavItemId to search_project_nav.root. This allows the main "Search" bucket to be pre-expanded when the page is first loaded. Also, I added a comment stating how it's a temporary set-up.

},
]}
activeNavItemId="search_project_nav.root.overview"
platformConfig={{}}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: Shouldn't we set platformConfig as optional if it requires an empty object?

@tsullivan tsullivan requested a review from clintandrewhall May 3, 2023 17:54
@elasticmachine
Copy link
Contributor

Pinging @elastic/appex-sharedux (Team:SharedUX)

@tsullivan tsullivan requested a review from a team as a code owner May 3, 2023 19:48
@kibana-ci
Copy link
Collaborator

💛 Build succeeded, but was flaky

Failed CI Steps

Test Failures

  • [job] [logs] FTR Configs #34 / expressions explorer emits an action and navigates

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
serverlessSearch 4 28 +24

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
serverlessSearch 1.5KB 19.9KB +18.4KB
Unknown metric groups

ESLint disabled line counts

id before after diff
enterpriseSearch 19 21 +2
securitySolution 398 401 +3
total +5

Total ESLint disabled count

id before after diff
enterpriseSearch 20 22 +2
securitySolution 478 481 +3
total +5

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

Copy link
Contributor

@sebelga sebelga left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code looks good (with some comments about i18n).

Tested locally and found a few UI glitches

  • When switching page the loading and icon are not in the same place and occupying the same space. This makes our Elastic logo jump around 😊 It'd be nice to set a fix width on the logo and lock its space. The loading should just swap in the same area and the logo should not move.

loading-glitch

  • When navigating to some management > stack some links didn't point to the app and stayed on the welcome page. For example ILM (but there are more)

Screenshot 2023-05-05 at 09 23 02

  • It seems that there is some issue with the page background color and the app background color. The following don't seem correct

Screenshot 2023-05-05 at 09 21 48

Screenshot 2023-05-05 at 09 22 14

title: '',
id: 'root',
items: [
{ id: 'overview', title: 'Overview', href: '/app/enterprise_search/overview' },
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we want to translate those title

{
id: 'search_project_nav',
items: navItems,
title: 'Search',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here too title should be translated

},
];

export const createServerlessSearchSideNavComponent = (core: CoreStart) => () => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are inside the serverless_search plugin. I think we can simply call this createSideNavComponent

Copy link
Contributor

@Dosant Dosant left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm,

in my opinion, the polishment from Seb's comment #156465 (review) could be done separately later and some of them are not for @elastic/appex-sharedux

_startDeps: ServerlessSearchPluginStartDependencies
): ServerlessSearchPluginStart {
core.chrome.project.setSideNavComponent(createComponent(core));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if we should still set it through the serverless plugin as it was in the POC. not sure if there is a benefit to it

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See: #156600 (comment)

I think we should bring it back

@sebelga
Copy link
Contributor

sebelga commented May 5, 2023

in my opinion, the polishment from Seb's comment

@Dosant Links that don't work are not polishment IMO 😊 Is it due to our shared component, our navigation system? If we know the bug at least we should open an issue to fix it.

@sphilipse
Copy link
Member

sphilipse commented May 5, 2023

in my opinion, the polishment from Seb's comment

@Dosant Links that don't work are not polishment IMO 😊 Is it due to our shared component, our navigation system? If we know the bug at least we should open an issue to fix it.

We (as in: the Enterprise Search frontend team) will be reworking and iterating on all of these link over the coming weeks. Putting significant effort into getting them working in this PR is likely to be wasted effort. In fact, keeping this PR from merging over those links will actually end up slowing down the effort to get them fixed, as we can't really get to them before this is merged :)

@tsullivan
Copy link
Member Author

Tested locally and found a few UI glitches

I will open separate issues for the UI glitches and non-working Platform links. Thanks for bringing those up!

@tsullivan tsullivan merged commit 93d941b into elastic:main May 5, 2023
@tsullivan tsullivan deleted the serverless/nav-component/search branch May 5, 2023 16:13
@kibanamachine kibanamachine added v8.9.0 backport:skip This commit does not require backporting labels May 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:skip This commit does not require backporting Project:Serverless Work as part of the Serverless project for its initial release release_note:skip Skip the PR/issue when compiling release notes Team:SharedUX Team label for AppEx-SharedUX (formerly Global Experience) v8.9.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants