Skip to content

style(status-light): clean up code styles#6157

Merged
caseyisonit merged 5 commits intoswc-1668/poc-componentsfrom
rise-erpelding/swc-1671-status-light-code-style
Apr 13, 2026
Merged

style(status-light): clean up code styles#6157
caseyisonit merged 5 commits intoswc-1668/poc-componentsfrom
rise-erpelding/swc-1671-status-light-code-style

Conversation

@rise-erpelding
Copy link
Copy Markdown
Collaborator

@rise-erpelding rise-erpelding commented Apr 9, 2026

Description

2nd-gen status light cleanup for SWC-1671: contributor TypeScript guides (STATUS_LIGHT_* naming, types file layout, DEBUG lifecycle/URLs), SWC concrete class polish, and story fixes.

Core (StatusLight.types.ts, StatusLight.base.ts)

  • Rename constants to STATUS_LIGHT_* (multi-word prefix per naming guide). No deprecated STATUSLIGHT_* re-exports (2nd-gen still preview).
  • Reorganize types with SHARED / S1-ONLY / CANONICAL / TYPES separators (same idea as Badge.types.ts). Add StatusLightSize derived from valid sizes.
  • DEBUG: Run validation in update() before super.update() (match Badge.base.ts / 17_debug-validation). warn() doc links use 2nd-gen Storybook (.../second-gen/?path=/docs/components-status-light--docs, same base as SECOND_GEN_URL in scripts/generate-llms-txt.js).

SWC (StatusLight.ts, stories)

  • Class-level @property / @attribute on the concrete class for CEM parity (e.g. with ProgressCircle.ts).
  • classMap: keep typeof this.variant !== 'undefined' for consistency with Badge.
  • Stories: import/use STATUS_LIGHT_* everywhere (e.g. Sizes story uses STATUS_LIGHT_VALID_SIZES).

Out of scope (documented / deferred)

  • S1-only blocks in core types: left labeled for removal with 1st-gen; no full “canonical-only core” refactor in this PR.
  • Deprecated aliases for old constant names: skipped

Motivation and context

  • Aligns 2nd-gen status light with 08_component-types, 10_naming-conventions, 06_method-patterns, and 17_debug-validation so future S1 removal and consumers get predictable exports and DEBUG behavior.

Related issue(s)

  • SWC-1671

Screenshots (if appropriate)

None expected (no intentional visual/CSS changes). If VRT diffs appear, confirm against Storybook.


Author's checklist

  • I have read the CONTRIBUTING and PULL_REQUESTS documents.
  • I have reviewed the Accessibility Practices for this feature, see: ARIA Practices
  • I have added or kept automated tests covering these changes (yarn test status-light from 2nd-gen/packages/swc).
  • I have included a well-written changeset if this change should publish a version bump (likely patch for @spectrum-web-components/core / @adobe/spectrum-wc if applicable).
  • I have included updated documentation if required (stories/JSDoc updated in-repo).

Reviewer's checklist

  • Includes a GitHub issue with appropriate flag or Jira ticket number without a link
  • Includes a thoughtfully written changeset if the change warrants patch, minor, or major
  • Automated tests cover the change and follow project practices
  • Validated on supported browsers (spot-check if scope is narrow)
  • All VRTs approved before golden hash updates (if CI reports diffs)

After the PR opens, use branch preview links from the github-actions comment (Storybook second-gen, VRT review URLs) instead of hardcoding PR numbers in manual steps.

Manual review test cases

  • Status light — Storybook (2nd-gen)

    1. Open second-gen Storybook → Status light (overview, sizes, semantic / non-semantic variants).
    2. Confirm layouts and labels render; controls for variant and size behave as before.
  • DEBUG (optional, local dev)

    1. Run Storybook or app in development so window.__swc.DEBUG is on.
    2. Set an invalid variant on <swc-status-light> (e.g. unsupported string) → expect warn with message + link to second-gen docs.
    3. Add disabled attribute on 2nd-gen element → expect warn about unsupported disabled state.
  • VRT

    1. If CI reports visual diffs for status light, confirm expected vs golden; update golden hash only if intentional.

Device review

  • Desktop
  • (emulated) Mobile — spot-check Status light stories if VRT or layout concerns
  • (emulated) iPad — optional

Accessibility testing checklist

See Accessibility testing guide.

Status light is non-interactive (no focusable host behavior); content in the default slot supplies visible text. No change to role model intended.

  • Keyboard — No interactive host: tab through a page with status lights and confirm focus order is unchanged and no new focus traps.

    1. Open 2nd-gen Storybook → Status light Overview (or similar).
    2. Tab past surrounding controls; status light itself should not steal focus.
    3. Expect no regression vs previous behavior.
  • Screen reader — Confirm slotted label still reads as normal text content in context (e.g. VoiceOver on macOS over the Overview story).

    1. Open the same story.
    2. Navigate to the status light text.
    3. Expect the label to be announced with surrounding page semantics unchanged.

@rise-erpelding rise-erpelding added Component:Status light 2nd gen These issues or PRs map to our 2nd generation work to modernizing infrastructure. labels Apr 9, 2026
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Apr 9, 2026

⚠️ No Changeset found

Latest commit: c3bc530

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

@rise-erpelding rise-erpelding marked this pull request as ready for review April 9, 2026 14:02
@rise-erpelding rise-erpelding requested a review from a team as a code owner April 9, 2026 14:02
@rise-erpelding rise-erpelding added the Status:Ready for review PR ready for review or re-review. label Apr 9, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 9, 2026

📚 Branch Preview Links

🔍 First Generation 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-6157

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.

/**
/*
* @todo The S1 types can be removed once we are no longer maintaining 1st-gen.
* @todo Rename STATUSLIGHT_ prefix to STATUS_LIGHT_ to align with type prefix
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the rename, I did not add any deprecation notices... I thought given the current usage of 2nd-gen, it wasn't really necessary and would just add noise. But definitely could be added if that's something we want!

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that makes sense, not adding the deprecation notice on the name change.

Copy link
Copy Markdown
Collaborator

@marissahuysentruyt marissahuysentruyt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like there's probably 3 files that could get deleted! Maybe the branch just needs a rebase!

/**
/*
* @todo The S1 types can be removed once we are no longer maintaining 1st-gen.
* @todo Rename STATUSLIGHT_ prefix to STATUS_LIGHT_ to align with type prefix
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that makes sense, not adding the deprecation notice on the name change.

Comment on lines +81 to +83
export const STATUS_LIGHT_VARIANTS_S2 = [
...STATUS_LIGHT_VARIANTS_SEMANTIC_S2,
...STATUS_LIGHT_VARIANTS_COLOR_S2,
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now that 1st-gen and 2nd-gen are separated, can we remove or rename any of the types that have the S2 suffix? Do we even need the S1 types now?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't, but I didn't want to tangle with them right now, I'm hoping we can deal with this in SWC-1867. Good call-out!

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

agree with addressing in SWC-1867. this was an affect of the pivot and decoupling from 1st-gen

Comment thread .cursor/pr-description-swc-1671-progress-circle.md Outdated
Comment thread .cursor/swc-1671-status-light-work-plan.md Outdated
@rise-erpelding rise-erpelding force-pushed the rise-erpelding/swc-1671-status-light-code-style branch from 7052be4 to 464ed2e Compare April 9, 2026 15:54
Copy link
Copy Markdown
Contributor

@caseyisonit caseyisonit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

approving with s1 types clean up in SWC-1867

@caseyisonit caseyisonit added the Status:Ready for merge PR has 2 approvals, all tests pass, and is ready to merge label Apr 13, 2026
@caseyisonit caseyisonit merged commit e0d3061 into swc-1668/poc-components Apr 13, 2026
27 checks passed
@caseyisonit caseyisonit deleted the rise-erpelding/swc-1671-status-light-code-style branch April 13, 2026 19:20
cdransf pushed a commit that referenced this pull request Apr 14, 2026
* refactor: rename STATUSLIGHT to STATUS_LIGHT type

* refactor: reorg types file

* refactor: standardized debug warnings

* refactor: update jsdoc comments

---------

Co-authored-by: Casey Eickhoff <48574582+caseyisonit@users.noreply.github.com>
cdransf pushed a commit that referenced this pull request Apr 22, 2026
* refactor: rename STATUSLIGHT to STATUS_LIGHT type

* refactor: reorg types file

* refactor: standardized debug warnings

* refactor: update jsdoc comments

---------

Co-authored-by: Casey Eickhoff <48574582+caseyisonit@users.noreply.github.com>
cdransf pushed a commit that referenced this pull request Apr 23, 2026
* refactor: rename STATUSLIGHT to STATUS_LIGHT type

* refactor: reorg types file

* refactor: standardized debug warnings

* refactor: update jsdoc comments

---------

Co-authored-by: Casey Eickhoff <48574582+caseyisonit@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

2nd gen These issues or PRs map to our 2nd generation work to modernizing infrastructure. Component:Status light Status:Ready for merge PR has 2 approvals, all tests pass, and is ready to merge Status:Ready for review PR ready for review or re-review.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants