Skip to content

fix: #662 side bar menu groups no longer open when side bar is collapsed#666

Merged
kurtdoherty merged 1 commit into
mainfrom
662-fix-side-bar-group-opening-when-collapsed
Aug 6, 2025
Merged

fix: #662 side bar menu groups no longer open when side bar is collapsed#666
kurtdoherty merged 1 commit into
mainfrom
662-fix-side-bar-group-opening-when-collapsed

Conversation

@kurtdoherty
Copy link
Copy Markdown
Contributor

fixes: #662

@rpt-uk-github
Copy link
Copy Markdown

rpt-uk-github commented Aug 6, 2025

🎉 Snyk checks have passed. No issues have been found so far.

security/snyk check is complete. No issues have been found. (View Details)

license/snyk check is complete. No issues have been found. (View Details)

code/snyk check is complete. No issues have been found. (View Details)

})
})

observer.observe(element, {
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

note: scout the addition of observing data-is-active changes

// for changes to `aria-current` or `data-is-active`
if (sideBarState === 'collapsed') return

const element = ref.current
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

note: small scout. No need to query for the elements every time a mutation is observed.

function closeAllMenuGroupsWhenAriaCurrentChanges() {
function closeAllMenuGroupsWhenAriaCurrentOrDataIsActiveChange() {
if (!ref.current) return

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

note: This is what we were missing. Our observer was opening menu groups even when the side bar was collapsed.

@kurtdoherty kurtdoherty marked this pull request as ready for review August 6, 2025 05:32
@kurtdoherty kurtdoherty force-pushed the 662-fix-side-bar-group-opening-when-collapsed branch from 4902bb4 to 35206f2 Compare August 6, 2025 05:33
@codacy-production
Copy link
Copy Markdown

Coverage summary from Codacy

See diff coverage on Codacy

Coverage variation Diff coverage
Report missing for adf06251 100.00%
Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (adf0625) Report Missing Report Missing Report Missing
Head commit (35206f2) 8038 7404 92.11%

Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: <coverage of head commit> - <coverage of common ancestor commit>

Diff coverage details
Coverable lines Covered lines Diff coverage
Pull request (#666) 15 15 100.00%

Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: <covered lines added or modified>/<coverable lines added or modified> * 100%

See your quality gate settings    Change summary preferences

Footnotes

  1. Codacy didn't receive coverage data for the commit, or there was an error processing the received data. Check your integration for errors and validate that your coverage setup is correct.

@kurtdoherty kurtdoherty merged commit 5423a3d into main Aug 6, 2025
6 of 7 checks passed
@kurtdoherty kurtdoherty deleted the 662-fix-side-bar-group-opening-when-collapsed branch August 6, 2025 05:43
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.

bug: side bar group expands when side bar is collapsed

2 participants