Skip to content

Conversation

aramos-adobe
Copy link
Contributor

Description

Creates AI-generated migration documentation to analyze component differences to guide SWC migration to S2, with human vetting. The documentation serves as a bridge between the migrated Spectrum 2 CSS work and the corresponding web components, in order to help engineers understand what needs to be implemented, updated, or aligned between the two systems to guide the development of 2nd generation web components.

This batch is for the barebones components:

  • Avatar
  • Opacity checkerboard
  • Swatch + Swatch group
  • Thumbnail

Motivation and context

  • Clear development roadmap: Provides comprehensive feature gap analysis for building 2nd generation web components
  • Implementation requirements: Identifies all features and capabilities that need to be implemented to match Spectrum 2 CSS and design specs
  • Breaking change transparency: Establishes implementation requirements and design changes that may lead to breaking changes and/or API changes for the next major version
  • Adoption planning: Enables developers and consuming teams to plan for 2nd gen web component adoption and understand migration effort required

Related issue(s)

SWC-1221

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

Documentation Quality

  • All files follow template structure with proper collapsible sections
  • CSS => SWC mapping tables use correct status values
  • Summary sections are concise and actionable
  • No broken markdown syntax

Cross-Reference Accuracy

  • CSS selectors match actual metadata.json files
  • SWC attributes match actual TypeScript source files
  • DOM structure comparisons match template files
  • Implementation gaps are complete and accurate

@aramos-adobe aramos-adobe requested a review from a team as a code owner September 18, 2025 04:38
Copy link

changeset-bot bot commented Sep 18, 2025

⚠️ No Changeset found

Latest commit: c5f8345

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

@aramos-adobe aramos-adobe changed the title Aramos-adobe/swc1221-component-analysis-docs chore(docs): 2nd gen component analysis for avatar, opacity checkerboard, swatch + swatchgroup, thumbnail Sep 18, 2025
@aramos-adobe aramos-adobe self-assigned this Sep 18, 2025
Copy link
Contributor

github-actions bot commented Sep 18, 2025

📚 Branch Preview

🔍 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-5740

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.

Copy link
Contributor

Tachometer results

Currently, no packages are changed by this PR...

Copy link
Collaborator

@rise-erpelding rise-erpelding left a comment

Choose a reason for hiding this comment

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

Left some comments! We'll definitely want to fill in the Resources sections here, plus review some of the callouts that the docs are making for accuracy!


<details>
<summary>Attributes</summary>

Copy link
Collaborator

Choose a reason for hiding this comment

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

Is disabled missing from this list? I know it's listed as a gap below, but it looks like you can actually make the avatar disabled:

https://opensource.adobe.com/spectrum-web-components/storybook/index.html?path=/story/avatar--disabled

Copy link
Collaborator

Choose a reason for hiding this comment

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

Good catch- some of the components must inherit properties too. Like on the docs site, avatar has TON of properties, but they all sort of sound like link properties.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yes, it does look like a lot of these are from link, so it might be overkill to include all of them.

image

It might be nice though to include the ones that are more relevant, like disabled, since it's popping up in the table in the "CSS => SWC mapping" section as "not implemented" and it's called out as an implementation gap in the summary section at the bottom, but I can see the disabled avatar in Storybook

Comment on lines 254 to 259
| `.spectrum-Thumbnail.is-disabled` | `disabled` attribute | Missing from WC |
| `.spectrum-Thumbnail.is-focused` | Focus state | Missing from WC |
| `.spectrum-Thumbnail.is-selected` | `selected` attribute | Missing from WC |
| `.spectrum-Thumbnail:before` | Pseudo-element styling | Missing from WC |
| `.spectrum-Thumbnail:after` | Pseudo-element styling | Missing from WC |
| `.spectrum-Thumbnail-layer:before` | Pseudo-element styling | Missing from WC |
Copy link
Collaborator

Choose a reason for hiding this comment

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

Let's take another look at these before we label them as potential gaps or new features that SWC needs to add, I know for sure that disabled does appear to exist in SWC, but some of the other states/pseudo-classes might actually be implemented. Might be worth comparing spectrum-css/components/thumbnail/index.css to spectrum-web-components/packages/thumbnail/src/spectrum-thumbnail.css and other SWC CSS files as well.

@marissahuysentruyt marissahuysentruyt self-assigned this Sep 23, 2025
@castastrophe castastrophe force-pushed the aramos-adobe/swc1221-component-analysis-docs branch from 2917769 to aaf1582 Compare September 24, 2025 18:41
@castastrophe castastrophe force-pushed the aramos-adobe/swc1221-component-analysis-docs branch 2 times, most recently from 31017a0 to 152b6af Compare September 24, 2025 20:27
@castastrophe castastrophe force-pushed the aramos-adobe/swc1221-component-analysis-docs branch from 152b6af to c5f8345 Compare September 24, 2025 20:31

<details>
<summary>Attributes</summary>

Copy link
Collaborator

Choose a reason for hiding this comment

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

Good catch- some of the components must inherit properties too. Like on the docs site, avatar has TON of properties, but they all sort of sound like link properties.

```html
<!-- With link -->
<a id="link" class="link" href="[href]">
<img class="image" alt="[label]" src="[src]" />
Copy link
Collaborator

Choose a reason for hiding this comment

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

oh I love how this showcases where the props go!

| `.spectrum-Avatar-image` | `src` attribute | Implemented |
| `.spectrum-Avatar-link` | `href` attribute | Implemented |
| `.is-focused` | Focus state | Implemented |
| `.is-disabled` | `disabled` attribute | Missing from WC |
Copy link
Collaborator

Choose a reason for hiding this comment

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

oh yeah, I think Rise mentioned we could mark the disabled attribute as Implemented.


## Summary of changes

### CSS => SWC implementation gaps
Copy link
Collaborator

Choose a reason for hiding this comment

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

oh! There's a follow up ticket for avatar with some newly added default gradient background support. Should we call out that there's more to this component that isn't supported by CSS yet either?

Just thinking out loud- when would that work be done? Separately from the SWC migration to S2? Like a follow up once avatar has migrated?


```html
<!-- Used as a utility class in other components -->
<div class="opacity-checkerboard [variant]">
Copy link
Collaborator

Choose a reason for hiding this comment

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

What would one of the variant options be? Like fill (which I saw in the swatch story)?


### CSS Spectrum 2 changes

No significant structural changes between CSS main and spectrum-two branches. The templates are identical, indicating that the swatch group component structure remains consistent across Spectrum 2 migration. Swatch group includes a setting for single or multiple selection and it might be worth connecting with design to see if there should be any unique styles designed that differentiates single or multi-select swatch groups.
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm not sure where this information would be most helpful, but could we add a short description of why the border prop for swatch group is getting deprecated for SWC S2?

If I'm remembering correctly, the border used to be applied per-swatch within a swatch group (as in- low-contrast swatches would get the light border, while higher contrast swatches didn't need a border). Design decided that they wanted borders on all swatches for S2, however. The only exception looks like the addSwatch.


<!-- With background -->
<div
class="spectrum-Thumbnail spectrum-Thumbnail--cover spectrum-Thumbnail-layer is-selected is-disabled is-focused spectrum-Thumbnail--size500"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is this background example supposed to have the layer class still?

Copy link
Collaborator

Choose a reason for hiding this comment

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

🤔


<!-- Default -->
<div
class="spectrum-Thumbnail spectrum-Thumbnail--cover spectrum-Thumbnail-layer is-selected is-disabled is-focused spectrum-Thumbnail--size500"
Copy link
Collaborator

Choose a reason for hiding this comment

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

same here- I assume the layer class needs to be removed.

Comment on lines +164 to +167
<div
class="spectrum-Thumbnail-background"
style="background-color: [backgroundColor]"
></div>
Copy link
Collaborator

Choose a reason for hiding this comment

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

And then this gets removed from the Default example markup too, I assume?


**CSS features missing from Web Component:**

- Disabled state support (`.is-disabled`)
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think disabled is supported in SWC! It's not on the API table, though.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I wonder how that happened... it looks like focus and selected are supported as well.


<details>
<summary>Attributes</summary>

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yes, it does look like a lot of these are from link, so it might be overkill to include all of them.

image

It might be nice though to include the ones that are more relevant, like disabled, since it's popping up in the table in the "CSS => SWC mapping" section as "not implemented" and it's called out as an implementation gap in the summary section at the bottom, but I can see the disabled avatar in Storybook


- [CSS migration](https://github.com/adobe/spectrum-css/pull/3394)
- [Spectrum 2 preview](https://spectrumcss.z13.web.core.windows.net/pr-2352/index.html?path=/docs/components-opacity-checkerboard--docs)
- [React](https://react-spectrum.adobe.com/s2/index.html?path=/docs/colorslider--docs) (not a standalone component, but styles are used by the color slider)
Copy link
Collaborator

Choose a reason for hiding this comment

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

not a standalone component, but styles are used by the color slider

Love this clarification, will be borrowing this for other components if it comes up.


<details>
<summary>Modifiers</summary>
<summary>Modifiers *deprecated*</summary>
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do you think it's time to think about taking the modifiers sections out of this documentation? Or could they potentially have some value in staying?


<details>
<summary>Attributes</summary>

Copy link
Collaborator

Choose a reason for hiding this comment

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

But noting that it's not called out as missing in the summary or table like it is for avatar, which is good

Comment on lines +140 to +141
<!-- Disabled icon SVG when disabled -->
<!-- Mixed value icon when mixed-value -->
Copy link
Collaborator

Choose a reason for hiding this comment

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

Still an open question, not a blocker though, just a curiosity!


### CSS Spectrum 2 changes

There is a new add swatch functionality in the `spectrum-two` branch and supplemental state and pseudo-element styling selectors in the `spectrum-two` branch which will automatically be applied when consumed by the web component for Spectrum 2.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Just a nit to make the name of the feature stand out more. This seems to align with Adobe's grammar & mechanics guidelines although I do see other examples on the page where they're using quotes or italics.

Suggested change
There is a new add swatch functionality in the `spectrum-two` branch and supplemental state and pseudo-element styling selectors in the `spectrum-two` branch which will automatically be applied when consumed by the web component for Spectrum 2.
There is a new **add swatch** functionality in the `spectrum-two` branch and supplemental state and pseudo-element styling selectors in the `spectrum-two` branch which will automatically be applied when consumed by the web component for Spectrum 2.

<details>
<summary>Attributes</summary>

- `border` (string) - Border style: 'light', 'none' **deprecated** (from Swatch component)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Yep, as mentioned with Swatch the borders are more transparent when in the group.


<!-- With background -->
<div
class="spectrum-Thumbnail spectrum-Thumbnail--cover spectrum-Thumbnail-layer is-selected is-disabled is-focused spectrum-Thumbnail--size500"
Copy link
Collaborator

Choose a reason for hiding this comment

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

🤔

Comment on lines +265 to +267
| `.is-disabled` | `disabled` attribute | Missing from WC |
| `.is-focused` | Focus state | Missing from WC |
| `.is-selected` | `selected` attribute | Missing from WC |
Copy link
Collaborator

Choose a reason for hiding this comment

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

It looks like these states do exist in SWC


**CSS features missing from Web Component:**

- Disabled state support (`.is-disabled`)
Copy link
Collaborator

Choose a reason for hiding this comment

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

I wonder how that happened... it looks like focus and selected are supported as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants