Skip to content

fix: expand/collapse all groups now works with nested groups#6792

Merged
CommanderStorm merged 4 commits intolouislam:masterfrom
kurama:fix/expand-collapse-nested-groups
Jan 23, 2026
Merged

fix: expand/collapse all groups now works with nested groups#6792
CommanderStorm merged 4 commits intolouislam:masterfrom
kurama:fix/expand-collapse-nested-groups

Conversation

@kurama
Copy link
Copy Markdown
Contributor

@kurama kurama commented Jan 22, 2026

Summary

In this pull request, the following changes are made:

  • The expand/collapse all groups button now properly handle nested group hierarchies at any depth level, instead of only working with root-level groups
  • When collapsing all groups while viewing a nested group, the user is automatically navigated to the root parent group for a better UX
  • The groupMonitors computed property was updated to include all groups with children, regardless of their nesting level, by removing the parent === null filter
  • Added navigation logic that traverses up the group hierarchy to find the root parent and redirecfts the user there when collapsing from a nested view

I tested this by reproducing the scenario shown in the video from the issue, and the expand/collapse functionality now works correctly with nested groups at all levels.

Please test on your side and tell me if and don't hesitate to tell me if I've forgotten anything.

Please follow this checklist to avoid unnecessary back and forth (click to expand)
  • ⚠️ If there are Breaking change (a fix or feature that alters existing functionality in a way that could cause issues) I have called them out
  • 🧠 I have disclosed any use of LLMs/AI in this contribution and reviewed all generated content.
    I understand that I am responsible for and able to explain every line of code I submit.
  • 🔍 Any UI changes adhere to visual style of this project.
  • 🛠️ I have self-reviewed and self-tested my code to ensure it works as expected.
  • 📝 I have commented my code, especially in hard-to-understand areas (e.g., using JSDoc for methods).
  • 🤖 I added or updated automated tests where appropriate.
  • 📄 Documentation updates are included (if applicable).
  • 🧰 Dependency updates are listed and explained.
  • ⚠️ CI passes and is green.

Screenshots for Visual Changes

  • UI Modifications: Highlight any changes made to the user interface.
  • Before & After: Include screenshots or comparisons (if applicable).
Event Before After
UP Before After
DOWN Before After
Certificate-expiry Before After
Testing Before After

Copilot AI review requested due to automatic review settings January 22, 2026 18:09
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes the expand/collapse all groups functionality to work correctly with nested group hierarchies at any depth level. Previously, the feature only worked with root-level groups.

Changes:

  • Updated groupMonitors computed property to include all groups with children at any nesting level by removing the parent === null filter
  • Added automatic navigation to root parent group when collapsing all groups while viewing a nested group
  • Enhanced UX by preventing users from being stuck in collapsed nested groups

@kurama
Copy link
Copy Markdown
Contributor Author

kurama commented Jan 22, 2026

Added infinite loop protection with MAX_TRAVERSEL_STEP = 1000 as GitHub Copilot mentionned. Not sure what a realistic maximum nesting depth would be ?

Copy link
Copy Markdown
Collaborator

@CommanderStorm CommanderStorm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

Could you revert the copilot suggestion? I think we need to fix this in the validation step instead.

Comment on lines +371 to +388
const visited = new Set();
let rootParentId = currentMonitor.parent;
let rootParent = this.$root.monitorList[rootParentId];
const MAX_TRAVERSAL_STEPS = 1000;
let safetyCounter = 0;

while (
rootParent &&
rootParent.parent !== null &&
!visited.has(rootParentId) &&
safetyCounter < MAX_TRAVERSAL_STEPS
) {
visited.add(rootParentId);
rootParentId = rootParent.parent;
rootParent = this.$root.monitorList[rootParentId];
safetyCounter++;
}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If circular groups are possible (have not checked, they might), this is a bug.

Let's not add handling for potential bugs in the frontend and simplify this to your OG version of this.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@CommanderStorm CommanderStorm merged commit 7855a59 into louislam:master Jan 23, 2026
24 checks passed
@CommanderStorm
Copy link
Copy Markdown
Collaborator

thanks ❤️

@CommanderStorm CommanderStorm added this to the 2.1.0 milestone Jan 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Expand All Groups doesn't expand all groups

3 participants