Skip to content

DX-1128: docs-native Icon component and direct HeroIcon usage (drop @ably/ui/core/Icon)#3411

Merged
jamiehenson merged 2 commits into
mainfrom
dx-1128/docs-local-icon
Jun 25, 2026
Merged

DX-1128: docs-native Icon component and direct HeroIcon usage (drop @ably/ui/core/Icon)#3411
jamiehenson merged 2 commits into
mainfrom
dx-1128/docs-local-icon

Conversation

@jamiehenson

@jamiehenson jamiehenson commented Jun 17, 2026

Copy link
Copy Markdown
Member

Part of DX-1128. Replaces @ably/ui/core/Icon with a docs-native Icon (src/components/Icon/).

What

  • index.tsx — the docs-native Icon, which now renders Ably's own glyphs only (product / social / tech / gui-prod / badge); set-unique-ids.ts (useId-keyed) rewrites gradient/mask ids per instance; null fallback for unknown names.
  • glyphs/ — those glyphs as typed .tsx forwardRef components + a generated index, produced by running @ably/ui's own SVGR pipeline (generate-icons.ts config) over its source SVGs. Byte-equivalent SVG output to the compiled originals — no visual change.
  • Heroicons are no longer resolved by name through Icon. Every former <Icon name="icon-gui-*-{outline,solid,mini,micro}"> is now a direct @heroicons/react component import at the call site, so they tree-shake. @heroicons/react promoted to a direct dep (outline/solid/mini/micro → 24/24/20/16).
  • Codemodded the direct heroicon call sites; Header/LanguageSelector tests updated to query by role/label (and the burger button gained an aria-label).

Behaviour

No visual change intended. Glyph coverage verified (no misses); Heroicons render identically as direct components.

Stack (DX-1128)

PR Role
#3409 Design foundation — vendor @ably/ui tokens + reset/core CSS (merged)
#3410 Local cn + heights utils
#3411 Docs-native Icon component (Ably glyphs only; Heroicons imported directly)
#3412 Presentational components (Badge, Button, LinkButton, FeaturedLink, Status)
#3413 Interactive components (SegmentedControl, TabMenu)
#3414 ProductTile + product data (leaf)
#3415 syntax-highlighter util + registry
#3416 Code + CodeSnippet — completes the lift; prunes dead CSS + drops @ably/ui Tailwind scan

#3410#3416 are a linear stack, each building on the previous; #3409 has merged to main. ▶ = this PR.

Testing

  • Load the review app.
  • Check a sufficient sample of pages load with no visual regressions.

🤖 Generated with Claude Code

@coderabbitai

coderabbitai Bot commented Jun 17, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 11777981-76c0-478c-8ba7-1cfabeeb6681

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch dx-1128/docs-local-icon

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@jamiehenson jamiehenson force-pushed the dx-1128/docs-local-cn-heights branch from 7048a5b to f52a3b3 Compare June 18, 2026 13:17
@jamiehenson jamiehenson force-pushed the dx-1128/docs-local-icon branch from 4c74691 to 8b2ecc6 Compare June 18, 2026 13:18
@jamiehenson jamiehenson marked this pull request as ready for review June 18, 2026 13:36
@jamiehenson jamiehenson force-pushed the dx-1128/docs-local-cn-heights branch from f52a3b3 to 501a8c3 Compare June 18, 2026 14:34
@jamiehenson jamiehenson force-pushed the dx-1128/docs-local-icon branch from 8b2ecc6 to 5d78500 Compare June 18, 2026 14:34
@jamiehenson jamiehenson added the review-app Create a Heroku review app label Jun 18, 2026
@ably-ci ably-ci temporarily deployed to ably-docs-dx-1128-docs--sdgyd3 June 18, 2026 14:54 Inactive
@jamiehenson jamiehenson force-pushed the dx-1128/docs-local-cn-heights branch from 501a8c3 to 3707061 Compare June 18, 2026 14:56
@jamiehenson jamiehenson force-pushed the dx-1128/docs-local-icon branch from 5d78500 to 7e2f701 Compare June 18, 2026 14:56
@ably-ci ably-ci temporarily deployed to ably-docs-dx-1128-docs--sdgyd3 June 18, 2026 14:57 Inactive
@jamiehenson jamiehenson force-pushed the dx-1128/docs-local-cn-heights branch from 3707061 to 8fec0bb Compare June 18, 2026 15:50
@jamiehenson jamiehenson force-pushed the dx-1128/docs-local-icon branch from 7e2f701 to 0fa1f37 Compare June 18, 2026 15:50
@ably-ci ably-ci temporarily deployed to ably-docs-dx-1128-docs--sdgyd3 June 18, 2026 15:50 Inactive
@jamiehenson jamiehenson marked this pull request as draft June 18, 2026 16:25
@jamiehenson jamiehenson force-pushed the dx-1128/docs-local-cn-heights branch from 8fec0bb to 7fe3b3c Compare June 23, 2026 13:25
@jamiehenson jamiehenson force-pushed the dx-1128/docs-local-icon branch from 0fa1f37 to 52d51ca Compare June 23, 2026 13:25
@ably-ci ably-ci temporarily deployed to ably-docs-dx-1128-docs--sdgyd3 June 23, 2026 13:26 Inactive
@jamiehenson jamiehenson temporarily deployed to ably-docs-dx-1128-docs--sdgyd3 June 23, 2026 14:11 Inactive
@jamiehenson jamiehenson force-pushed the dx-1128/docs-local-icon branch from 52d51ca to 6803b67 Compare June 23, 2026 16:51
@jamiehenson jamiehenson force-pushed the dx-1128/docs-local-cn-heights branch from 7fe3b3c to b94efdf Compare June 23, 2026 16:51
@jamiehenson jamiehenson temporarily deployed to ably-docs-dx-1128-docs--sdgyd3 June 23, 2026 16:51 Inactive
Base automatically changed from dx-1128/docs-local-cn-heights to main June 23, 2026 17:03
@jamiehenson jamiehenson marked this pull request as ready for review June 23, 2026 17:15
@jamiehenson jamiehenson changed the title DX-1128: docs-native Icon component (drop @ably/ui/core/Icon) DX-1128: docs-native Icon component and direct HeroIcon usage (drop @ably/ui/core/Icon) Jun 24, 2026
@jamiehenson jamiehenson force-pushed the dx-1128/docs-local-icon branch from 6803b67 to b724bbf Compare June 24, 2026 08:38
@jamiehenson jamiehenson temporarily deployed to ably-docs-dx-1128-docs--sdgyd3 June 24, 2026 08:38 Inactive

@kennethkalmer kennethkalmer left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Quick browse around the site showed nothing obviously broken, but botticus picked up some things to investigate when I asked it to review and cross-reference with the original code in @ably/ui

@kennethkalmer kennethkalmer left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Review focused on icon-name resolution after the switch to the docs-native Icon. One live regression (Footer feedback icons), plus a few sharp edges around silent null-rendering. Details inline.

Comment thread src/components/Layout/Footer.tsx
Comment thread src/components/Icon/index.tsx
Comment thread src/components/Icon/index.tsx
Comment thread src/components/Icon/index.tsx
Comment thread src/components/Icon/types.ts Outdated
…128)

Vendor a local Icon that renders only Ably's own glyphs (product, social,
tech, gui-prod). Heroicons are now imported directly from @heroicons/react
as components at each call site, so they tree-shake instead of going through
a name->component lookup that bundles the whole set. This keeps the custom
Icon's responsibility narrow and matches the direction for the rest of the
vendored components.
@jamiehenson

jamiehenson commented Jun 25, 2026

Copy link
Copy Markdown
Member Author

Thanks @kennethkalmer - the bot has done its responses but to summarise here, I've tightened up the type definition for the icons (tbh, I would like this to be as minimal as possible in future by leaning on HeroIcons more, but I'm already satisfied with the direction this PR goes in in terms of dethroning the overcomplicated Icon component) and pulled in something that was further down the stack but opened up a regression here.

@kennethkalmer kennethkalmer left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

All five review threads addressed and verified against the pushed code:

  • Footer feedback icons now hold direct Heroicon component refs (outline + solid), rendered directly — matches the codemod. (Confirmed dormant behind ENABLE_FEEDBACK, but right to fix.)
  • IconName narrowed to keyof typeof glyphs | icon-tech-${string}`` with the glyphs map closed via satisfies — static names now typecheck against the registry.
  • Dev-only console.warn on unresolved names covers the dynamic tail.
  • Social links carry aria-labels, so forced aria-hidden keeps accessible names intact.
  • Comment nit fixed.

LGTM.

@jamiehenson jamiehenson enabled auto-merge June 25, 2026 09:59
@jamiehenson jamiehenson temporarily deployed to ably-docs-dx-1128-docs--sdgyd3 June 25, 2026 09:59 Inactive
@jamiehenson jamiehenson merged commit 92c21a4 into main Jun 25, 2026
7 checks passed
@jamiehenson jamiehenson deleted the dx-1128/docs-local-icon branch June 25, 2026 10:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

review-app Create a Heroku review app

Development

Successfully merging this pull request may close these issues.

3 participants