Skip to content

fix(clipboard-copy): update icons and verify tokens#8228

Merged
mcoker merged 9 commits intopatternfly:mainfrom
jcmill:fix/3642-clipboard-copy
Apr 1, 2026
Merged

fix(clipboard-copy): update icons and verify tokens#8228
mcoker merged 9 commits intopatternfly:mainfrom
jcmill:fix/3642-clipboard-copy

Conversation

@jcmill
Copy link
Copy Markdown
Contributor

@jcmill jcmill commented Mar 18, 2026

Summary

Update the Clipboard Copy component to use the correct copy icon and confirm token usage.

What changed

  • Clipboard Copy icon: Replaced the copy-button icon from copy to rh-ui-copy-fill across all Clipboard Copy examples so the component uses the intended design-system icon.
  • File updated: src/patternfly/components/ClipboardCopy/examples/ClipboardCopy.md — all button--icon="copy" references are now button--icon="rh-ui-copy-fill" (basic, expandable, inline compact, and all variants).

Fixes #8186

Verification

  • Token usage for the Clipboard Copy component has been verified and is correct.

Summary by CodeRabbit

  • New Features

    • Added read-only state styling support for the ClipboardCopy component with updated visual styling for read-only expandable content.
  • Documentation

    • Updated ClipboardCopy component examples with new icon names and documented the read-only state modifier and styling options.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Mar 18, 2026

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

Walkthrough

Updates ClipboardCopy component to replace the copy icon with rh-ui-copy-fill, introduces readonly state styling via new CSS variables and .pf-m-readonly modifier class for expandable content, and implements conditional readonly modifier rendering in the template.

Changes

Cohort / File(s) Summary
Documentation & Examples
src/patternfly/components/ClipboardCopy/examples/ClipboardCopy.md
Updated icon name from copy to rh-ui-copy-fill across all button instances (basic, expandable, inline, and code variants). Added clipboard-copy--IsReadonly="true" flag to read-only expandable examples. Added .pf-m-readonly documentation entry for readonly styling.
Component Styling
src/patternfly/components/ClipboardCopy/clipboard-copy.scss
Introduced two new CSS variables for readonly expandable content styling (--<clipboard-copy>--m-readonly__expandable-content--BackgroundColor and --<clipboard-copy>--m-readonly__expandable-content--BorderColor) mapped to read-only design tokens. Added .pf-m-readonly modifier to override expandable content background and border colors.
Component Template
src/patternfly/components/ClipboardCopy/clipboard-copy.hbs
Added conditional rendering of pf-m-readonly modifier class when clipboard-copy--IsReadonly parameter is true.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • patternfly/patternfly#8179 — Broader rh-ui icon name migration affecting multiple components' button icons, aligning with this PR's icon update.
  • patternfly/patternfly#8121 — Modifies ClipboardCopy expandable content token styling; directly related to the readonly expandable content styling changes in this PR.

Suggested labels

Needs design review

Suggested reviewers

  • mcoker
  • bekah-stephens
  • andrew-ronaldson
🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title follows conventional commit guidelines with 'fix' type and descriptive message about icon updates and token verification.
Linked Issues check ✅ Passed Changes align with issue #8186: icons updated from 'copy' to 'rh-ui-copy-fill', readonly token support added, and token usage verified.
Out of Scope Changes check ✅ Passed All changes relate to the linked issue objectives: icon replacement, readonly styling implementation, and token verification for ClipboardCopy component.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


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 and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@src/patternfly/components/ClipboardCopy/examples/ClipboardCopy.md`:
- Line 174: The button partial currently uses button--icon="rh-ui-copy-fill"
while its aria-label is "Run in web terminal", creating a semantic mismatch;
update the element so the visual icon and accessible label match by either
changing button--icon to a terminal/run icon (replace
button--icon="rh-ui-copy-fill" with the appropriate terminal icon name) or by
changing aria-label to a copy-focused text such as "Copy" to align with
button--icon="rh-ui-copy-fill" in the ClipboardCopy example.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro

Run ID: 2a90a36e-87d0-4781-a0cd-36b215128f93

📥 Commits

Reviewing files that changed from the base of the PR and between 25e0e19 and 7ea4b02.

📒 Files selected for processing (1)
  • src/patternfly/components/ClipboardCopy/examples/ClipboardCopy.md

@patternfly-build
Copy link
Copy Markdown
Collaborator

patternfly-build commented Mar 18, 2026

@jcmill
Copy link
Copy Markdown
Contributor Author

jcmill commented Mar 20, 2026

@bekah-stephens, quick question. I noticed the token used for the read-only background color was correct but the actually value was different from the figma file. Does that value need to be updated? It was the difference between something like a -200 and a -300.

Copy link
Copy Markdown

@bekah-stephens bekah-stephens left a comment

Choose a reason for hiding this comment

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

For the default state, the expanded area should use the default control tokens for the background and stroke colors.

Fill: global/background/color/control/default
Stroke: global/border/color/control/default

For the read-only state, the expanded area should use the read-only control tokens for the background and stroke colors.

Fill: global/background/color/control/read-only
Stroke: global/border/color/control/read-only

Image

@jcmill jcmill linked an issue Mar 23, 2026 that may be closed by this pull request
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@src/patternfly/components/ClipboardCopy/examples/ClipboardCopy.md`:
- Line 270: Fix the typo in the table row describing the expandable readonly
modifier: change "boarder" to "border" in the cell that mentions
`.pf-m-expandable-readonly` and `.pf-v6-c-clipboard-copy__expandable-content` so
the description reads "Modifies expandable content to match readonly form
control background and border."

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro

Run ID: 9fce8e53-2a4b-43a1-bc09-c970b430f507

📥 Commits

Reviewing files that changed from the base of the PR and between 7ea4b02 and 6817326.

📒 Files selected for processing (3)
  • src/patternfly/components/ClipboardCopy/clipboard-copy-expandable-content.hbs
  • src/patternfly/components/ClipboardCopy/clipboard-copy.scss
  • src/patternfly/components/ClipboardCopy/examples/ClipboardCopy.md
✅ Files skipped from review due to trivial changes (1)
  • src/patternfly/components/ClipboardCopy/clipboard-copy-expandable-content.hbs

Copy link
Copy Markdown
Contributor

@mcoker mcoker left a comment

Choose a reason for hiding this comment

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

Feature changes look good! Can you make a couple of small updates to the docs?

@jcmill jcmill requested review from bekah-stephens and mcoker March 27, 2026 13:24
Copy link
Copy Markdown
Contributor

@mcoker mcoker left a comment

Choose a reason for hiding this comment

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

Just a small syntax thing, but I would add clipboard-copy--IsReadonly="true" to the non-expandable example, too, even though it doesn't do anything at the moment. In react, we have a isReadOnly prop you apply to <ClipboardCopy /> so I'm thinking this class goes on any read-only clipboard copy component.

| `.pf-m-block` | `.pf-v6-c-clipboard-copy.pf-m-inline` | Modifies the inline copy clipboard component to have block formatting. |
| `.pf-m-truncate` | `.pf-v6-c-clipboard-copy.pf-m-truncate` | Modifies the inline copy clipboard component for use with text used in trucate component. |
| `.pf-m-expanded` | `.pf-v6-c-clipboard-copy` | Modifies the clipboard copy component for the expanded state. |
| `.pf-m-readonly` | `.pf-v6-c-clipboard-copy` | Modifies the clipboard copy component for read-only styles |
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.

Suggested change
| `.pf-m-readonly` | `.pf-v6-c-clipboard-copy` | Modifies the clipboard copy component for read-only styles |
| `.pf-m-readonly` | `.pf-v6-c-clipboard-copy` | Modifies the clipboard copy component for read-only styles. |

Copy link
Copy Markdown

@bekah-stephens bekah-stephens left a comment

Choose a reason for hiding this comment

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

It looks like there's something off with the collapsed editable field in dark mode (it doesn't match the editable expanded panel). It looks fine in light mode, though? (I marked the visually correct fields with green arrows)

Image Image

@bekah-stephens
Copy link
Copy Markdown

I'm not sure if it's easy for you to update this, but something small I noticed is that the content for the read-only example says "This is an editable version..." which is confusing on first glance. I think it would be good to make those examples say "This is a read-only version..."

image

@jcmill jcmill force-pushed the fix/3642-clipboard-copy branch from 4cdd568 to faeca7d Compare March 30, 2026 20:16
@jcmill jcmill requested a review from bekah-stephens March 30, 2026 20:45
@jcmill
Copy link
Copy Markdown
Contributor Author

jcmill commented Mar 30, 2026

@bekah-stephens, I did a rebase because the tokens looked wrong and that pretty much fixed everything. Also changed the copy for the read-only items.

Copy link
Copy Markdown

@bekah-stephens bekah-stephens left a comment

Choose a reason for hiding this comment

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

lgtm!

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.

Can you add the readonly class to this, too? Not sure if you saw it but I mentioned updating this in my last review comment here - #8228 (review)

Suggested change
{{#> clipboard-copy clipboard-copy--id="basic-readonly" clipboard-copy--IsReadonly="true"}}

Copy link
Copy Markdown
Contributor

@mcoker mcoker left a comment

Choose a reason for hiding this comment

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

🚀

@mcoker mcoker merged commit 4596bf8 into patternfly:main Apr 1, 2026
5 checks passed
@patternfly-build
Copy link
Copy Markdown
Collaborator

🎉 This PR is included in version 6.5.0-prerelease.64 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Clipboard copy: Update icons and verify token changes

4 participants