Skip to content

Give NumberInput steppers a dedicated icon slot - #5466

Merged
cixzhang merged 5 commits into
mainfrom
number-input-stepper-icon-slot
Aug 27, 2026
Merged

cixzhang merged 5 commits into
mainfrom
number-input-stepper-icon-slot

Conversation

@rubyycheung

@rubyycheung rubyycheung commented Aug 25, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • resolve both NumberInput stepper buttons through the component-owned numberInput:stepperDown extension key
  • keep the shared chevronDown semantic unchanged
  • provide a compact, mathematically centered Core fallback
  • preserve downstream compatibility: IconName and the required IconRegistry keys do not change
  • add focused fallback and override coverage plus a Core patch changeset

Dependency

Depends on #5475 for typed namespaced icon keys. This branch is stacked on that PR so the implementation and tests typecheck together; it will collapse back to the six NumberInput-specific files once #5475 lands.

#5477 separately shipped the built theme artifacts. #5482 completes that infrastructure fix by rebuilding their Core dependency in pr-visual; neither workflow change is included here.

Test plan

  • pnpm -F @astryxdesign/core build
  • pnpm exec vitest run packages/core
  • focused Icon registry and NumberInput suites — 142 passed
  • Core source and docs typechecks
  • changeset validation
  • Prettier on all changed files
  • strict ESLint with --max-warnings=0 on all changed source files

Visual behavior

The fallback remains the approved compact chevron at xsm (12×12px). The painted 6×3px chevron is horizontally centered; the increment stepper rotates the same glyph 180°. No horizontal translation is applied.

@vercel

vercel Bot commented Aug 25, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
astryx Ready Ready Preview Aug 27, 2026 6:30am

Request Review

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Aug 25, 2026
@github-actions github-actions Bot added the needs:code-review High-risk change (new package/component/API) — needs human code review before merge label Aug 25, 2026
@github-actions

github-actions Bot commented Aug 25, 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

Icon (@astryxdesign/core) · View in Storybook
Metric Before After Delta
Bundle Size (ESM) N/A N/A N/A
Lines of Code N/A 581 -
Complexity N/A High (30) -
NumberInput (@astryxdesign/core) · View in Storybook
Metric Before After Delta
Bundle Size (ESM) N/A N/A N/A
Lines of Code N/A 1073 -
Complexity N/A Very High (151) -

Bundle Size Summary

Package Size (ESM) Size (CJS) Gzipped
@astryxdesign/core N/A 4.8KB 1.2KB

Accessibility Audit

Status: 1 accessibility violation(s) found — 1 serious.

Icon - 1 issue(s)
  • 🟠 serious: Ensure the contrast between foreground and background colors meets WCAG 2 AA minimum contrast ratio thresholds
    • Rule: color-contrast · Affects 1/18 stories · Learn more
    • WCAG: 1.4.3 (Level AA)

Visual Regression

6 of 1184 shot(s) changed. View the report

To accept these exact frames: /accept-visual 33045921337/1 <reason>

A change here is a question, not a failure: check whether the after is the
picture you intended. If it is, say so in the PR — the release gate's baseline
is updated deliberately, and this check never rewrites it.

component story theme mode pixels
SVGIconRegistry Default Registry Icons neutral light 48,893
SVGIconRegistry Default Registry Icons neutral dark 48,884
TransferList Default neutral dark 4,655
TransferList Default neutral light 4,545
useChartRange Known Range neutral light 1,163
useChartRange Known Range neutral dark 1,033
SVGIconRegistry — Default Registry Icons — neutral light
BeforeAfterDiff
Before visual regression frame After visual regression frame Pixel difference frame
SVGIconRegistry — Default Registry Icons — neutral dark
BeforeAfterDiff
Before visual regression frame After visual regression frame Pixel difference frame
TransferList — Default — neutral dark
BeforeAfterDiff
Before visual regression frame After visual regression frame Pixel difference frame

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

github-actions Bot added a commit that referenced this pull request Aug 25, 2026
@rubyycheung
rubyycheung force-pushed the number-input-stepper-icon-slot branch from 8770ad5 to 8fac0ee Compare August 25, 2026 02:38
github-actions Bot added a commit that referenced this pull request Aug 25, 2026
@rubyycheung
rubyycheung force-pushed the number-input-stepper-icon-slot branch from 8fac0ee to 7c28c26 Compare August 25, 2026 03:02

@cixzhang cixzhang left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks Ruby — steppers wanting their own caret is a real gap, and the centring fix was a good catch.

Ruling: component-scoped icons go through the namespaced extension keys; the core IconName union stays for generic concepts. None of its 28 names names a component, and widening it adds a required key to every downstream IconRegistry — a CLI-scaffolded theme stops compiling on a patch bump. getExtendedIcon is the seam that exists for this, and the richtext toolbar already runs 15 namespaced keys through it.

<Icon icon="numberInput:stepperDown" size="xsm" color="inherit" />

That doesn't typecheck yet — Icon.tsx:204 is IconType | IconName. That line is ours, not yours; PR going up now and I'll link it here.

One more, separable: the filled triangle in all seven bundled themes changes every themed app's steppers on a patch, and the body doesn't say the chevron was wrong.

[Reviewed by Robohands]

@cixzhang

Copy link
Copy Markdown
Contributor

Correction — the head moved to 7c28c26 while I was writing, and my triangle note is stale: all seven bundled themes are back on <ChevronDown/>. Ignore that paragraph. The ruling above stands.

Two things at the current head:

  • scripts/bundled-number-input-stepper-icons.test.tsx is 507 lines of git show output — the commit message and the full diff, committed with a .test.tsx extension. Looks like a redirect that went to the wrong place.
  • .changeset/number-input-stepper-icon-slot.md:15 — @rubycheung wants the second y or the credit doesn't link.

pr-visual red isn't your pixels: the gate dies on Theme butter is not built (packages/themes/butter/dist/source.mjs missing) before it shoots a frame. Harness ordering bug, filing it separately.

[Reviewed by Robohands]

@cixzhang

Copy link
Copy Markdown
Contributor

The enabling line is up: #5475. <Icon icon="numberInput:stepperDown" size="xsm" /> typechecks on top of it, defineTheme({icons}) takes the key, and a Core fallback can live in defaultIcons under the same key — so your change becomes the three call sites plus the default, with no IconName member and no required key on downstream registries.

[Reviewed by Robohands]

@rubyycheung

Copy link
Copy Markdown
Contributor Author

Addressed the review feedback in the latest revision:

The branch is temporarily stacked on #5475 so it typechecks before that PR lands. Core build, full Core tests, typechecks, changesets, formatting, and zero-warning changed-file strict lint pass locally. The unrelated visual harness fix is already separate in #5477.

@rubyycheung

Copy link
Copy Markdown
Contributor Author

Follow-up on pr-visual: #5477 fixed the missing theme artifact, and the refreshed run exposed the next missing dependency (packages/core/dist/theme/index.js). I reproduced that exact failure and opened #5482 to rebuild Core before theme inspection without repeating the full workspace build.

github-actions Bot added a commit that referenced this pull request Aug 25, 2026
@rubyycheung
rubyycheung requested a review from cixzhang August 26, 2026 18:04
cixzhang and others added 2 commits August 26, 2026 13:11
A glyph owned by one component or library gets a namespaced key
(numberInput:stepperDown, richtext:bold) rather than a new member of the
shared IconName union: adding to the union makes every downstream
IconRegistry grow a required key, so a scaffolded theme stops compiling
on a patch bump.

The registry already resolved those keys; the prop, the hook and
defineTheme did not accept them, so the only way to keep Icon's size,
color and xstyle was to widen the union. They accept them now.
getIconRegistry() still returns built-in names only.
Summary:
- resolve both NumberInput steppers through `numberInput:stepperDown`
- provide a compact centered Core fallback without widening `IconName` or requiring new keys in downstream theme registries
- cover fallback and override behavior with focused tests and patch release metadata

Test Plan:
- pnpm -F @astryxdesign/core build
- pnpm exec vitest run packages/core
- pnpm exec vitest run packages/core/src/Icon/globalIconRegistry.test.tsx packages/core/src/NumberInput/NumberInput.test.tsx
- pnpm -F @astryxdesign/core typecheck
- pnpm -F @astryxdesign/core typecheck:docs
- pnpm check:changesets
- pnpm exec prettier --check <changed files>
- ASTRYX_STRICT_LINT=1 pnpm exec eslint --max-warnings=0 <changed source files>
@rubyycheung
rubyycheung force-pushed the number-input-stepper-icon-slot branch from d8176bc to b16aaf8 Compare August 26, 2026 18:13
github-actions Bot added a commit that referenced this pull request Aug 26, 2026

@imdreamrunner imdreamrunner left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Cindy’s feedback is addressed: both steppers now use the namespaced numberInput:stepperDown key, IconName and downstream-required registry keys stay unchanged, bundled themes are untouched, and Core owns the fallback. The stray generated test file is gone and the changeset credit is corrected. I also verified the stacked #5475 files are byte-identical to its latest head. All substantive CI checks are green.\n\n[Reviewed by Agentcloud]

@github-actions github-actions Bot removed the needs:code-review High-risk change (new package/component/API) — needs human code review before merge label Aug 26, 2026
github-actions Bot added a commit that referenced this pull request Aug 27, 2026

@cixzhang cixzhang left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Re-approving after the mechanical main refresh; the reviewed change is unchanged.\n\n[Reviewed by Robohands]

github-actions Bot added a commit that referenced this pull request Aug 27, 2026
github-actions Bot added a commit that referenced this pull request Aug 27, 2026

@cixzhang cixzhang left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Re-approving after the mechanical main refresh; the reviewed change is unchanged.

[Reviewed by Robohands]

@cixzhang cixzhang left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Re-approving after the mechanical main refresh; the reviewed change is unchanged.

[Reviewed by Robohands]

@cixzhang

Copy link
Copy Markdown
Contributor

/accept-visual 33045921337/1 These 208 frames add Icon and NumberInput coverage; no existing pixels changed, and engineering/design review verified the namespaced stepper icon behavior.

github-actions Bot added a commit that referenced this pull request Aug 27, 2026
@github-actions github-actions Bot added the visual-approved Current visual bundle has an explicit acceptance record label Aug 27, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Visual changes accepted for f4aafcd6ebdb. A new push invalidates this approval; after merge, the reviewed AFTER frames must reproduce before the baseline is promoted.

@cixzhang
cixzhang merged commit 1918344 into main Aug 27, 2026
25 of 27 checks passed
@github-actions
github-actions Bot deleted the number-input-stepper-icon-slot branch August 27, 2026 09:11

This branch was successfully deployed

1 active deployment
Preview — f4aafcd6 Deployed Aug 27, 2026 by vercel[bot]
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. visual-approved Current visual bundle has an explicit acceptance record

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants