Skip to content

Conversation

rise-erpelding
Copy link
Collaborator

@rise-erpelding rise-erpelding commented Oct 6, 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 components: Button, Button Group, Action Button, Action Group.

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

Screenshots (if appropriate)

N/A - Documentation only


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

Resources that might help when reviewing

Note: These urls are set for the button component.

Manual review test cases

Documentation Quality

Recommendation: It's probably easier to check out the files with proper markdown formatting. While you can change the display from source diff to rich diff within the PR, I prefer to look through the files on the branch

  • 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?

Copy link

changeset-bot bot commented Oct 6, 2025

⚠️ No Changeset found

Latest commit: 35c5f39

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 self-assigned this Oct 6, 2025
@rise-erpelding rise-erpelding added Documentation 2nd gen These issues or PRs map to our 2nd generation work to modernizing infrastructure. labels Oct 6, 2025
@rise-erpelding rise-erpelding changed the base branch from main to 2nd-gen-component-analysis October 6, 2025 19:57
@rise-erpelding rise-erpelding changed the title Rise erpelding/swc 1220 buttons migration docs docs(button, buttongroup, actionbutton, actiongroup): component analysis Oct 6, 2025
Copy link
Contributor

github-actions bot commented Oct 6, 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-5788

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.

@rise-erpelding rise-erpelding marked this pull request as ready for review October 6, 2025 19:59
@rise-erpelding rise-erpelding requested a review from a team as a code owner October 6, 2025 19:59
Copy link
Contributor

github-actions bot commented Oct 6, 2025

Tachometer results

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

### CSS => SWC implementation gaps

**Missing from WC:**
None. All CSS selectors have corresponding web component implementations.
Copy link
Member

Choose a reason for hiding this comment

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

Nit: should we remove this line break? ✨

Copy link
Member

@cdransf cdransf left a comment

Choose a reason for hiding this comment

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

Looks good! Just a few nits (feel free to ignore them 😅) ✨


### CSS => SWC implementation gaps

**Missing from WC:**
Copy link
Member

Choose a reason for hiding this comment

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

Same nit here ✨

```diff
--- Legacy (CSS main branch)
+++ Spectrum 2 (CSS spectrum-two branch)
@@ -1,18 +1,18 @@
Copy link
Member

Choose a reason for hiding this comment

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

Do we need this diff artifact? ✨

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.

Nice work on this! I think the only real "changes" necessary would be a correction in the progress circle size modifier class in the Button.md file, and maybe double checking the active attribute for button as well.

The rest of my comments are either non-blocking or just questions!

</button>
```
- `treatment` (values: `fill`, `outline`) - defaults to `fill`
- `quiet` - boolean property that maps to `treatment` (when true, sets `treatment="outline"`)
Copy link
Collaborator

Choose a reason for hiding this comment

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

I find this really strange to have a quiet property that just maps to a different property. Not that this is anything we can do about this now, but I do wonder why we even have this. Maybe something extends Button (that I can't find very quickly) and that thing needs quiet?

</div>
</button>
```
- `icon-only` - indicates button contains only an icon without visible label
Copy link
Collaborator

Choose a reason for hiding this comment

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

I guess I thought the button could be icon-only by just supplying an icon in the icon slot, but I see icon-only in the SWC storybook, along with the boolean binding in ButtonBase.

Speaking of ButtonBase- is there any particular migration things we would need to mention specifically for that file? That seems like it might be out-of-scope for us, but I was just curious.

| `a.spectrum-Button` | Link variant | Missing from WC |
| - | `pending-label` attribute | Missing from CSS |
| - | `quiet` property (deprecated) | Missing from CSS |
- `disabled` - disables the button
Copy link
Collaborator

Choose a reason for hiding this comment

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

There might also be an active state. That could potentially be for the link behaviors, though.

<span class="spectrum-Button-label">Label</span>

### Action Items for Web Component Maintainers
<!-- Icon can also appear after label when iconAfterLabel is true -->
Copy link
Collaborator

Choose a reason for hiding this comment

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

🤯 I didn't even know this arg existed. It's not in our story args!

**Required Additions:**
<!-- Progress Circle (when isPending is true) -->
<div
class="spectrum-ProgressCircle spectrum-ProgressCircle--sizeS spectrum-ProgressCircle--indeterminate"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Looks like main uses .spectrum-ProgressCircle--small instead of a nice t-shirt size.


```html
<div class="spectrum-ActionGroup spectrum-ActionGroup--sizeM">
<button class="spectrum-ActionButton spectrum-ActionGroup-item">...</button>
Copy link
Collaborator

Choose a reason for hiding this comment

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

This may be unnecessary, but should we show that the t-shirt size of the action group trickles down to the individual action buttons at all?

Both the CSS and SWC components already do this, so I'm good with leaving it off as it is, too.

```

</details>

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 I left a similar comment with button group- did we want to be super clear that CSS had no structural changes?

| `.spectrum-ActionGroup--justified .spectrum-ActionGroup-item` | Slotted buttons when `justified` | Implemented |
| `.spectrum-ActionGroup:not(.spectrum-ActionGroup--vertical, .spectrum-ActionGroup--compact) .spectrum-ActionGroup-item` | Slotted buttons in regular mode | Implemented |

**Note:** In CSS templates, `.spectrum-ActionGroup-item` is applied as a class to each child button. In SWC, the group uses `::slotted(*)` to style slotted action buttons without adding an additional class.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Nice! This note is a really great reminder. ❤️

| `.spectrum-ActionButton--sizeL` | `size="l"` | Implemented |
| `.spectrum-ActionButton--sizeXL` | `size="xl"` | Implemented |

#### Variants and treatments
Copy link
Collaborator

Choose a reason for hiding this comment

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

Love the attribute column here! This is what I was thinking of when I made that other comment in button! 😍

Comment on lines +370 to +376
#### WC-only attributes

| SWC attribute | CSS equivalent | Notes |
| ------------- | -------------- | --------------------------------------------- |
| `toggles` | N/A | Manages selected state automatically on click |
| `value` | N/A | Used for identification in action groups |
| `role` | N/A | Dynamic ARIA role management |
Copy link
Collaborator

Choose a reason for hiding this comment

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

This is a great idea- I might have to steal it 😊

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. Documentation ready-for-review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants