Skip to content

refactor(button): collapse pending into a single PendingMixin#6440

Draft
Rajdeepc wants to merge 1 commit into
mainfrom
rajdeepc/refactor-pending-single-mixin
Draft

refactor(button): collapse pending into a single PendingMixin#6440
Rajdeepc wants to merge 1 commit into
mainfrom
rajdeepc/refactor-pending-single-mixin

Conversation

@Rajdeepc

@Rajdeepc Rajdeepc commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

Replaces the three-piece design from #6439 (PendingController + PendingMixin + renderPendingSpinner) with two pieces:

  • PendingMixin (core/mixins) — owns all pending state directly: 1-second-delayed pendingActive via @State(), inline-size freeze, accessible-name derivation, and click suppression. Uses Lit's changedProperties.has('pending') instead of a _wasPending tracker.
  • renderPendingSpinner (core/directives/pending-spinner) — relocated from the button package so non-button components can reuse it.

ButtonBase is fully pending-agnostic. swc-button and swc-action-button opt in via PendingMixin. No public API change — pending, pending-label, and busy behavior are identical to before.

Key differences vs. #6439:

  • No PendingController or PendingControllerHost (phantom abstraction that delegated entirely to the mixin anyway).
  • pendingActive restored as @State() (idiomatic Lit; no manual requestUpdate calls needed).
  • Pending+disabled guard uses 'disabled' in this instead of a type cast.
  • Changeset is minor (additive public API surface).

Replaces the three-piece design from #6439 (PendingController +
PendingMixin + renderPendingSpinner) with two pieces:

- PendingMixin (core/mixins) — owns all pending state directly:
  1-second-delayed pendingActive via @State(), inline-size freeze,
  accessible-name derivation, and click suppression. Uses Lit's
  changedProperties.has('pending') instead of a _wasPending tracker.
- renderPendingSpinner (core/directives/pending-spinner) — relocated
  from the button package so non-button components can reuse it.

ButtonBase is fully pending-agnostic. swc-button and swc-action-button
opt in via PendingMixin. No public API change — pending, pending-label,
and busy behavior are identical to before.

Key differences vs. #6439:
- No PendingController or PendingControllerHost (phantom abstraction
  that delegated entirely to the mixin anyway).
- pendingActive restored as @State() (idiomatic Lit; no manual
  requestUpdate calls needed).
- Pending+disabled guard uses 'disabled' in this instead of a type cast.
- Changeset is minor (additive public API surface).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@changeset-bot

changeset-bot Bot commented Jun 23, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 8aa0539

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

This PR includes changesets to release 2 packages
Name Type
@spectrum-web-components/core Minor
@adobe/spectrum-wc Minor

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

@coveralls

Copy link
Copy Markdown
Collaborator

Coverage Report for CI Build 28007154291

Warning

No base build found for commit 53f5752 on main.
Coverage changes can't be calculated without a base build.
If a base build is processing, this comment will update automatically when it completes.

Coverage: 96.246%

Details

  • Patch coverage: No coverable lines changed in this PR.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

Requires a base build to compare against. How to fix this →


Coverage Stats

Coverage Status
Relevant Lines: 39173
Covered Lines: 37902
Line Coverage: 96.76%
Relevant Branches: 6459
Covered Branches: 6017
Branch Coverage: 93.16%
Branches in Coverage %: Yes
Coverage Strength: 458.45 hits per line

💛 - Coveralls

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