-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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
Bugfix dashboard unpins filters #62301
Conversation
b8f666e
to
15fe150
Compare
Pinging @elastic/kibana-app-arch (Team:AppArch) |
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.
I tested and couldn't find anything behaving strange (everything like in the description).
I just want to raise the point that this is not the behavior in Visualize - there pinned filters are just ignored when saving the visualization. In Discover it's currently unpinning the filter when saving a saved search and saving it along with the search (seems similar to the behavior of dashboard before this change).
This means this PR will change 2 different behaviors in different apps to 3 different behaviors in different apps - that doesn't seem right to me.
As pinned/non-pinned filters are already confusing enough I think we should at least make them behave consistent in all of the apps - then it doesn't matter to me too much what exactly the behavior is.
I think the following is the most sane (at least to me, but that might be highly subjective):
- Don't save pinned filters ever - when saving a saved object, only non-pinned filters are considered
- Don't unpin filters automatically in any case (that's definitely buggy behavior)
- When carrying a pinned filter over from another app/saved object and the current saved object has the same filter in a non-pinned status, display both of them separately (pinned and non-pinned side by side). Otherwise we might accidentally save a saved object without this filter because we magically transformed a non-pinned filter in a pinned filter
This follows just one simple rule: Never change the filter status automatically - if a filter changes from pinned to unpinned or vice versa, it was always because of an explicit user action.
Sorry for hijacking this PR, we can also move this discussion somewhere else. Also cc @timroes
yee.. have to admit I didn't look into discover and visualize and was focused on fixing a regression in dashboard (my bad) which seemed to be like a really unpleasant one.
I think behaviour in this pr is better, because we save state closer to what user sees on ui and likely what user expects to see when opening saved stuff again
Yes, that is terrible. Agree. This is fixed in this pr in dashboard. We can follow up on that in discover in separate pr for 7.7 fix?
Afaik how FilterManager works - this is not trivial and risky change. Not something I'd do without careful considerations. I think (subjectively) current behaviour in dashboard is pretty good one :) Happy with the result from user standpoint |
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.
I'm also happy with the behavior in this PR, @Dosant - you make a good point about saving what the user is currently seeing in terms of data. If it would work like this in Discover and Visualize as well, I think it would be totally fine.
With my "most sane" behavior I tried to rethink it from the beginning, but it's definitely not worth going through major changes just for the sake of it.
If we are following up with a discover fix introducing the same change there, it's definitely a LGTM from me (AFAIK Visualize was always an outlier in this regard).
Still interested in @timroes opinion on this :)
Thanks for pinning me. Yeah due to some regressions in the past this behavior has driftet apart in different applications. The "correct" (in the sense of how we defined it do behave) behavior is, that pinned filters should always be ignored when saving. They are just your temporary state while navigating and should not be stored in any saved object. I know that this is currently buggy in a couple of applications. @cchaos is also working on designs to separate pinned filters and unpinned filters properly, and in general have a better way around showing what's part of the saved object and what not. But until we have that, pinned filters should basically just not be saved. |
@timroes, I'll adjust then this pr to not save pinned filter together with saved object. |
@elasticmachine merge upstream |
…-upins-filters # Conflicts: # src/plugins/dashboard/public/application/lib/filter_utils.ts # src/plugins/dashboard/public/application/lib/update_saved_dashboard.ts
@timroes, @flash1293, @lizozom please re-review. Change the behaviour to NOT save pinned filters at all (#62301 (comment)). Other 2 bugs stayed fixed |
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.
Tested and everything seems fine, LGTM.
The current behavior is not 100% what I had in mind before reviewing this PR (so thanks for making me aware of the nuances), but it's consistent and easy to learn.
I think the only problem to have this consistent now is the Discover behavior (unpinning filters when saving and when there is a pinned and unpinned version of the same filter) - I'm going to create a separate PR for that.
@elasticmachine merge upstream |
@elasticmachine merge upstream |
@elasticmachine merge upstream |
Waiting for @lizozom approve. fyi @flash1293, we changed implementation by moving it from dashboard code to filter manager: 94e360e |
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.
LGTM
@elasticmachine merge upstream |
…a into dev/dashboard-upins-filters
💚 Build SucceededHistory
To update your PR or re-run it, just comment with: |
Fixes following cases: Saving dashboard with pinned filter unpins it. Do not save pinned filters with dashboard see elastic#62301 (comment) When navigating with global filter to dashboard with same saved filter, filter becomes unpinned When navigating from listing to dashboard with saved filter, back button didn't work Co-authored-by: Elastic Machine <[email protected]>
Fixes following cases: Saving dashboard with pinned filter unpins it. Do not save pinned filters with dashboard see elastic#62301 (comment) When navigating with global filter to dashboard with same saved filter, filter becomes unpinned When navigating from listing to dashboard with saved filter, back button didn't work Co-authored-by: Elastic Machine <[email protected]>
Fixes following cases: Saving dashboard with pinned filter unpins it. Do not save pinned filters with dashboard see #62301 (comment) When navigating with global filter to dashboard with same saved filter, filter becomes unpinned When navigating from listing to dashboard with saved filter, back button didn't work Co-authored-by: Elastic Machine <[email protected]> Co-authored-by: Elastic Machine <[email protected]>
Fixes following cases: Saving dashboard with pinned filter unpins it. Do not save pinned filters with dashboard see #62301 (comment) When navigating with global filter to dashboard with same saved filter, filter becomes unpinned When navigating from listing to dashboard with saved filter, back button didn't work Co-authored-by: Elastic Machine <[email protected]> Co-authored-by: Elastic Machine <[email protected]>
Summary
Fixes #62126
Fixes following cases:
Saving dashboard with pinned filter unpins itDo not save pinned filters with dashboard see Bugfix dashboard unpins filters #62301 (comment)Checklist
Delete any items that are not applicable to this PR.
For maintainers