Skip to content

Fix: Sidebar group should toggle open/close on click (#5263)#5267

Merged
SteKoe merged 3 commits intocodecentric:masterfrom
Harshit-0413:fix-5147
Apr 20, 2026
Merged

Fix: Sidebar group should toggle open/close on click (#5263)#5267
SteKoe merged 3 commits intocodecentric:masterfrom
Harshit-0413:fix-5147

Conversation

@Harshit-0413
Copy link
Copy Markdown
Contributor

Problem

In the instance sidebar, once a group (e.g., "Web") is expanded, clicking it again does not collapse it.

Root Cause

The toggle logic did not correctly reset the open group state when the same group was clicked again.

Solution

Updated the toggle logic to properly toggle between open and closed states.

Notes

  • Fixed ESLint issues
  • Minimal and focused change

@Harshit-0413 Harshit-0413 requested a review from a team as a code owner April 16, 2026 14:38
Copy link
Copy Markdown
Contributor

@cdprete cdprete left a comment

Choose a reason for hiding this comment

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

To my understanding, too many things have been changed/removed which are unrelated to the bug itself.

Moreover, if I'm right about https://github.com/codecentric/spring-boot-admin/pull/5267/changes#r3095328671, @SteKoe already knows I would open a regression bug if that feature disappears with no real reason ;)

@Harshit-0413 Harshit-0413 force-pushed the fix-5147 branch 2 times, most recently from e99ba38 to f934555 Compare April 16, 2026 18:37
Comment thread spring-boot-admin-server-ui/src/main/frontend/views/instances/shell/sidebar.vue Outdated
@SteKoe
Copy link
Copy Markdown
Contributor

SteKoe commented Apr 17, 2026

Please rebase your branch correctly as it contains backend changes that are not related to frontend (obviously).

@cdprete
Copy link
Copy Markdown
Contributor

cdprete commented Apr 17, 2026

Please rebase your branch correctly as it contains backend changes that are not related to frontend (obviously).

Yeah, I wanted to suggest the same, but then I saw there were merge commits added by you and @ulischulte, so I was not sure anymore who the culprit was. 😅

@SteKoe
Copy link
Copy Markdown
Contributor

SteKoe commented Apr 20, 2026

I just rebased and extended the implementation to work as stated in PR description:

  • When you navigate to a view, the sidebar automatically opens the group that contains the current page.
  • Clicking the toggle button on the currently open group collapses that group.
  • Clicking the toggle button on a different group opens that group instead.
  • Opening a different group closes the previously open one, so only one group is expanded at a time.
  • Changing the route resets the open state to the group of the newly navigated page.

@cdprete
Copy link
Copy Markdown
Contributor

cdprete commented Apr 20, 2026

Opening a different group closes the previously open one, so only one group is expanded at a time

Without changing the view, right? (aka: no $router.push(...) or so unless an entry in the group is clicked)

@SteKoe
Copy link
Copy Markdown
Contributor

SteKoe commented Apr 20, 2026

Without changing the view, right? (aka: no $router.push(...) or so unless an entry in the group is clicked)

yeah, right!

@SteKoe SteKoe merged commit 2047f8a into codecentric:master Apr 20, 2026
1 check passed
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.

3 participants