style(status-light): clean up code styles#6157
style(status-light): clean up code styles#6157caseyisonit merged 5 commits intoswc-1668/poc-componentsfrom
Conversation
|
📚 Branch Preview Links🔍 First Generation Visual Regression Test ResultsWhen 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: If the changes are expected, update the |
| /** | ||
| /* | ||
| * @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 |
There was a problem hiding this comment.
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!
There was a problem hiding this comment.
I think that makes sense, not adding the deprecation notice on the name change.
marissahuysentruyt
left a comment
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
I think that makes sense, not adding the deprecation notice on the name change.
| export const STATUS_LIGHT_VARIANTS_S2 = [ | ||
| ...STATUS_LIGHT_VARIANTS_SEMANTIC_S2, | ||
| ...STATUS_LIGHT_VARIANTS_COLOR_S2, |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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!
There was a problem hiding this comment.
agree with addressing in SWC-1867. this was an affect of the pivot and decoupling from 1st-gen
7052be4 to
464ed2e
Compare
caseyisonit
left a comment
There was a problem hiding this comment.
approving with s1 types clean up in SWC-1867
…tatus-light-code-style
* 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>
* 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>
* 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>
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)STATUS_LIGHT_*(multi-word prefix per naming guide). No deprecatedSTATUSLIGHT_*re-exports (2nd-gen still preview).Badge.types.ts). AddStatusLightSizederived from valid sizes.update()beforesuper.update()(matchBadge.base.ts/ 17_debug-validation).warn()doc links use 2nd-gen Storybook (.../second-gen/?path=/docs/components-status-light--docs, same base asSECOND_GEN_URLinscripts/generate-llms-txt.js).SWC (
StatusLight.ts, stories)@property/@attributeon the concrete class for CEM parity (e.g. withProgressCircle.ts).classMap: keeptypeof this.variant !== 'undefined'for consistency with Badge.STATUS_LIGHT_*everywhere (e.g.Sizesstory usesSTATUS_LIGHT_VALID_SIZES).Out of scope (documented / deferred)
Motivation and context
Related issue(s)
Screenshots (if appropriate)
None expected (no intentional visual/CSS changes). If VRT diffs appear, confirm against Storybook.
Author's checklist
yarn test status-lightfrom2nd-gen/packages/swc).@spectrum-web-components/core/@adobe/spectrum-wcif applicable).Reviewer's checklist
patch,minor, ormajorAfter 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)
variantandsizebehave as before.DEBUG (optional, local dev)
window.__swc.DEBUGis on.varianton<swc-status-light>(e.g. unsupported string) → expect warn with message + link to second-gen docs.disabledattribute on 2nd-gen element → expect warn about unsupported disabled state.VRT
Device review
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.
Screen reader — Confirm slotted label still reads as normal text content in context (e.g. VoiceOver on macOS over the Overview story).