-
Notifications
You must be signed in to change notification settings - Fork 27
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
AdHocFiltersCombobox: Collapse filter combobox #961
base: main
Are you sure you want to change the base?
Conversation
I think something like this is really needed |
@torkelo will clean up and finalise this over the next few days. This behaviour will be controlled via variable setting |
/** | ||
* Flag that will collapse combobox filters when they become too long | ||
*/ | ||
collapseFilters?: boolean; |
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.
The first thing that comes to my mind is: Shouldn't this be something to control from the component rather than the variable declaration?
This is pure UI behavior. It is weird to create a SceneObject variable to represent the AdHoc filter and indicate that it is collapsible. Have you considered any other approach that allows you to configure this in the variables control, for example?
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 decided to go with this implementation because it does not involve any major design changes and offers persistence between reloads. Other approaches would struggle with persistence especially when this is opt in behaviour.
Filters UI collapse functionality
Implementation in grafana/grafana grafana/grafana#98411
Screen.Recording.2024-11-08.at.11.24.49.mov
CONSIDERATIONS:
This is not entirely accurate when there are more variables on the same line (due to filter box growing) see in depth explanation -> AdHocFiltersCombobox: Collapse filters to save space #962
Perhaps worth adding extra setting
collapseThreshold
or havecollapseFilters
asboolean | number
to allow more fine grain control on what pixel width to start collapse due to above📦 Published PR as canary version:
5.36.1--canary.961.12544951331.0
✨ Test out this PR locally via: