Persist collapsed state in GLQL blocks
What does this MR do and why?
Persist collapsed state in GLQL blocks
In !197824 (merged) we added support for a collapsed parameter to GLQL views, which if passed true would keep the view collapsed by default. However, due to a bug in crud component, this would always be disregarded because crud component would emit an expanded event on mount that would override the value read from config.
This MR fixes that bug. Now we dispatch expanded or collapsed events only if a value is present in local storage, whether true or false, but not if its not set.
Changelog: added
References
Follow up from Add a collapsed parameter to GLQL (!197824 - merged)
Screenshots or screen recordings
CleanShot 2025-07-17 at 16.32.35.mp4
How to set up and validate locally
-
Setup a GLQL component with
collapsed: truein it. Example:```glql query: type = Issue collapsed: true ``` -
Save the comment/issue and reload.
-
The view should be collapsed by default. (Reading the value from the GLQL config)
-
Expand the view by clicking the chevron on crud component.
-
Refresh the page.
-
The component should stay expanded. (Reading the value from local storage)
MR acceptance checklist
Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.