kibana/examples/unified_tabs_examples
Julia Rechkunova c348586e58
[Discover] Persist tabs in local storage and sync selected tab ID with URL (#217706)
- Closes https://github.com/elastic/kibana/issues/216549
- Closes https://github.com/elastic/kibana/issues/216071

## Summary

This PR allows to restore the following state for the previously opened
tabs:
- the selected data view
- classic or ES|QL mode
- query and filters
- time range and refresh interval
- and other properties of the app state
bcba741abc/src/platform/plugins/shared/discover/public/application/main/state_management/discover_app_state_container.ts (L92)

## Changes
- [x] Sync selected tab id to URL => after refresh the initial tab would
be the last selected one
- [x] Restore tabs after refresh 
- [x] Restore appState and globalState after reopening closed tabs
- [x] Clear tabs if Discover was opened from another Kibana app  
- [x] Store tabs in LocalStorage
- [x] Fix "New" action and clear all tabs
- [x] Populate "Recently closed tabs" with data from LocalStorage
- [x] If selected tab id changes in URL externally => update the state  
- [x] Reset the stored state when userId or space Id changes
- [x] Fix all tests

### Testing
- Test that the existing functionality is not affected
- Enable tabs feature in
bcba741abc/src/platform/plugins/shared/discover/public/constants.ts (L15)
and test that tabs are being persisted and can be restored manually too.


### Checklist

- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [x] The PR description includes the appropriate Release Notes section,
and the correct `release_note:*` label is applied per the
[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)

---------

Co-authored-by: Davis McPhee <davismcphee@hotmail.com>
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
2025-05-27 23:32:56 +03:00
..
common [Discover][Tabs] New tabs package and initial implementation of components (#210674) 2025-02-21 14:00:40 +01:00
public [Discover] Persist tabs in local storage and sync selected tab ID with URL (#217706) 2025-05-27 23:32:56 +03:00
kibana.jsonc [Discover][Tabs] New tabs package and initial implementation of components (#210674) 2025-02-21 14:00:40 +01:00
README.md [Discover][Tabs] New tabs package and initial implementation of components (#210674) 2025-02-21 14:00:40 +01:00
tsconfig.json [Discover][Tabs] New tabs package and initial implementation of components (#210674) 2025-02-21 14:00:40 +01:00

unified_tabs_examples

Examples of unified tabs components.

To run this example, ensure you have data to search against (for example, the sample datasets) and start kibana with the --run-examples flag.

yarn start --run-examples