Skip to content

feat(icon)!: port to <pf-v6-icon> - #3164

Draft
bennypowers wants to merge 2 commits into
staging/pfv6from
feat/pfv6-icon
Draft

bennypowers wants to merge 2 commits into
staging/pfv6from
feat/pfv6-icon

Conversation

@bennypowers

Copy link
Copy Markdown
Member

What I did

Ports the icon element to PatternFly v6 designs and the React Icon component's API, per #3014.

  • Sizes: sm through 3xl, body sizes, and heading sizes; icon-size sizes the icon within its container
  • status attribute for semantic status colors, inline to inherit surrounding text size and color
  • in-progress attribute and progress slot swap the icon for a spinner without shifting surrounding content
  • mirror-rtl mirrors the icon in RTL languages (verified in Chromium and Firefox)
  • accessible-label exposes a labelled image; otherwise the icon is decorative and hidden from assistive technology, including while in progress
  • Resolver API carried over from v5: addIconSet, resolve, reset, load and error events (now consistently non-bubbling)

Bugs fixed relative to the v5 element:

  • Changing the set attribute now re-resolves the icon
  • The icon attribute no longer sprouts on unconfigured instances
  • The dark-theme warning status color matches the v6 token chain (yellow-30, verified against the React component)
  • mirror-rtl now applies in Firefox as well as Chromium
  • Decorative icons are reliably hidden from assistive technology (aria-hidden uses valid string values)
  • While labelled and in progress, the spinner's announcement is no longer flattened by the img role

Also fixes PfeDemoPage demo-route navigation for pf-v6-* elements (previously navigated to 404s or to a v5 element's demos), and reworks the two web-component-specific demos to work on cem serve without unmapped dependencies.

Testing Instructions

  1. npm run dev, then open http://localhost:8000/components/v6-icon/demo/?rendering=chromeless
  2. npx wtr elements/pf-v6-icon/test/pf-v6-icon.spec.ts (39 tests)
  3. PW_EXPERIMENTAL_TS_ESM=1 npx playwright test elements/pf-v6-icon (snapshot and SSR)
  4. Compare demos against https://www.patternfly.org/components/icon (computed sizes and colors verified to match in both color schemes)

Notes to Reviewers

  • Demos using the patternfly icon set show a curated icon list; new v6 pficons (severity icons, treeview, multicluster) land once Release v2.0.0: regenerate patternfly icon set from PatternFly v6 sources icons#29 ships v2 of @patternfly/icons, which this element's patternfly set demos depend on
  • React's progressIconSize and defaultProgressArialabel are intentionally not ported; the README documents the web-component equivalents (spinner diameter custom property and progress slot)
  • Review checklists run: API, a11y (Chrome and Firefox), and demos

🤖 Generated with Claude Code

cem serve routes pf-v5-* elements at /components/{name}/demo but pf-v6-*
elements at /components/v6-{name}/demo. The slug derivation previously
stripped every version prefix, so v6 elements navigated to 404s, or to a
v5 element's demos on tag collisions (for example pf-v6-icon resolved to
the pf-v5-icon demo index), making their e2e snapshot tests pass
vacuously.

Strip only the pf- prefix and the v5- version prefix so that v6 tags keep
their v6- route segment.

Assisted-By: Claude Code <noreply@anthropic.com>
Ports the icon element to PatternFly v6 designs and the React Icon
component's API. pf-v5-icon remains available while the remaining v5
elements port over.

Element API:

- sizes: sm through 3xl, plus body and heading text sizes
- icon-size attribute to size the icon independently of its container
- status attribute for semantic status colors
- inline attribute to inherit the surrounding text's size and color
- in-progress attribute and progress slot, swapping the icon for a
  spinner (or slotted element) without shifting surrounding content
- mirror-rtl attribute to mirror the icon in right-to-left languages
- accessible-label attribute, exposing the icon as a labelled image;
  without it the icon is decorative and hidden from assistive
  technology, including while in progress
- loading attribute controls eager, idle, or lazy (default) fetching

Fixes carried over from the v5 element:

- changing the set attribute now re-resolves the icon
- the icon attribute no longer sprouts on unconfigured instances
- the mirror-rtl rule matches in both Chromium and Firefox

Assisted-By: Claude Code <noreply@anthropic.com>
@changeset-bot

changeset-bot Bot commented Oct 13, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 8862d4e

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@patternfly/elements Major

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@coderabbitai

coderabbitai Bot commented Oct 13, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

@github-actions

Copy link
Copy Markdown
Contributor

✅ Commitlint tests passed!

More Info
{
  "valid": true,
  "errors": [],
  "warnings": [],
  "input": "feat(icon)!: port to `<pf-v6-icon>`"
}

@github-actions

Copy link
Copy Markdown
Contributor

✅ Deploy Preview for patternfly-elements ready!

Name Link
🔨 Latest commit 18f4f8c
😎 Deploy Preview https://deploy-preview-3164--patternfly-elements.netlify.app/

To edit notification comments on pull requests, go to your Netlify site settings.

@github-actions github-actions Bot added the AT passed Automated testing has passed label Oct 13, 2026
@github-actions

Copy link
Copy Markdown
Contributor

SSR Test Run for 18f4f8c: Report

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AT passed Automated testing has passed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant