Skip to content

fix(Switch): hardening — swarm findings - #768

Merged
josephfarina merged 4 commits into
mainfrom
navi/hardening/switch
Mar 23, 2026
Merged

fix(Switch): hardening — swarm findings#768
josephfarina merged 4 commits into
mainfrom
navi/hardening/switch

Conversation

@josephfarina

@josephfarina josephfarina commented Mar 20, 2026

Copy link
Copy Markdown
Contributor

Hardening: Switch (#718)

Fixes from swarm audit: reduced-motion media query, isBusy guard, description typography, xdsClassName variants, layout centering fix.

Changes

  • container: alignItems: center (was flex-start)
  • labelWrapper: removed marginTop: 3 hack, added justifyContent: center + minHeight: SWITCH_HEIGHT
  • Trimmed implementation-detail tests (xdsClassName, console.warn, pointerEvents bypass)
  • Added reduced-motion, isBusy onChange guard, description lineHeight/fontWeight

Screenshots

Story Screenshot
Default default
On on
With Description with-description
With Label Icon with-label-icon
Label Start label-start
Spread spread
Disabled disabled
Disabled On disabled-on
Error Status error-status
Success Status success-status
Warning Status warning-status
All Variations all-variations

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Mar 20, 2026
@josephfarina
josephfarina force-pushed the navi/hardening/switch branch from e497bd3 to 69a87bc Compare March 23, 2026 19:18
@josephfarina
josephfarina marked this pull request as ready for review March 23, 2026 21:54
@josephfarina
josephfarina requested a review from cixzhang as a code owner March 23, 2026 21:54
@github-actions

github-actions Bot commented Mar 23, 2026

Copy link
Copy Markdown
Contributor

PR Analysis Report

📚 Storybook Preview

View Storybook for this PR
GitHub Pages may take up to a minute to hydrate after deploy.

🧪 Sandbox Preview

View Sandbox for this PR
GitHub Pages may take up to a minute to hydrate after deploy.

Modified Components

Switch · View in Storybook
Metric Before After Delta
Bundle Size (ESM) N/A 490B N/A
Lines of Code N/A 356 -
Complexity N/A Very High (37) -

Bundle Size Summary

Package Size (ESM) Size (CJS) Gzipped
@xds/core 11.0KB 17.6KB 2.7KB

Accessibility Audit

Status: No accessibility violations detected.


Generated by PR Enrichment workflow | Storybook | Sandbox | View full report

@josephfarina
josephfarina merged commit 1627470 into main Mar 23, 2026
13 checks passed
@cixzhang
cixzhang deleted the navi/hardening/switch branch April 9, 2026 14:33
cixzhang pushed a commit that referenced this pull request Apr 26, 2026
* fix(Switch): hardening — swarm findings

* fix(Switch): swarm fixes — verified findings

* fix(Switch): center label block and trim noisy tests

* fix(Switch): remove process.env check (no @types/node in CI)

---------

Co-authored-by: Joey Farina <joeyfarina@fb.com>
cixzhang pushed a commit that referenced this pull request Jun 21, 2026
* fix(Switch): hardening — swarm findings

* fix(Switch): swarm fixes — verified findings

* fix(Switch): center label block and trim noisy tests

* fix(Switch): remove process.env check (no @types/node in CI)

---------

Co-authored-by: Joey Farina <joeyfarina@fb.com>
cixzhang pushed a commit that referenced this pull request Jun 21, 2026
* fix(Switch): hardening — swarm findings

* fix(Switch): swarm fixes — verified findings

* fix(Switch): center label block and trim noisy tests

* fix(Switch): remove process.env check (no @types/node in CI)

---------

Co-authored-by: Joey Farina <joeyfarina@fb.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant