[Discover session] State management #210160
Labels
Feature:Discover
Discover Application
Project:OneDiscover
Enrich Discover with contextual awareness
Team:DataDiscovery
Discover, search (e.g. data plugin and KQL), data views, saved searches. For ES|QL, use Team:ES|QL.
technical debt
Improvement of the software architecture and operational architecture
📓 Summary
It's been a while since we've took care of Discover state management. And it's about time to simplify it.
The last fundamental change was done in #153528, completing a series of PRs to extract state relevant functionality that was distributed among the UI into a central state container with several subcontainers.
To summarize how it looks like today:
The multiple sources of truth in Discover's state container are the source for confusion and frustration when dealing and expanding Discover's central state. We now have new requirements, we need a simple way to serialize and deserialize state in Discover.
Instead of several sources of truth, currently we have the following state containers under one umbrella
kibana/src/platform/plugins/shared/discover/public/application/main/state_management/discover_global_state_container.ts
Line 20 in bb877cf
kibana/src/platform/plugins/shared/discover/public/application/main/state_management/discover_app_state_container.ts
Line 47 in bb877cf
kibana/src/platform/plugins/shared/discover/public/application/main/state_management/discover_data_state_container.ts
Line 77 in df495ce
kibana/src/platform/plugins/shared/discover/public/application/main/state_management/discover_internal_state_container.ts
Line 83 in bf9d344
kibana/src/platform/plugins/shared/discover/public/application/main/state_management/discover_saved_search_container.ts
Line 63 in bf9d344
What's more, our UI additional subscribes to various state among the
data
plugin, liketimefilter.getTimeUpdate$
kibana/src/platform/packages/shared/kbn-unified-field-list/src/hooks/use_query_subscriber.ts
Line 84 in bb877cf
data.query.getState()
kibana/src/platform/plugins/shared/discover/public/application/main/components/layout/discover_layout.tsx
Line 82 in fce8a27
And there might be more, our poor UI has to listen to lots of different state, even duplicate ones. time to clean this up
✔️ Acceptance criteria
Though shall not have many different State management container, there shall be one state container to rule em all. The next state container should be
The text was updated successfully, but these errors were encountered: