Skip to content

Conversation

@mbondyra
Copy link
Contributor

Summary

Implements the ability to react to CPS changes and store and restore project routing settings in Discover sessions.

Main Features Added:

  1. Save Modal Enhancement (save_modal.tsx:90-124)
    - Added a new toggle switch in the save dialog to "Store project routing with Discover session"
    - Similar to the existing "Store time with Discover session" option
    - Only shown when project routing is available (hasProjectRouting)
  2. CPS Integration (discover_app_state_container.ts:328-378)
    - Added dependency on the cps (Cross-Project Search) plugin
    - Syncs project routing between internal state and CPS manager
    - Subscribes to project routing changes from CPS manager and triggers data fetches
  3. Search Source Updates (update_search_source.ts:56-59)
    - Passes projectRouting parameter to search source when executing searches
    - Ensures project routing is applied to query execution
  4. State Management (discover_state.ts:473-484, tabs.ts:289-303)
    - Monitors globalState.projectRouting changes and triggers data fetches
    - Updates services when switching tabs or when global state changes
    - Keeps project routing in sync across tabs
  5. Persistence Logic (save_discover_session.ts:73-120)
    - Modified save/restore to conditionally persist projectRouting based on projectRoutingRestore flag
    - Falls back to current tab's project routing when copying sessions
    - Added debug logging for troubleshooting

Key Design Decision:

Project routing is NOT synced to URL (unlike time range and filters), only stored in saved objects
(discover_app_state_container.ts:220). This keeps URLs cleaner while still allowing the feature to be persisted in
saved sessions.

@elasticmachine
Copy link
Contributor

🤖 Jobs for this PR can be triggered through checkboxes. 🚧

ℹ️ To trigger the CI, please tick the checkbox below 👇

  • Click to trigger kibana-pull-request for this PR!
  • Click to trigger kibana-deploy-project-from-pr for this PR!
  • Click to trigger kibana-deploy-cloud-from-pr for this PR!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants