elastic / kibana

Your window into the Elastic Stack
https://www.elastic.co/products/kibana
Other
19.51k stars 8.06k forks source link

[Discover] Evaluate disabling syncing appState to URL #177910

Open kertal opened 4 months ago

kertal commented 4 months ago

Discover's state is getting more an more complex, syncing the appState to URL can be a huge headache when developing new features, and it's a cause for redundant re-renderings, so it can also impact performance. Furthermore, in edge case scenarios it's possible to run into "The URL for this object is too long, and we can't display it" errors. https://github.com/elastic/kibana/issues/177528

We should therefore evaluate to disable syncing appState changes to URL, aligning the behavior to Dashboard/Lens. Dashboards just takes the URL for initial syncing but every subsequent change isn't synced back, and the AppState part of the URL is removed on initial sync:

To consider:

So the upside of this change is

The downsides

Since our Share functionality covers the generation of links, it's no regression, however, currently it takes 2 clicks to get to the link. Having a 1 click functionality would prevent this "More clicks" UX regression, one way to do this would e.g. providing a button in the breadcrumb, something @ryankeairns recently suggested:

Discover__New_search_-_Elastic

Or a dedicated icon for this added to our top nav links?

bildschirmfoto_2024-03-08_um_18 36 20

Here's some code how Dashboards is handling it:

https://github.com/elastic/kibana/blob/26389e50140be0188bee7e4fc0307c7c2688122e/src/plugins/dashboard/public/dashboard_app/url/sync_dashboard_url_state.ts#L65

https://github.com/elastic/kibana/blob/6150f76abae664856a976bc230b9e90dbd844621/src/plugins/dashboard/public/dashboard_app/dashboard_app.tsx#L182-L192

elasticmachine commented 4 months ago

Pinging @elastic/kibana-data-discovery (Team:DataDiscovery)