Skip to content

fix(web-components): recalculate navigation group height on expand - #4651

Merged
GCHQ-Developer-299 merged 1 commit into
mi6:developfrom
sylvesterkaczmarek:fix/3901-navigation-group-height-recalculation
Sep 1, 2026
Merged

fix(web-components): recalculate navigation group height on expand#4651
GCHQ-Developer-299 merged 1 commit into
mi6:developfrom
sylvesterkaczmarek:fix/3901-navigation-group-height-recalculation

Conversation

@sylvesterkaczmarek

Copy link
Copy Markdown

Summary of the changes

Fixes grouped navigation item spacing when collapsedIconLabels causes taller items in a collapsed side navigation and the side navigation is then expanded.

IcNavigationGroup cached the sum of child item heights while collapsed. On the first transition to the expanded state, the cache-miss path waited for layout to settle but then reused the old cached total instead of measuring the now-expanded items. This left the grouped-links wrapper at the collapsed height.

This change:

  • centralises the current grouped-item height measurement;
  • performs the initial measurement after the existing layout debounce instead of before it;
  • remeasures after the first side-navigation expansion or collapse for an uncached state;
  • preserves the per-state height cache for subsequent transitions.

No public API changes.

Related issue

Closes #3901

Testing

  • Adds a unit regression with different collapsed and expanded child heights.
  • Verifies the grouped-links height changes from 160px collapsed to 80px expanded.
  • Verifies the remeasurement occurs after the existing 100ms layout debounce.
  • Final branch is one web-components commit.
  • Branch is based directly on develop.

Full upstream CI will run when the PR is opened.

@GCHQ-Developer-530
GCHQ-Developer-530 force-pushed the fix/3901-navigation-group-height-recalculation branch from 7cd3e50 to d72509d Compare August 28, 2026 14:10
Measure grouped navigation item heights after layout settles and remeasure on the first expanded/collapsed transition so wrapped collapsed labels do not leave stale spacing.

.mi6#3901
@GCHQ-Developer-530
GCHQ-Developer-530 force-pushed the fix/3901-navigation-group-height-recalculation branch from d72509d to e0bb239 Compare August 28, 2026 14:38

@GCHQ-Developer-530 GCHQ-Developer-530 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.

Tested using playground, looks good to me!

For other reviewers:
The bug -

Screen.Recording.2026-08-28.at.16.14.52.mov

After this fix -

Screen.Recording.2026-08-28.at.16.14.16.mov

@GCHQ-Developer-299
GCHQ-Developer-299 merged commit 96ceb9b into mi6:develop Sep 1, 2026
6 checks passed
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.

3 participants