Skip to content

Progress Bar Migration#6488

Open
miwha-adobe wants to merge 7 commits into
mainfrom
miwhabonini/feat-progress-bar-swc-1769
Open

Progress Bar Migration#6488
miwha-adobe wants to merge 7 commits into
mainfrom
miwhabonini/feat-progress-bar-swc-1769

Conversation

@miwha-adobe

@miwha-adobe miwha-adobe commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Description

Migrates Progress Bar from Spectrum 1 to Spectrum 2, introducing <swc-progress-bar> in @adobe/spectrum-wc and adding deprecation notices to the 1st-gen <sp-progress-bar>.

2nd-gen component (new):

  • core/components/progress-bar/ProgressBar.base.ts, ProgressBar.types.ts, and index.ts, built on the shared linear-progress-mixin.
  • swc/components/progress-bar/ProgressBar.ts, swc-progress-bar.ts registration, progress-bar.css, stories, tests, progress-bar.mdx docs page, and a consumer migration-guide.mdx.

API changes from Spectrum 1:

  • Renamed: progressvalue, side-labellabel-position="side", label attribute → label named slot, --mod-progressbar-*--swc-linear-progress-*; default size is now 'm'.
  • Added: min-value / max-value, static-color="black", value-label, formatOptions, accessible-label, and a description slot.
  • Removed: over-background (use static-color="white"), the --mod-progressbar-* custom properties, and host-level aria-label / role="progressbar" (the role and aria-value* now live on an internal element).

1st-gen (<sp-progress-bar>):

  • Added @deprecated JSDoc and window.__swc.DEBUG runtime warnings for label, side-label, and progress to guide consumers toward the Spectrum 2 API. Existing tests updated accordingly.

Motivation and context

Progress Bar is part of the 1st-gen to 2nd-gen component migration workstream. This delivers the Spectrum 2 implementation with an updated, more accessible API (slot-based labeling, internal ARIA, arbitrary numeric ranges) while giving 1st-gen consumers a clear, warned deprecation path and a dedicated migration guide.

Related issue(s)

  • fixes SWC-1769

Screenshots (if appropriate)


Author's checklist

  • I have read the CONTRIBUTING and PULL_REQUESTS documents.
  • I have reviewed at the Accessibility Practices for this feature, see: Aria Practices
  • I have added automated tests to cover my changes.
  • I have included a well-written changeset if my change needs to be published.
  • I have included updated documentation if my change required it.

Reviewer's checklist

  • Includes a Github Issue with appropriate flag or Jira ticket number without a link
  • Includes thoughtfully written changeset if changes suggested include patch, minor, or major features
  • Automated tests cover all use cases and follow best practices for writing
  • Validated on all supported browsers
  • All VRTs are approved before the author can update Golden Hash

Manual review test cases

  • <swc-progress-bar> renders and reflects its API

    1. Open the Progress Bar stories in Storybook
    2. Toggle value, min-value / max-value, size, label-position, static-color, value-label, and indeterminate via controls
    3. Expect the fill, value text, and label position to update correctly; value clamps within min-value/max-value; indeterminate shows the looping animation and ignores value-label
  • Custom properties apply; internals are not stylable

    1. Apply --swc-linear-progress-fill-color, --swc-linear-progress-track-color, --swc-linear-progress-thickness to a <swc-progress-bar>
    2. Confirm each takes effect, and that --mod-progressbar-* has no effect
    3. Expect the documented custom-property mapping in migration-guide.mdx to match actual behavior
  • 1st-gen deprecation warnings

    1. With window.__swc.DEBUG enabled, render <sp-progress-bar label="…" side-label progress="50">
    2. Observe the console
    3. Expect deprecation warnings for label, side-label, and progress, and no regressions to existing <sp-progress-bar> rendering/behavior
  • Docs pages render

    1. Open Progress Bar / Migration guide and the Progress Bar docs page in Storybook
    2. Confirm both render with no MDX errors and all anchor links resolve
    3. Expect documented API to match the component

Device review

  • Did it pass in Desktop?
  • Did it pass in (emulated) Mobile?
  • Did it pass in (emulated) iPad?

Accessibility testing checklist

  • Keyboard (required)

    1. Open a story with a <swc-progress-bar> alongside other focusable elements
    2. Tab through the page
    3. Expect the progress bar to have no focusable parts and to not be a tab stop; focus order of surrounding elements is unchanged; no focus traps
  • Screen reader (required)

    1. With VoiceOver / NVDA, navigate to a determinate <swc-progress-bar> that has a label slot (and separately, an indeterminate one using accessible-label)
    2. Read the progress bar
    3. Expect role="progressbar" with the accessible name from the label slot (or accessible-label), the current value announced via aria-valuenow (and aria-valuetext / value-label where set), and description slot content associated via aria-describedby; the indeterminate bar announces without a numeric value

miwha-adobe and others added 4 commits June 23, 2026 13:57
* feat(progress-bar): 2nd-gen migration phases 1-4 (setup, API, a11y)

Creates the 2nd-gen `<swc-progress-bar>` component through phase 4:

- Core: `ProgressBarBase` extending `LinearProgressMixin` with
  `indeterminate` boolean; types file re-exporting shared linear-progress
  surface; no variant (single accent fill).
- SWC: `ProgressBar` with full `role="progressbar"` render template,
  determinate value attrs, indeterminate suppression via Lit `nothing`,
  `aria-labelledby`/`aria-label`/`aria-describedby` wiring, description
  slot support.
- Mixin: replace hard-coded meter docs URL with a computed `docsHref`
  getter derived from `this.localName` so each concrete component gets an
  accurate docs link with no per-subclass override.
- 1st-gen: `@deprecated` JSDoc on `progress`, `sideLabel`, and `label`
  string attribute for renamed/replaced APIs.
- Migration plan: phases 1-4 checklists updated; B9 (role placement on
  shadow vs host) flagged for a11y expert review.

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

* fix(progress-bar): lint

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
* chore(progress-bar): update reduced motion

* style(progress-bar): value changes

* style(progress-bar): spacing in storybook

* fix(progress-bar): remove meta JSDoc and stories .gitkeep per review
…6456)

* chore(progress-bar): storybook, tests and update to migration skill

* test(progress-bar): remove duplicate test and target warnings by type/message

* test(progress-bar): update with waitFor

* fix(progress-bar): address feedback from PR Review
@changeset-bot

changeset-bot Bot commented Jul 8, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 2fb63dc

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

This PR includes changesets to release 84 packages
Name Type
@spectrum-web-components/progress-bar Patch
@adobe/spectrum-wc Minor
@spectrum-web-components/bundle Patch
documentation Patch
@spectrum-web-components/accordion Patch
@spectrum-web-components/action-bar Patch
@spectrum-web-components/action-button Patch
@spectrum-web-components/action-group Patch
@spectrum-web-components/action-menu Patch
@spectrum-web-components/alert-banner Patch
@spectrum-web-components/alert-dialog Patch
@spectrum-web-components/asset Patch
@spectrum-web-components/avatar Patch
@spectrum-web-components/badge Patch
@spectrum-web-components/breadcrumbs Patch
@spectrum-web-components/button-group Patch
@spectrum-web-components/button Patch
@spectrum-web-components/card Patch
@spectrum-web-components/checkbox Patch
@spectrum-web-components/clear-button Patch
@spectrum-web-components/close-button Patch
@spectrum-web-components/coachmark Patch
@spectrum-web-components/color-area Patch
@spectrum-web-components/color-field Patch
@spectrum-web-components/color-handle Patch
@spectrum-web-components/color-loupe Patch
@spectrum-web-components/color-slider Patch
@spectrum-web-components/color-wheel Patch
@spectrum-web-components/combobox Patch
@spectrum-web-components/contextual-help Patch
@spectrum-web-components/dialog Patch
@spectrum-web-components/divider Patch
@spectrum-web-components/dropzone Patch
@spectrum-web-components/field-group Patch
@spectrum-web-components/field-label Patch
@spectrum-web-components/help-text Patch
@spectrum-web-components/icon Patch
@spectrum-web-components/icons-ui Patch
@spectrum-web-components/icons-workflow Patch
@spectrum-web-components/icons Patch
@spectrum-web-components/iconset Patch
@spectrum-web-components/illustrated-message Patch
@spectrum-web-components/infield-button Patch
@spectrum-web-components/link Patch
@spectrum-web-components/menu Patch
@spectrum-web-components/meter Patch
@spectrum-web-components/modal Patch
@spectrum-web-components/number-field Patch
@spectrum-web-components/overlay Patch
@spectrum-web-components/picker-button Patch
@spectrum-web-components/picker Patch
@spectrum-web-components/popover Patch
@spectrum-web-components/progress-circle Patch
@spectrum-web-components/radio Patch
@spectrum-web-components/search Patch
@spectrum-web-components/sidenav Patch
@spectrum-web-components/slider Patch
@spectrum-web-components/split-view Patch
@spectrum-web-components/status-light Patch
@spectrum-web-components/swatch Patch
@spectrum-web-components/switch Patch
@spectrum-web-components/table Patch
@spectrum-web-components/tabs Patch
@spectrum-web-components/tags Patch
@spectrum-web-components/textfield Patch
@spectrum-web-components/thumbnail Patch
@spectrum-web-components/toast Patch
@spectrum-web-components/tooltip Patch
@spectrum-web-components/top-nav Patch
@spectrum-web-components/tray Patch
@spectrum-web-components/underlay Patch
@spectrum-web-components/custom-vars-viewer Patch
@spectrum-web-components/story-decorator Patch
@spectrum-web-components/vrt-compare Patch
@spectrum-web-components/base Patch
@spectrum-web-components/grid Patch
@spectrum-web-components/opacity-checkerboard Patch
@spectrum-web-components/reactive-controllers Patch
@spectrum-web-components/shared Patch
@spectrum-web-components/styles Patch
@spectrum-web-components/theme Patch
@spectrum-web-components/truncated Patch
@spectrum-web-components/eslint-plugin Patch
@spectrum-web-components/stylelint-header-plugin 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

@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

📚 Branch Preview Links

🔍 Gen1 Visual Regression Test Results

When a visual regression test fails (or has previously failed while working on this branch), its results can be found in the following URLs:

Deployed to Azure Blob Storage: pr-6488

If the changes are expected, update the current_golden_images_cache hash in the circleci config to accept the new images. Instructions are included in that file.
If the changes are unexpected, you can investigate the cause of the differences and update the code accordingly.

@coveralls

coveralls commented Jul 8, 2026

Copy link
Copy Markdown
Collaborator

Coverage Report for CI Build 29036112363

Coverage decreased (-0.01%) to 96.243%

Details

  • Coverage decreased (-0.01%) from the base build.
  • Patch coverage: 7 uncovered changes across 1 file (32 of 39 lines covered, 82.05%).
  • No coverage regressions found.

Uncovered Changes

File Changed Covered %
1st-gen/packages/progress-bar/src/ProgressBar.ts 39 32 82.05%

Coverage Regressions

No coverage regressions found.


Coverage Stats

Coverage Status
Relevant Lines: 39208
Covered Lines: 37935
Line Coverage: 96.75%
Relevant Branches: 6465
Covered Branches: 6022
Branch Coverage: 93.15%
Branches in Coverage %: Yes
Coverage Strength: 461.2 hits per line

💛 - Coveralls

@miwha-adobe miwha-adobe changed the title Miwhabonini/feat progress bar swc 1769 Progress Bar Migration Jul 9, 2026
**Deferred items are out of scope.** The plan may explicitly defer features to follow-up tickets (e.g. form-associated behavior, cross-root ARIA). Do not implement deferred items in Phase 3 even if they appear in the API section of the plan — mark them as skipped and note the tracking ticket.

**1st-gen changes are limited to deprecation notices only.** When adding deprecation notices to 1st-gen, restrict changes to: (1) `@deprecated` JSDoc on exported types, consts, and properties; and (2) `window.__swc.warn()` calls added inside already-existing setters or other existing code paths. Do not refactor 1st-gen code structure — no new backing types, no converting simple properties to getter/setter patterns, no new private fields. TypeScript TS6385 hints that arise from deprecated types referencing each other internally are an accepted side effect and do not require structural fixes.
**For each breaking change in the migration plan, you must add both `@deprecated` JSDoc and a `window.__swc.warn()` call to the 1st-gen file.** JSDoc alone is not enough — types and IDE tooling pick it up, but consumers building against compiled output won't see it. Restrict 1st-gen changes to these two things only: do not add new backing types, do not convert plain properties to getter/setter patterns, do not add new private fields.

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.

The previous instructions stated "When adding deprecation notices to 1st-gen, restrict changes to: (1) .....", which was really more just a guardrail in how to add notices, but it wasn't explicit about needing to add the deprecation warning. I didn't find the skill prompts I used (in the migration skill cheat sheet canvas) prompting claude to add the deprecation notice.

consoleWarnStub.restore();
});

it('warns in Dev Mode when accessible attributes are not leveraged', async () => {

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.

This test is a duplicate in the file, so I removed it


const spyCall = consoleWarnStub.getCall(0);
const spyCall = consoleWarnStub
.getCalls()

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.

The tests were breaking because the warnStub no longer has just one warning with the introduction of the additional deprecation warnings.

* range) or an indeterminate loading animation when completion time is unknown.
* Implements the WAI-ARIA `progressbar` role on the shadow `.swc-LinearProgress`
* element (the host carries no ARIA).
*

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.

The a11y analysis requires role="progressbar" on the host, but this puts it on the shadow .swc-LinearProgress element. This is intentional because the host-level ARIA can't aria-labelledby/aria-describedby-reference the shadow-internal label/description ids (Sounds like ElementInternals reference-target not ready). This also matches Meter.

// ────────────────────

const sizeLabels = {
s: 'Small',

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.

@caseyisonit I know you mentioned in this PR as a nit that we should lean on the API values rather than these formatted versions. I checked Meter and it has this same implementation (likely where this was copied from), so if we want to remove these labels, then it should be changed in both files.

}

/* Slow rather than stop (WCAG 2.3.3): a static fill loses the indeterminate meaning. */
@media (prefers-reduced-motion: reduce) {

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.

Considered extracting the reduced-motion overrides (animation-duration: 15s; animation-timing-function: linear) into a shared _lit-styles/ file to be consumed by progress-bar.css, progress-circle.css, and pending-spinner.css (the latter flows into button via its pending state).

Decided to keep it inline for now, but happy to pull it into a shared stylesheet if the team thinks the consistency signal is worth the abstraction. It felt like it might be overkill for two lines. Thoughts?

@miwha-adobe miwha-adobe marked this pull request as ready for review July 9, 2026 23:24
@miwha-adobe miwha-adobe requested a review from a team as a code owner July 9, 2026 23:24
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