Skip to content

fix: react to dynamic optional slots - #87

Merged
Banegasn merged 1 commit into
mainfrom
codex/issue-22-dynamic-slots
Jul 29, 2026
Merged

fix: react to dynamic optional slots#87
Banegasn merged 1 commit into
mainfrom
codex/issue-22-dynamic-slots

Conversation

@Banegasn

Copy link
Copy Markdown
Owner

Linked issue

Fixes #22

Summary

  • Keep optional icon, supporting text, action, and navigation slots mounted in button, chip, list item, snackbar, and top app bar components.
  • Use native slotchange events and hidden wrappers so dynamic additions, removals, and reassignment update layout without MutationObserver instances or manually managed listeners.
  • Add browser suites for button and chip and dynamic-slot coverage for every affected family.

Acceptance criteria

  • Optional slotted content added after connection appears immediately.
  • Removing content collapses spacing immediately through hidden wrappers.
  • Slot reassignment updates the correct region.
  • Reconnect coverage verifies dynamic slot changes continue to work; implementation has no observer or external listener lifecycle to leak.
  • Initial absent/present and dynamic transitions are covered for button, chip, list item, snackbar, and top app bar.

Risk and compatibility

  • Risk: low. Existing slots and public APIs are unchanged; only their dynamic layout behavior is corrected.
  • Semver impact: patch.
  • Rollback: revert this commit.

Verification

Passed with pnpm 11.12.0:

  • pnpm lint
  • pnpm typecheck
  • pnpm tokens:check
  • pnpm build
  • pnpm smoke:packages
  • pnpm smoke:svelte-vite
  • pnpm verify:package-licenses
  • pnpm audit:prod
  • Targeted and repository browser suites in Chromium, Firefox, and WebKit; affected totals: button 9, chip 9, list 51, snackbar 39, top app bar 33.

The repository-wide pnpm test command exercised all affected suites but its unrelated Angular app test fails under the local Node 26 runtime because localStorage is unavailable. CI pins Node 24.18.0; no Angular code was changed.

Documentation and accessibility

No public API or semantic change. Existing accessibility tests continue to pass; hidden wrappers remove empty regions from layout.

Release notes

Optional slotted button, chip, list item, snackbar, and top app bar content now updates immediately when it changes at runtime.

@Banegasn
Banegasn merged commit b187598 into main Jul 29, 2026
1 check 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.

[P1] Make conditional slot layouts reactive to dynamic content

1 participant