Skip to content

fix(#3548): pin secondary menu at bottom of Work Side Menu during scroll#3709

Open
twjeffery wants to merge 2 commits intodevfrom
tom/side-menu-scroll
Open

fix(#3548): pin secondary menu at bottom of Work Side Menu during scroll#3709
twjeffery wants to merge 2 commits intodevfrom
tom/side-menu-scroll

Conversation

@twjeffery
Copy link
Copy Markdown
Collaborator

@twjeffery twjeffery commented Mar 30, 2026

Summary

  • Restructures the Work Side Menu so only the primary nav area scrolls, while the secondary menu (Search, Get support, Release notes), account section, and collapse toggle stay pinned at the bottom
  • Adds scroll-aware border and shadow indicators that fade in/out (300ms) based on scroll position, only showing when there is hidden content in that direction
  • Adds browser test verifying secondary menu remains visible when primary nav overflows
Screen.Recording.2026-03-30.at.3.48.30.PM.mov

Top of scroll

image ### Middle of scroll image ### Bottom of scroll image ### No scroll image

Closes #3548

Test plan

  • Open the PR playground at /bugs/3548 which has enough primary items to overflow
  • Verify primary nav scrolls independently while secondary menu stays pinned at bottom
  • Verify header stays fixed at top, items don't scroll behind it
  • Verify border and shadow appear/fade when scrolled away from top or bottom
  • Verify border and shadow disappear when scrolled fully to either end
  • Collapse the menu and verify layout still works at 72px width
  • Resize the viewport height and confirm the layout adapts
  • Test on mobile viewport (menu opens as full-screen modal)

@Spark450 Spark450 added the P3 Priority 3 (nice to have): Valuable, but safe to release after launch. label Mar 30, 2026
@twjeffery twjeffery force-pushed the tom/side-menu-scroll branch 2 times, most recently from 9c3723b to 2ce89d2 Compare April 2, 2026 19:05
@twjeffery twjeffery requested a review from ArakTaiRoth April 2, 2026 19:06
Restructure the side menu layout so only the primary nav scrolls while
secondary menu, account section, and collapse toggle stay fixed at the
bottom. Adds scroll-aware border and shadow indicators that fade in
when content is hidden in either direction.
@twjeffery twjeffery force-pushed the tom/side-menu-scroll branch from 2ce89d2 to 96ecc0c Compare April 2, 2026 19:21
Copy link
Copy Markdown
Collaborator

@bdfranck bdfranck left a comment

Choose a reason for hiding this comment

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

Looks good! I have a couple suggestions that I added in a commit. You can squash them if you agree. Changes include:

  • Give the top section the class name .top-section for consistency
  • Remove bottom padding on primary menu to get rid of the extra space
  • Use tokens for new values (GovAlta/design-tokens#144)

observer = watchPathChanges(setCurrentUrl);

if (typeof ResizeObserver !== "undefined") {
_resizeObserver = new ResizeObserver(() => setMenuScrolling());
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Potential problem with this. The ResizeObserver fires setMenuScrolling, which has the potential to change the observed _menuEl, which would cause it to fire again. I can't come up with an actual test that will have this problem, just noticed it as a potential issue we may want to do something about now.


// Menu
function updateScrollPosition() {
const innerEl = _scrollEl?.shadowRoot?.querySelector(".goa-scrollable");
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I'm not sure if this will work or not. But the Scrollable.svelte dispatches _scroll event that I think should be used for this instead if we can. Otherwise we're linked to the component in a more brittle fashion. You can reference Drawer.svelte on line 181 for how it's used there.

@twjeffery
Copy link
Copy Markdown
Collaborator Author

Quick update on this one @bdfranck @ArakTaiRoth:

I got the suggestions and review points sorted out locally and tests are still passing.

I reviewed and merged the token PR from Benji, but the npm release failed due to a bad token. Now waiting on another fix PR to re-trigger the publish before I squash everything together and push

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

Labels

P3 Priority 3 (nice to have): Valuable, but safe to release after launch.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Work Side Menu: Secondary menu should stay pinned at bottom during scroll

4 participants