-
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
[Discover] Persist hide chart option to local storage #114534
[Discover] Persist hide chart option to local storage #114534
Conversation
b552682
to
07f20ef
Compare
@elasticmachine merge upstream |
@elasticmachine merge upstream |
Pinging @elastic/kibana-data-discovery (Team:DataDiscovery) |
With this change the localStorage setting will get priority over the one saved in saved searches, when the chart is hidden. I would vote for having the state saved in the saved object always getting priority over your local state when loading a saved search. Example: Save a saved search with a shown chart, toggle to a different index pattern, hide the chart now, load the previously saved search: The saved search appears, but the chart is hidden (despite the saved object had a My preferred behavior would be: whenever a saved object is loaded we use that setting. Whenever a user manually toggle a chart, store that new one in the local storage, use the local storage setting anytime when creating a "new" saved search or switching between index patterns, but not when loading a previously saved search. @kertal @dmitriynj what are your thoughts around that? |
yes, saved search setting should get priority over local state 👍. local storage persistence should be used for human interaction, and users will be pleased, I'm sure |
lmk if this is more inline with what you described |
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.
Code LGTM, works as expected, tested a-la-carte with Safari, Chrome, Firefox. It's nice useful add-on , a little detail that improves UX in Discover 👍
}); | ||
|
||
after(async () => { | ||
await kibanaServer.uiSettings.unset('timepicker:timeDefaults'); |
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.
'timepicker:timeDefaults' do we need to reset this? since it has not been set?
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.
Good point, I thought this was unsetting the default time in Discover 🤦♀️
Additional note: think adding a bit more description to the PR , how it behaves when saved searches are load would be useful |
@elasticmachine merge upstream |
💚 Build SucceededMetrics [docs]Async chunks
History
To update your PR or re-run it, just comment with: |
* Persist hide chart to local storage * [Discover] Persist hide chart option to local storage * Fix state * Fix dependency check * Set chart state to undefined * Update unit test * Do not override saved search preferences * Fix missing import * Add a functional test * Add a functional test * Fix functional test Co-authored-by: Kibana Machine <[email protected]>
) * Persist hide chart to local storage * [Discover] Persist hide chart option to local storage * Fix state * Fix dependency check * Set chart state to undefined * Update unit test * Do not override saved search preferences * Fix missing import * Add a functional test * Add a functional test * Fix functional test Co-authored-by: Kibana Machine <[email protected]> Co-authored-by: Kibana Machine <[email protected]>
Summary
Release Notes: Remember most recent "hide chart" setting
Fixes: #112466
This PR stores the save/hide chart option to local storage.
Whenever a saved object is loaded, that setting takes precedence over whatever is in a local storage. When a user manually toggles a chart, that preference is stored in the local storage. It will be used from that point on any time when creating a "new" saved search or switching between index patterns.
Checklist
Delete any items that are not applicable to this PR.
- [ ] Any text added follows EUI's writing guidelines, uses sentence case text and includes i18n support- [ ] Any UI touched in this PR is usable by keyboard only (learn more about keyboard accessibility)- [ ] Any UI touched in this PR does not create any new axe failures (run axe in browser: FF, Chrome)- [ ] If a plugin configuration key changed, check if it needs to be allowlisted in the cloud and added to the docker list- [ ] This renders correctly on smaller devices using a responsive layout. (You can test this in your browser)Risk Matrix
Delete this section if it is not applicable to this PR.
Before closing this PR, invite QA, stakeholders, and other developers to identify risks that should be tested prior to the change/feature release.
When forming the risk matrix, consider some of the following examples and how they may potentially impact the change:
For maintainers