Skip to content

fix(design-system): restore max-height strategy for MaxHeightSmoother when minHeight > 0#479

Open
IgnazioDS wants to merge 1 commit into
aymericzip:mainfrom
IgnazioDS:fix/294-maxheightsmoother-minheight-expand
Open

fix(design-system): restore max-height strategy for MaxHeightSmoother when minHeight > 0#479
IgnazioDS wants to merge 1 commit into
aymericzip:mainfrom
IgnazioDS:fix/294-maxheightsmoother-minheight-expand

Conversation

@IgnazioDS

Copy link
Copy Markdown

Fixes #294

What happened

The two-step expand is a regression, not a missing feature. The max-height strategy for minHeight > 0 landed in 19bb8a2 (credit @TheoStracke), but the editor rework in b2d302d restored the previous grid-rows-only component body while keeping the new JSDoc and Storybook stories. Since then the component has disagreed with its own documentation and tests: the stories assert --mhs-collapsed / --mhs-expanded CSS variables and max-h-[var(...)] classes that the component no longer renders, and the dead-time bug returned to every consumer that sets a preview floor (ExpandCollapse, CommonQuestions).

What this PR does

Restores the documented two-strategy implementation:

  • Strategy A (minHeight === 0): grid-template-rows transition, unchanged in spirit; min-h-0 on the inner wrapper so the track can fully collapse.
  • Strategy B (minHeight > 0): animates max-height between --mhs-collapsed (the minHeight floor) and --mhs-expanded, so the expansion starts from the already-visible floor in one continuous motion instead of the silent 0fr -> minHeight phase followed by the visible jump.

No changes to the JSDoc or the stories - they already describe exactly this behavior.

Verification

  • Every play-function assertion in maxheightsmoother.stories.tsx passes against the restored component (Strategy A classes, Strategy B CSS variables and classes, role/tabIndex/aria-expanded).
  • Consumer audit: all isHidden-only call sites (Accordion, CollapsibleTable, DropDown, FileTree, MobileNavbar, the dashboard form sections) stay on Strategy A, which remains a grid, so DropDown's group-hover/dropdown:grid-rows-[1fr] overrides keep working. Accordion's role="region" / id / aria-labelledby still win through the props spread.

One thing worth your eyes on review: Strategy A now clips overflow on the inner wrapper rather than the container (as in 19bb8a2), so a consumer that overrides overflow on the container via className (DropDown passes overflow-x-visible) no longer changes the clipping of flowing content. Dropdown panels are absolutely positioned against the container, so they are not clipped by the inner wrapper - but if you prefer the container-level overflow of the current main, that is a two-line adjustment.

… when minHeight > 0

Fixes the two-step / delayed expand described in aymericzip#294.

The Strategy A/B implementation (grid-template-rows for minHeight === 0,
max-height via --mhs-collapsed/--mhs-expanded CSS variables for
minHeight > 0) landed in 19bb8a2 but was unintentionally reverted by
the large editor rework in b2d302d, which restored the old
grid-rows-only body while keeping the JSDoc and the Storybook play
assertions that describe Strategy B. Since then the component and its
own stories have disagreed: the stories assert --mhs-* variables and
max-h-[var(...)] classes the component no longer rendered, and the
minHeight dead-time bug returned to every consumer that sets a preview
floor (ExpandCollapse, CommonQuestions).

This restores the documented implementation, credit to @TheoStracke
for the original fix. Consumers audited: all isHidden-only call sites
(Accordion, CollapsibleTable, DropDown, FileTree, MobileNavbar,
dashboard forms) stay on Strategy A, which remains a grid so DropDown's
group-hover:grid-rows overrides keep working; Accordion's role/id
overrides still win through the props spread.
@gentle-gecko-okogwkww0gkkk4040

gentle-gecko-okogwkww0gkkk4040 Bot commented Jul 12, 2026

Copy link
Copy Markdown

The preview deployment for website failed. 🔴

Open Build Logs | Open Application Logs

Last updated at: 2026-07-12 22:53:51 CET

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.

Latency / two-step expand when minHeight is set in MaxHeightSmoother

1 participant