Skip to content

Underline nav shared observer coalesced rebuild#8035

Draft
mattcosta7 wants to merge 3 commits into
underline-nav-full-css-spikefrom
underline-nav-shared-observer-coalesced-rebuild
Draft

Underline nav shared observer coalesced rebuild#8035
mattcosta7 wants to merge 3 commits into
underline-nav-full-css-spikefrom
underline-nav-shared-observer-coalesced-rebuild

Conversation

@mattcosta7

Copy link
Copy Markdown
Contributor

Closes #

Changelog

New

Changed

Removed

Rollout strategy

  • Patch release
  • Minor release
  • Major release; if selected, include a written rollout or migration plan
  • None; if selected, include a brief description as to why

Testing & Reviewing

Merge checklist

…registry

Reworks `createDescendantRegistry` to support an optional shared
IntersectionObserver owned by the Provider (instead of one observer per
item) and to coalesce registry rebuilds so multiple registrations in the
same tick trigger a single rebuild. Both UnderlineNav and ActionBar opt
into these via the new `useRegisterOverflowObserver` hook.
- ActionBar opts into the shared IntersectionObserver via
  `useRegisterOverflowObserver` (threshold 0.75), with grouped items
  using the `disabled` option to skip subscription, matching the
  previous early-return behavior.
- Add unit tests asserting coalesced rebuilds (N same-tick
  registrations -> single rebuild) and shared-observer fan-out (one
  observer, one callback updating all items), plus observer
  unobserve/disconnect cleanup.
@mattcosta7 mattcosta7 self-assigned this Jun 23, 2026
@changeset-bot

changeset-bot Bot commented Jun 23, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 13d8541

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@primer/react Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

… of offsetTop reads (#8030)

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: mattcosta7 <8616962+mattcosta7@users.noreply.github.com>
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.

2 participants