Skip to content

Conversation

rise-erpelding
Copy link
Collaborator

@rise-erpelding rise-erpelding commented Sep 18, 2025

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: Textfield/Textarea, Number field, Search, and Color field (which does not exist in CSS or S2 design spec)

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-1208

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

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

Device review

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

@rise-erpelding rise-erpelding requested a review from a team as a code owner September 18, 2025 15:45
Copy link

changeset-bot bot commented Sep 18, 2025

⚠️ No Changeset found

Latest commit: 84b4d69

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 force-pushed the rise-erpelding/swc-1208-component-analysis-docs branch from 830facd to 2c217ea Compare September 18, 2025 15:48
@rise-erpelding rise-erpelding 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-5741

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

@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.

I feel like I've been holding onto a bunch of comments so...here come a flood! I have to go through the text field file, but that one was just so long and I didn't want to hold these up.

Copy link
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.

Leaving the remainder for textfield.


- **Label position**: This is controlled by field label in SWC, but controlled by textfield in CSS
- **Character count**: SWC doesn't currently support a visible character count that would track the number of characters within the text field
- **Keyboard focus state**: CSS has slightly different styling for focused vs. keyboard-focused state (keyboard focus shows the blue outline, mouse focus does not), this distinction is not visible in the current SWC implementation
Copy link
Collaborator

Choose a reason for hiding this comment

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

oh great callout here about the differences between focused and keyboard-focused!


### Common issues to watch for

- **Branch confusion**: AI may analyze wrong branches or mix up repositories
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I love AI writing and summarizing all the things that AI might not be able to do here 😆

@rise-erpelding rise-erpelding force-pushed the rise-erpelding/swc-1208-component-analysis-docs branch from a509ac1 to 268b194 Compare September 26, 2025 18:34
<details>
<summary>Diff: Legacy (CSS main) → Spectrum 2 (CSS spectrum-two)</summary>

```diff
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Happy to have any feedback on this numberfield diff... it's really unpleasant to look at, I think, because just about every line changes due to class name changes.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Could we preface the diff with something to the affect of: "Most of the diff below is due to the change in classname from .spectrum-Stepper to .spectrum-NumberField"?

Regarding the number field diff also- we could foreseeably add those --top and --bottom modifier classes to the legacy infield buttons, as well. They're in the legacy DOM example, just not in this portion with the markup diff. And speaking of infield buttons- the changes to infield button are also a big reason this diff looks so severe.

Just some thoughts.

Comment on lines 405 to 408
| | `action` | Missing from CSS |
| | `method` | Missing from CSS |
| | `holdValueOnEscape` | Missing from CSS |
| | `negative-help-text` slot | Missing from CSS |
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

"Missing from CSS" doesn't feel super valuable for our purposes, taking this out if no one is opposed.

Copy link
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.

I know I left a TON of comments, and everything is looking great! Thanks for all of your hard work on this! I only found a couple of really small things this time around! 🎉


- **CSS selectors**: All selectors from `metadata.json` in the spectrum-css `spectrum-two` branch
- **Passthroughs**: CSS passthrough properties
- **Modifiers**: CSS modifier classes
Copy link
Collaborator

Choose a reason for hiding this comment

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

I know the mods stuff is up in the air, but we've been listing the modifier custom properties as opposed to classes.

Comment on lines +38 to +42
**Inherited from SizedMixin:**

- `size` - Size of the color field (s, m, l, xl)

**Inherited from Focusable:**
Copy link
Collaborator

Choose a reason for hiding this comment

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

I love the reorganization of all of this information you and Cassondra have done 😍

+ Label Text
+ </label>
<span class="spectrum-Textfield-characterCount">Character Count</span>
- <div class="spectrum-Icon spectrum-Icon--sizeM spectrum-Textfield-validationIcon">
Copy link
Collaborator

Choose a reason for hiding this comment

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

If we're trying to be accurate, we should probably remove this div since it's not in the legacy markup.

I do love the .spectrum-Icon-spectrum class though 😆

<details>
<summary>Diff: Legacy (CSS main) → Spectrum 2 (CSS spectrum-two)</summary>

```diff
Copy link
Collaborator

Choose a reason for hiding this comment

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

Could we preface the diff with something to the affect of: "Most of the diff below is due to the change in classname from .spectrum-Stepper to .spectrum-NumberField"?

Regarding the number field diff also- we could foreseeably add those --top and --bottom modifier classes to the legacy infield buttons, as well. They're in the legacy DOM example, just not in this portion with the markup diff. And speaking of infield buttons- the changes to infield button are also a big reason this diff looks so severe.

Just some thoughts.

@@ -0,0 +1,174 @@
# Spectrum 2 migration roadmap

This directory contains comprehensive migration documentation for 2nd generation Spectrum Web Components based on the implementation of Spectrum 2 components that were previously migrated in [Spectrum CSS](https://github.com/adobe/spectrum-css/tree/spectrum-two). It helps engineers understand what needs to be implemented, updated, or aligned between the two systems to guide development of 2nd generation web components.
Copy link
Contributor

Choose a reason for hiding this comment

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

Love this! Fantastic summary of the work being done here. 🕺


- **CSS selectors**: All selectors from `metadata.json` in the spectrum-css `spectrum-two` branch
- **Passthroughs**: CSS passthrough properties
- **Modifiers**: CSS modifier classes
Copy link
Contributor

Choose a reason for hiding this comment

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

Might be good to also flag that these are deprecated in S2 (so this information is mostly for migration guide purposes).

- **CSS selectors**: All selectors from `metadata.json` in the spectrum-css `spectrum-two` branch
- **Passthroughs**: CSS passthrough properties
- **Modifiers**: CSS modifier classes
- **SWC attributes**: Properties with `@property` decorators in TypeScript
Copy link
Contributor

Choose a reason for hiding this comment

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

Tiny nit, these can also be handled using getters and setters (@property is an alias for a simple getter and setter pattern).

- **Passthroughs**: CSS passthrough properties
- **Modifiers**: CSS modifier classes
- **SWC attributes**: Properties with `@property` decorators in TypeScript
- **SWC slots**: Slot patterns from render methods
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we list out nested components too? Ones that exist in the component's shadow DOM? That might give us a good sense of in what order we should be migrating components.


- CSS selectors (collapsible)
- Passthroughs (collapsible)
- Modifiers (collapsible)
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
- Modifiers (collapsible)
- Modifiers **deprecated** (collapsible)


### CSS

- CSS selectors (collapsible)
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we highlight the updated approach we've been doing of grouping selectors into elements, states, and variants?

- Spectrum 2 CSS spectrum-two branch (collapsible)
- Diff: Legacy → Spectrum 2, based on changes made to template in CSS migration work (collapsible, if changes exist)

### CSS => SWC mapping
Copy link
Contributor

Choose a reason for hiding this comment

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

🕺 Love this table; I think it's going to be really critical as we being our component migration efforts in earnest.


### CSS => SWC implementation gaps

### CSS Spectrum 2 changes
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we add a note somewhere that some of this information might be summarized in the component's changelog in the spectrum-two branch?


## How to generate documentation

### Prerequisites
Copy link
Contributor

Choose a reason for hiding this comment

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

LOVE! Thanks for adding this.

- `spectrum-css` (primarily `spectrum-two` branch, with comparisons to `main`)
- `spectrum-web-components` (`main` branch)

### Using the cursor prompt
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's add a suggestion here for what models to use. This type of work is better handled by the slower but more advanced thinking models like Claude or gpt-5

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.

3 participants