feat(ui): animate collapse panels in the new UI#15116
Open
ksitton58 wants to merge 1 commit into
Open
Conversation
Collapse panels in the new UI (finding-detail sections and other
data-toggle="collapse" panels) toggled open/closed instantly. Add a smooth
height slide, consistent with the filter accordion.
- index.js: the shared collapse shim now animates the target height and
vertical padding between 0 and its natural size over 250ms, settling to auto
(open) or display:none via .in (closed). Respects prefers-reduced-motion
(instant toggle), preserves aria-expanded, guards against re-clicks
mid-animation, and handles both border-box and content-box. One change covers
every collapse panel in the new UI.
- base.html: cache-bust index.js with ?v={% static_v %} (matching how the CSS is
loaded) so the JS change reaches users; first-party JS was not versioned before.
No Bootstrap is reintroduced: this enhances the new UI vanilla-JS shim that
already replaced Bootstrap collapse.
Maffooch
approved these changes
Jul 1, 2026
valentijnscholten
approved these changes
Jul 1, 2026
valentijnscholten
left a comment
Member
There was a problem hiding this comment.
I usually like fast and no animations, but I guess I'm not your default user. Approved :-)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Collapse panels in the new UI (finding-detail sections like Description / Mitigation / Impact, and other
data-toggle="collapse"panels) toggled open and closed instantly with no animation, which felt abrupt. This adds a smooth height slide, consistent with the filter accordion.Changes:
index.js: the shared collapse shim now animates the target's height and vertical padding between 0 and its natural size over 250ms, then settles toauto(open) ordisplay:nonevia.in(closed). It respectsprefers-reduced-motion(instant toggle), preservesaria-expanded, guards against re-clicks mid-animation, and handles bothborder-boxandcontent-box. One change covers every collapse panel in the new UI, with no per-panel template changes.base.html: cache-bustindex.jswith?v={% static_v %}(matching how the CSS is loaded) so this JS change actually reaches users' browsers. First-party JS was not versioned before.No Bootstrap is reintroduced. This enhances the new UI's own vanilla-JS shim that already replaced Bootstrap's collapse.
Test results
Verified on a local build (finding detail page): clicking a section animates its height smoothly from 0 to full and back (sampled per frame: steady 0 to 56px on open, 56 to 0px on close, no stall or jump),
aria-expandedtoggles correctly, and the form is not submitted. No Python changed, so no unit tests added.Documentation
N/A.
Checklist
dev.