Skip to content

feat(ui): smooth and tidy the filter category accordion in the new UI#15106

Open
ksitton58 wants to merge 1 commit into
DefectDojo:devfrom
ksitton58:feat/new-ui-filter-collapse-animation
Open

feat(ui): smooth and tidy the filter category accordion in the new UI#15106
ksitton58 wants to merge 1 commit into
DefectDojo:devfrom
ksitton58:feat/new-ui-filter-collapse-animation

Conversation

@ksitton58

Copy link
Copy Markdown
Contributor

Description

Addresses maintainer feedback that the new-UI filter panel felt "funky" to expand/collapse and was hard to read.

The filter categories used native <details>: the chevron animated but the body snapped open/closed, the header bars jumped to new positions instead of sliding together, and the categories packed inconsistently two-per-row (the filter form is display: flex; flex-wrap: wrap).

Changes:

  • Convert each category to a small Alpine toggle (a <button> with aria-expanded and type="button", so it never submits the filter form). The body sits in an overflow-clipped grid that animates grid-template-rows: 0fr to 1fr. Animating the real layout height makes the whole header stack slide together smoothly and collapse fully to 0. This works in all browsers (no interpolate-size dependency). Default-open groups server-render the open state, so there is no flash on load.
  • Give each category flex: 0 0 100% so they stack as full-width rows instead of packing two-per-row, making the panel easy to scan.

No filter behavior changes: same fields, same form submission.

Test results

Verified on a local build at the Findings filter panel: categories stack as full-width rows; toggling slides the body and the header stack together (collapses to 0px, expands to content height); clicking a header does not submit the form (type="button"); aria-expanded reflects state. No Python changed, so no unit tests added.

Documentation

N/A.

Checklist

  • Submitted against dev.
  • Meaningful PR name.
  • Ruff compliant (no Python changed).
  • Python 3.13 compliant (no Python changed).

The new-UI filter categories used native <details>: the chevron animated but
the body snapped open/closed, the header bars jumped to new positions instead of
sliding together, and the categories packed inconsistently two-per-row (the
filter form is display:flex/wrap), which was hard to scan.

- Convert each category to a small Alpine toggle: a <button> with aria-expanded
  and type=button (so it never submits the filter form), with the body wrapped in
  an overflow-clipped grid that animates grid-template-rows 0fr->1fr. Animating
  the real layout height makes the whole header stack slide together smoothly and
  collapse fully to 0. Works in all browsers; default-open groups server-render
  the open state so there is no flash on load.
- Give each category flex: 0 0 100% so they stack as full-width rows instead of
  packing two-per-row, making the filter panel easy to scan.

@mtesauro mtesauro left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Approved

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants