fix: replace expand/collapse all with a single toggle in folder view - #1805
fix: replace expand/collapse all with a single toggle in folder view#1805vesnadean wants to merge 1 commit into
Conversation
Match Alerting notification policies: one button flips between expand-all and collapse-all based on whether all folders are open. Co-authored-by: Cursor <cursoragent@cursor.com>
Script size changes
Totals
|
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Want higher recall? High effort reviews run extra passes and find more bugs. A team admin can switch effort levels in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit bfdaf6c. Configure here.
| } else { | ||
| setCollapsedFolders(new Set()); | ||
| } | ||
| }; |
There was a problem hiding this comment.
Toggle misses stale collapsed UIDs
Low Severity
allExpanded uses collapsedFolders.size === 0 instead of checking every current folder in allUids. External or orphaned folders can leave the tree when filters or checks change while their UIDs stay in collapsedFolders, so the toggle can show Expand all and hide Collapse all even when every visible folder is already open. The removed allCollapsed check used allUids.every(...), which avoided this.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit bfdaf6c. Configure here.


Problem
In the check list folder view, Expand all and Collapse all were separate buttons. That took extra space and did not match how Grafana Alerting handles the same action on Notification policies, where a single control toggles between the two states.
Solution
Folder view now uses one secondary button that switches between Expand all and Collapse all based on whether every folder is already expanded. The button label, icon, and aria-label update together so the control stays clear and accessible, aligned with the Alerting notification policies pattern.
Test plan
Made with Cursor