You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[EuiDataGrid] Reset internal state of row height / density popover when props change #5593
We recently implemented custom row height selection in Discover 🥳 (PR #122087) . There's an issue we've encountered. When users select a new row height, this is propagated to the URL, and EuiDataGrid retrieves this new setting. So it's the new default. But the way it currently works is that once users change the row height, the "Reset to default" link is displayed, and clicking on it makes it disappear.
reset-to-default.mp4
What's more, if the user changes the setting in URL, it's ignored (given the value was changed in the popover before), so the external change doesn't change the grid's internal one.
But the way it currently works is that once users change the row height, the "Reset to default" link is displayed, and clicking on it makes it disappear.
Is this just an undesired behavior on your end? Our localStorage example does the same thing, and I guess I didn't really see that as a problem - the reset button allows users to set the grid back to the way it was when the page loaded, which seems like a valid use of the button. The user can just ignore it if they're fine with the changes, and the next time they visit the page their settings will be saved.
CCing @cchaos as she originally requested the button - should we consider passing in an option that allows applications to disable the Reset button on the display selector?
What's more, if the user changes the setting in URL, it's ignored
This confuses me a bit - if a user changes the setting in the URL, they're essentially reloading the page and causing a full data grid remount, correct? At which point there should no longer be internal user settings, and the settings loaded in from the consuming application should be the default. How are those changes being ignored then?
(Linking these two recent issues for historical context as they're somewhat related and have a caveat section on how user changes should override application changes - #5526 and #5524)
I also am confused by the settings in the url implementation in Discover. Wouldn't this make the browser history way too complex in terms of the user's understanding of how the back button works? It honestly doesn't seem like the right location to be storing these settings. They're not creating new pages but just altering the display.
This confuses me a bit - if a user changes the setting in the URL, they're essentially reloading the page and causing a full data grid remount, correct?
No there's a listener for URL changes modifying the state in Discover
I also am confused by the settings in the url implementation in Discover. Wouldn't this make the browser history way too complex in terms of the user's understanding of how the back button works? It honestly doesn't seem like the right location to be storing these settings. They're not creating new pages but just altering the display.
This is how it's historically done in Discover, most of the state is in URL. I can see your point about the browser history ... also reproduced it ... when switching the Lines per row slider, plenty of history entries are created ... think no history should be added in this case, the current history entry should be replaced
BTW, not only allows data grid to reveal unknown details of your content, it also helps to hide unwanted details, so you can focus of things that really matter:
Hey Matthias! Sorry, I didn't mean to let this drop to the floor or get distracted by your hilarious cat. I see now that you're storing display selector state in a URL param which wouldn't trigger a page rerender. I'm still a little confused as to why the Reset to default button is problematic in terms of UI. I still think it's valid for a user to reset to whatever settings they had on page load. If you simply don't want users to be able to reset, would a config option to disable the reset button suffice?
hi, sorry too, for using my distracting cat 😄 . So it's not problematic, it's just redundant. Users can't reset to the state on page load, because every change is propagated to external state and becomes the default state. But the popover doesn't know and therefore offers to reset to default state ... I'd suggest to have a quick zoom when it's convenient for you, if you want
The difference between the example & discover's implementation is discover uses gridStyle.onChange to merge the user's changes into their grid style object. To emulate this thought with the example, select 'normal' density through the grid control and then update the gridStyle options with medium padding & font size; now open the grid's control again, the ask here is that the Reset button would be gone because resetting would not effect any difference.
My 2 cents: the reset button's existence is based on if the user interacts with the grid control to change from the default, we may be able to make this respect changes to gridStyles as well.
My 2 cents with a Front End Engineer hat: the application should add a layer of state to hold the initial page load data (which would update if the user refreshes the page or otherwise loads from the stateful URL) separate from updated-but-not-committed state
My 2 cents with an Information Architecture or Product hat: the core issue is treating both ephemeral & permanent state the same. Even if we implement Front End Engineer's above suggestion, the user journey doesn't feel right because upon re-loading the page with the updated styles in the URL that becomes the new default, instead of continuing to allow the app to set defaults + user overrides, providing a predictive flow allowing users to always reset any changes.
My 2 cents with a Kibana Engineer hat: I sure do wish we had a mechanism to save per-user settings 😁
Hey @kertal. We've been grooming our enormous backlog over the past couple of months, trying to sort it into a prioritized list. We've identified this as a "Low" priority, "Medium" effort task, which means, this is very unlikely to be prioritized by our team to address. We simply don't have the time or resources.
👋 Hi there - this issue hasn't had any activity in 6 months. If the EUI team has not explicitly expressed that this is something on our roadmap, it's unlikely that we'll pick this issue up. We would sincerely appreciate a PR/community contribution if this is something that matters to you! If not, and there is no further activity on this issue for another 6 months (i.e. it's stale for over a year), the issue will be auto-closed.
Activity
cee-chen commentedon Feb 3, 2022
Is this just an undesired behavior on your end? Our localStorage example does the same thing, and I guess I didn't really see that as a problem - the reset button allows users to set the grid back to the way it was when the page loaded, which seems like a valid use of the button. The user can just ignore it if they're fine with the changes, and the next time they visit the page their settings will be saved.
CCing @cchaos as she originally requested the button - should we consider passing in an option that allows applications to disable the
Resetbutton on the display selector?This confuses me a bit - if a user changes the setting in the URL, they're essentially reloading the page and causing a full data grid remount, correct? At which point there should no longer be internal user settings, and the settings loaded in from the consuming application should be the default. How are those changes being ignored then?
(Linking these two recent issues for historical context as they're somewhat related and have a caveat section on how user changes should override application changes - #5526 and #5524)
cchaos commentedon Feb 3, 2022
I also am confused by the
settings in the urlimplementation in Discover. Wouldn't this make the browser history way too complex in terms of the user's understanding of how the back button works? It honestly doesn't seem like the right location to be storing these settings. They're not creating new pages but just altering the display.kertal commentedon Feb 4, 2022
I'll follow up here, after my vacation ... just wanted to express the joy, that with "Auto fit" we now can reveal unknown details of our content
Auto-fit-cat.mp4
cee-chen commentedon Feb 4, 2022
I won't lie, the timing on that auto fit reveal absolutely slayed me
cchaos commentedon Feb 7, 2022
We absolutely need this as a demo! 😹
kertal commentedon Mar 4, 2022
Will ask the cat for permission (which reminds me, I think I didn't ask, but bribed with some good bites) 😸
kertal commentedon Mar 4, 2022
Anyway, let me show what I mean.


Changing to 7
So the internal state of the popover should the changed when external props overwrite it's settings
kertal commentedon Mar 4, 2022
No there's a listener for URL changes modifying the state in Discover
kertal commentedon Mar 4, 2022
This is how it's historically done in Discover, most of the state is in URL. I can see your point about the browser history ... also reproduced it ... when switching the Lines per row slider, plenty of history entries are created ... think no history should be added in this case, the current history entry should be replaced
kertal commentedon Mar 4, 2022
BTW, not only allows data grid to reveal unknown details of your content, it also helps to hide unwanted details, so you can focus of things that really matter:
karli-grumpy.mp4
cee-chen commentedon Mar 14, 2022
Hey Matthias! Sorry, I didn't mean to let this drop to the floor or get distracted by your hilarious cat. I see now that you're storing display selector state in a URL param which wouldn't trigger a page rerender. I'm still a little confused as to why the
Reset to defaultbutton is problematic in terms of UI. I still think it's valid for a user to reset to whatever settings they had on page load. If you simply don't want users to be able to reset, would a config option to disable the reset button suffice?kertal commentedon Mar 15, 2022
hi, sorry too, for using my distracting cat 😄 . So it's not problematic, it's just redundant. Users can't reset to the state on page load, because every change is propagated to external state and becomes the default state. But the popover doesn't know and therefore offers to reset to default state ... I'd suggest to have a quick zoom when it's convenient for you, if you want
chandlerprall commentedon Mar 15, 2022
I think we can discuss the discover setup with the first Data grid styling and control example as a proxy.
datagrid-gridstyle-reset.mov
The difference between the example & discover's implementation is discover uses
gridStyle.onChangeto merge the user's changes into their grid style object. To emulate this thought with the example, select 'normal' density through the grid control and then update the gridStyle options with medium padding & font size; now open the grid's control again, the ask here is that the Reset button would be gone because resetting would not effect any difference.My 2 cents: the reset button's existence is based on if the user interacts with the grid control to change from the default, we may be able to make this respect changes to gridStyles as well.
My 2 cents with a Front End Engineer hat: the application should add a layer of state to hold the initial page load data (which would update if the user refreshes the page or otherwise loads from the stateful URL) separate from updated-but-not-committed state
My 2 cents with an Information Architecture or Product hat: the core issue is treating both ephemeral & permanent state the same. Even if we implement Front End Engineer's above suggestion, the user journey doesn't feel right because upon re-loading the page with the updated styles in the URL that becomes the new default, instead of continuing to allow the app to set defaults + user overrides, providing a predictive flow allowing users to always reset any changes.
My 2 cents with a Kibana Engineer hat: I sure do wish we had a mechanism to save per-user settings 😁
14 remaining items
kertal commentedon Feb 8, 2023
I tested it, and I still thing this is worth an improvement
JasonStoltz commentedon Feb 8, 2023
Hey @kertal. We've been grooming our enormous backlog over the past couple of months, trying to sort it into a prioritized list. We've identified this as a "Low" priority, "Medium" effort task, which means, this is very unlikely to be prioritized by our team to address. We simply don't have the time or resources.
For reference: https://github.com/orgs/elastic/projects/1079
If you feel this warrants more than a "Low" priority, please let us know. We're also happy to accept pull requests!
kertal commentedon Feb 8, 2023
thx @JasonStoltz I do agree it's a low priority task, sadly it's unlikely that there will be a pull request, for the same reason: time / resources
github-actions commentedon Oct 22, 2023
👋 Hi there - this issue hasn't had any activity in 6 months. If the EUI team has not explicitly expressed that this is something on our roadmap, it's unlikely that we'll pick this issue up. We would sincerely appreciate a PR/community contribution if this is something that matters to you! If not, and there is no further activity on this issue for another 6 months (i.e. it's stale for over a year), the issue will be auto-closed.
cee-chen commentedon Oct 23, 2023
@kertal can we close this issue out now that your team has added a
allowResetButtonconfiguration that allows hiding the reset button completely?kertal commentedon Oct 23, 2023
yes we can! 👍