Skip to content

UI: Speed up alerts/rules/... pages by not rendering collapsed content#17485

Merged
juliusv merged 2 commits intomainfrom
ui/unmount-collapsed-panel-content
Nov 6, 2025
Merged

UI: Speed up alerts/rules/... pages by not rendering collapsed content#17485
juliusv merged 2 commits intomainfrom
ui/unmount-collapsed-panel-content

Conversation

@juliusv
Copy link
Member

@juliusv juliusv commented Nov 6, 2025

In contrast to Bootstrap, Mantine's Accordion component didn't remove its panel contents from the DOM when collapsed, so rendering pages with lots of collapsed Accordion items was way slower and more resource-intensive in the new Mantine UI. While I talked to Vitaly from Mantine and he managed to add unmounting of collapsed panel contents in Mantine 9, this will only be available next year. So for now, I'm forking over the Accordion component from Mantine and adding a hacky modification to it that removes contents for collapsed panels. This fork can be removed after upgrading to Mantine 9 sometime in 2026. I removed all the unnecessary test files and so on and just kept the core Accordion code files.

This should really help with the following issues:

#17254
#16830

The /alerts and /rules pages should be the most affected since the panels on those are collapsed by default. The /targets and /service-discovery pages have expanded panels by default, but I still swapped out the Accordion implementation for consistency and in case someone collapses a bunch of panels.

Demo of old (left) vs. new (right):

unmount-accordion-children.mp4

Which issue(s) does the PR fix:

Fixes #17254
Fixes #16830

Does this PR introduce a user-facing change?

[PERF] UI: Speed up alerts/rules/... pages by not rendering collapsed content

@juliusv juliusv force-pushed the ui/unmount-collapsed-panel-content branch from b7b3b35 to 76f69c5 Compare November 6, 2025 10:26
@juliusv juliusv requested a review from Nexucis November 6, 2025 10:31
In contrast to Bootstrap, Mantine's Accordion component didn't remove its
panel contents from the DOM when collapsed, so rendering pages with lots of
collapsed Accordion items was way slower and more resource-intensive in the
new Mantine UI. While I talked to Vitaly from Mantine and he managed to add
unmounting of collapsed panel contents in Mantine 9, this will only be
available next year. So for now, I'm forking over the Accordion component
from Mantine and adding a hacky modification to it that removes contents
for collapsed panels. This fork can be removed after upgrading to Mantine 9
sometime in 2026. I removed all the unnecessary test files and so on and
just kept the core Accordion code files.

This should really help with the following issues:

#17254
#16830

The /alerts and /rules pages should be the most affected since the panels
on those are collapsed by default. The /targets and /service-discovery
pages have expanded panels by default, but I still swapped out the
Accordion implementation for consistency and in case someone collapses a
bunch of panels.

Signed-off-by: Julius Volz <julius.volz@gmail.com>
@juliusv juliusv force-pushed the ui/unmount-collapsed-panel-content branch from 76f69c5 to 2b25bbf Compare November 6, 2025 10:33
Copy link
Member

@Nexucis Nexucis left a comment

Choose a reason for hiding this comment

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

excepting my little comment, lgtm and well done @juliusv that's a huge improvement indeed!

Signed-off-by: Julius Volz <julius.volz@gmail.com>
@juliusv
Copy link
Member Author

juliusv commented Nov 6, 2025

I'm going to force merge this one, as only the Go tests are still continuously failing due to an unrelated thing, for which I filed an issue: #17489

@juliusv juliusv disabled auto-merge November 6, 2025 17:28
@juliusv juliusv merged commit 7662797 into main Nov 6, 2025
147 of 154 checks passed
@juliusv juliusv deleted the ui/unmount-collapsed-panel-content branch November 6, 2025 17:28
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.

Performance regression on Alerts with new UI on 3.50 Prometheus3: Filter of alerts page unresponsive

2 participants