-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[Dashboard] Fast Navigation Between Dashboards #157437
[Dashboard] Fast Navigation Between Dashboards #157437
Conversation
…dashboardNavigation
…dashboardNavigation
…dashboardNavigation
@elasticmachine merge upstream |
@elasticmachine merge upstream |
Pinging @elastic/kibana-presentation (Team:Presentation) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the enhancement!
untilDashboardReady().then(async (container) => { | ||
container.setScrollToPanelId(incomingEmbeddable.embeddableId); | ||
container.setHighlightPanelId(incomingEmbeddable.embeddableId); | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why was the scrolling behavior removed here for incoming embeddables? Maybe got lost in a merge conflict?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah true, good catch! While fixing this, I also noticed that the code didn't scroll to a newly added panel, only one that was edited, so I added some extra logic to make it scroll to newly added panels.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in 6120d3f
@elasticmachine merge upstream |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! I pulled it down and navigated between the sample dashboards in various different states, and things like view mode, filters, and unsaved changes are preserved between reloads.
The only thing I noticed was some of the panels flying around with the CSS transforms on while navigating between dashboards looked a little odd, but it's not a blocker.
May-23-2023.16-13-21.mp4
Besides that, the navigation between dashboard is so seamless with this change. Huge performance win and great prep for the navigation embeddable. Great work!
…homson/kibana into onWeek/dashboardNavigation
💚 Build Succeeded
Metrics [docs]Module Count
Public APIs missing comments
Async chunks
Page load bundle
Unknown metric groupsAPI count
ESLint disabled line counts
Total ESLint disabled count
History
To update your PR or re-run it, just comment with: |
Backporting this into 8.8 to support this fix also being backported. |
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
## Summary Makes all navigation from one Dashboard to another feel snappier. (cherry picked from commit 5342563)
# Backport This will backport the following commits from `main` to `8.8`: - [[Dashboard] Fast Navigation Between Dashboards (#157437)](#157437) <!--- Backport version: 8.9.7 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Devon Thomson","email":"[email protected]"},"sourceCommit":{"committedDate":"2023-05-25T18:40:48Z","message":"[Dashboard] Fast Navigation Between Dashboards (#157437)\n\n## Summary\r\nMakes all navigation from one Dashboard to another feel snappier.","sha":"5342563a22a54223180a727a542a7b6c99caea7f","branchLabelMapping":{"^v8.9.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:enhancement","Feature:Dashboard","Team:Presentation","loe:days","impact:medium","backport:skip","v8.8.0","v8.9.0"],"number":157437,"url":"https://github.com/elastic/kibana/pull/157437","mergeCommit":{"message":"[Dashboard] Fast Navigation Between Dashboards (#157437)\n\n## Summary\r\nMakes all navigation from one Dashboard to another feel snappier.","sha":"5342563a22a54223180a727a542a7b6c99caea7f"}},"sourceBranch":"main","suggestedTargetBranches":["8.8"],"targetPullRequestStates":[{"branch":"8.8","label":"v8.8.0","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v8.9.0","labelRegex":"^v8.9.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/157437","number":157437,"mergeCommit":{"message":"[Dashboard] Fast Navigation Between Dashboards (#157437)\n\n## Summary\r\nMakes all navigation from one Dashboard to another feel snappier.","sha":"5342563a22a54223180a727a542a7b6c99caea7f"}}]}] BACKPORT--> Co-authored-by: Kibana Machine <[email protected]> Co-authored-by: Patryk Kopyciński <[email protected]>
Summary
This PR makes all navigation from one Dashboard to another feel snappier. Instead of destroying the Dashboard container entirely and rebuilding it from scratch, this PR loads the new Dashboard saved object in the background, then reinitializes subscriptions and replaces the last Dashboard state with the new state.
This results in the following changes:
create
to/view/{id}
/view/{oldid}
to/view/{newid}
Navigation Embeddable
This will allow our new Navigation Embeddable to move between Dashboards in a more native tab-like way, because the Navigation Embeddable itself will not disappear as the navigation happens.
A complication with this is on navigation click, the page won't immediately go white, so we may need a loading state to provide feedback to the user when they click on a nav link while the new Dashboard loads in the background. Otherwise, the delay while loading the next Dashboard could make the Navigation Embeddable seem unresponsive. This loading state could show specifically inside the Navigation Embeddable to make it impossible for a user to immediately try to click another link.
Flaky Test runner
I ran a broad Flaky test runner to ensure that this PR didn't introduce any extra flakiness. Note that it ran into 2 failures out of 400 test runs, and that these two failures seem unrelated. I added a commit: 0276c77 that should resolve them by making the presence of the toast optional when adding panels from the library - as requiring toasts to be present can be quite flaky.
Checklist
Delete any items that are not applicable to this PR.