Skip to content

refactor: use shadow root SlotObserver to update breadcrumbs items#11784

Merged
web-padawan merged 1 commit into
mainfrom
refactor/breadcrumbs-slot-observer
May 20, 2026
Merged

refactor: use shadow root SlotObserver to update breadcrumbs items#11784
web-padawan merged 1 commit into
mainfrom
refactor/breadcrumbs-slot-observer

Conversation

@web-padawan

Copy link
Copy Markdown
Member

Replace ItemsSlotController and its per-item MutationObserver with
a single SlotObserver targeting the shadow root plus a subtree
MutationObserver for path attribute changes.

The shadow-root-level observer is what the upcoming overflow PR needs:
its union diff naturally suppresses callbacks for cross-slot
reassignment between root, default, and overlay slots, so the
overflow logic won't loop back through the observer. Landing the
refactor on its own keeps the overflow PR focused on the new feature.

flush() runs the first pass synchronously so the current state on
the last item is applied during firstUpdated().

Part of #11770


🤖 Generated with Claude Code

Replace `ItemsSlotController` and its per-item `MutationObserver` with
a single `SlotObserver` targeting the shadow root plus a subtree
`MutationObserver` for `path` attribute changes. The shadow-root-level
observer prepares for the upcoming overflow feature: its union diff
naturally suppresses callbacks for cross-slot reassignment between
`root`, default, and `overlay` slots, so the overflow logic won't loop
back through the observer.

`flush()` runs the first pass synchronously so the `current` state on
the last item is applied during `firstUpdated()`.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@web-padawan web-padawan requested a review from vursen May 20, 2026 12:12
@web-padawan web-padawan changed the title refactor(breadcrumbs): use SlotObserver to observe items refactor: use shadow root SlotObserver to update breadcrumbs items May 20, 2026
@sonarqubecloud

Copy link
Copy Markdown

@web-padawan web-padawan merged commit 5da5046 into main May 20, 2026
10 checks passed
@web-padawan web-padawan deleted the refactor/breadcrumbs-slot-observer branch May 20, 2026 12:20
@vaadin-bot

Copy link
Copy Markdown
Collaborator

This ticket/PR has been released with Vaadin 25.2.0-beta1.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants