Skip to content

Conversation

@madsrasmussen
Copy link
Contributor

@madsrasmussen madsrasmussen commented Jul 29, 2025

This PR adds functionality to remember the Section Sidebar Menu state across sections. It also introduces different contexts to interact with the menu from the backoffice. The state remains synchronized across all contexts. No matter where the state is updated, it will be reflected in the related contexts.

The PR includes a sample playground that demonstrates the current state for the section and across sections via dashboards. It is possible to close any open menu item from the dashboard. The example also registers a "Collapse Menu Item"-entity action to show interaction with a local menu item state.

Demo video of the example:
https://github.com/user-attachments/assets/d1267a87-f76e-42aa-a8d5-aa76e6a53741

Global State
UMB_SECTION_SIDEBAR_MENU_GLOBAL_CONTEXT
Wraps the entire application and tracks states for all sections.

Section State
UMB_SECTION_SIDEBAR_MENU_SECTION_CONTEXT
Wraps a section and tracks the state for all menu items inside a section

Menu Item State
UMB_MENU_ITEM_CONTEXT
Wraps the menu item and tracks the state for this menu item.

Partly fix of #17074
Partly fix of #17076

Additional PRs coming to support deep link into paginated tree structure menus and remembering the last visited item when navigating between sections.

Introduces an 'events' property to UmbExtensionSlotElement, allowing dynamic assignment and removal of event listeners on extension components. Event listeners are added when extensions are permitted and removed on disconnect, improving extensibility and event handling for extension slots.
Introduces handlers for entity expansion and collapse events in the section sidebar menu. This change enables the menu to respond to expansion state changes by updating the context accordingly.
Introduces a local expansion state to both section sidebar and tree menu item components to prevent unnecessary updates and rerenders. This improves performance by ensuring state updates only occur when needed.
@nielslyngsoe nielslyngsoe merged commit e5f6134 into main Aug 28, 2025
26 of 27 checks passed
@nielslyngsoe nielslyngsoe deleted the v16/feature/menu-expansion branch August 28, 2025 10:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants