Skip to content

docs(dense): restore dropped Icon and Carousel dense/zh best-practice bullets - #4676

Merged
josephfarina merged 3 commits into
mainfrom
navi/docs/dense-coverage-icon-parity
Aug 7, 2026
Merged

docs(dense): restore dropped Icon and Carousel dense/zh best-practice bullets#4676
josephfarina merged 3 commits into
mainfrom
navi/docs/dense-coverage-icon-parity

Conversation

@josephfarina

@josephfarina josephfarina commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

What

Restore dropped translation-overlay best-practice bullets so astryx component <Name> --lang dense|zh renders the full guidance instead of silently falling back to English.

  • Icon (Icon.doc.mjs): docsDense was missing one bestPractices bullet (11 English vs 10 dense) after feat(lab): add composable RichTextEditorToolbar #4551 added registerIcons/getExtendedIcon guidance to the English docs only. Restored the bullet and straightened one em dash in the English bullet to a colon.
  • Carousel (Carousel.doc.mjs): feat(carousel): add hasLoop wrap-around and handleRef imperative control #4629 added a hasLoop bullet to the English bestPractices but not to docsDense or docsZh, so both overlays were one bullet short and dropped the hasLoop guidance. Restored it in both. Also backfilled a pre-existing missing built-in-navigation bullet in the zh overlay so it reaches full parity.

Both files now match English bullet count and per-position guidance flags. Verified with the dense-coverage audit (0 bullet drifts) and by rendering --lang dense and --lang zh for both components.

Checklist

  • pnpm --filter @astryxdesign/core typecheck:docs passes
  • tsc --project packages/cli/tsconfig.template-docs.json --noEmit passes
  • CLI --lang dense output verified for Icon and Carousel
  • CLI --lang zh output verified for Carousel
  • Bullet counts and guidance flags match English

Night Watch — Doc Reviewer

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Aug 3, 2026
@vercel

vercel Bot commented Aug 3, 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 6, 2026 6:14pm

Request Review

@github-actions

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

Carousel (@astryxdesign/core) · View in Storybook
Metric Before After Delta
Bundle Size (ESM) N/A N/A N/A
Lines of Code N/A 427 -
Complexity N/A Very High (48) -
Icon (@astryxdesign/core) · View in Storybook
Metric Before After Delta
Bundle Size (ESM) N/A N/A N/A
Lines of Code N/A 559 -
Complexity N/A High (28) -

Bundle Size Summary

Package Size (ESM) Size (CJS) Gzipped
@astryxdesign/core N/A 4.7KB 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)

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

Comment thread packages/core/src/Icon/Icon.doc.mjs Outdated
description: 'Icons are small visual symbols that represent actions, objects, or concepts. They improve scannability and reinforce meaning alongside text. Supports both direct SVG components and semantic icon names that adapt to the active theme.',
bestPractices: [
{ guidance: true, description: 'Use semantic icon names when available; they adapt to theme changes automatically.' },
{ guidance: true, description: 'Libraries can augment the icon map with their own keys: registerIcons({\'richtext:bold\': <MyIcon />}) accepts arbitrary keys (not just IconName). Resolve via getExtendedIcon(key, fallback), which prefers a theme-registered icon and falls back to a bundled default: the seam that makes library icons theme-overridable.' },

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.

The preferred way to do this is via theme

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Good call, and the code agrees with you: registerIcons() already warnOnces that defineTheme({ icons }) is the theme-scoped way to swap a glyph, so recommending the global registry as the seam for library icons contradicted our own runtime guidance.

Rewrote both the English and dense bullets to lead with defineTheme({icons}) (scoped to the active <Theme>, shallow-merged through extends) and reframed registerIcons() as an app-bootstrap escape hatch rather than a theming seam.

I kept it to what's on main today. Once #4647 lands, the slot mechanism (componentIcons + ComponentIconSlotMap augmentation) is the better answer for the library case specifically, and I'm happy to follow up with a bullet for that then. Also worth noting the same registerIcons-as-seam prose exists in RichTextEditor.doc.mjs and in the getExtendedIcon JSDoc if you want those cleaned up too.

@josephfarina
josephfarina force-pushed the navi/docs/dense-coverage-icon-parity branch from 85f2a8b to d57f4b5 Compare August 4, 2026 09:22
@josephfarina josephfarina changed the title docs(icon): restore dropped dense best practice and straighten em dash docs(dense): restore dropped Icon and Carousel dense/zh best-practice bullets Aug 4, 2026
github-actions Bot added a commit that referenced this pull request Aug 4, 2026
josephfarina and others added 3 commits August 6, 2026 11:08
The English Icon docs gained a best-practices bullet in #4551 covering
registerIcons/getExtendedIcon for library icon augmentation, but the
docsDense overlay was not updated to match. Because the dense overlay
merges by count and position, the missing bullet caused a silent 11-vs-10
parity gap: the dense CLI output dropped the augmentation guidance.

Add the compressed dense bullet at the matching position so
`astryx component Icon --lang dense` renders all 11 best practices with
the same guidance flags as English. Also straighten one em dash in the
English bullet to a colon per the doc prose style.

Found during Night Watch doc review.
The English bestPractices gained a hasLoop bullet in #4629 but neither
docsDense nor docsZh was updated, so both overlays fell one bullet short
and the CLI silently dropped the hasLoop guidance under --lang dense/zh.
Also backfill the pre-existing missing built-in-navigation bullet in the
zh overlay. Both overlays now match the English bullet count and per-position
guidance flags (8: 5 do, 3 don't).

Found during Night Watch doc review.
registerIcons() warns at runtime that defineTheme({icons}) is the
theme-scoped way to swap a glyph, so documenting the global registry as
the seam for library icons contradicted the library's own guidance.
Point both the English and dense best practices at the theme, and keep
registerIcons framed as an app-bootstrap escape hatch.

Co-authored-by: Cursor <cursoragent@cursor.com>
@josephfarina
josephfarina force-pushed the navi/docs/dense-coverage-icon-parity branch from d57f4b5 to 5c705bd Compare August 6, 2026 18:10
@josephfarina josephfarina reopened this Aug 7, 2026
github-actions Bot added a commit that referenced this pull request Aug 7, 2026
@josephfarina
josephfarina merged commit a522206 into main Aug 7, 2026
22 checks passed
@github-actions
github-actions Bot deleted the navi/docs/dense-coverage-icon-parity branch August 8, 2026 06:25
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.

2 participants