Skip to content

fix(Link): destructure muted prop to prevent unintentional DOM attribute leakage#7631

Open
Copilot wants to merge 8 commits intomainfrom
copilot/fix-muted-prop-leak
Open

fix(Link): destructure muted prop to prevent unintentional DOM attribute leakage#7631
Copilot wants to merge 8 commits intomainfrom
copilot/fix-muted-prop-leak

Conversation

Copy link
Contributor

Copilot AI commented Mar 6, 2026

  • Add test to validate muted is not present as a bare DOM attribute on Link
  • Add changeset (patch for @primer/react)

🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.

@changeset-bot
Copy link

changeset-bot bot commented Mar 6, 2026

🦋 Changeset detected

Latest commit: 71b05e4

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

This PR includes changesets to release 1 package
Name Type
@primer/react Patch

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

Co-authored-by: mattcosta7 <8616962+mattcosta7@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix muted prop leaking into DOM element fix(Link): destructure muted prop to prevent unintentional DOM attribute leakage Mar 6, 2026
Co-authored-by: mattcosta7 <8616962+mattcosta7@users.noreply.github.com>
@mattcosta7 mattcosta7 marked this pull request as ready for review March 6, 2026 05:38
@mattcosta7 mattcosta7 requested a review from a team as a code owner March 6, 2026 05:38
@mattcosta7 mattcosta7 requested review from Copilot and hectahertz March 6, 2026 05:38
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes a bug in the Link component where the muted prop was not destructured from restProps, causing it to leak as a bare HTML attribute on the DOM element. This could trigger React warnings about non-boolean attributes.

Changes:

  • Destructure muted from props alongside inline and hoverColor in Link.tsx, and reference the extracted variable for data-muted
  • Add a test assertion verifying the bare muted attribute is not present on the rendered DOM element

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
packages/react/src/Link/Link.tsx Destructures muted from props to prevent DOM attribute leakage; updates data-muted to use the extracted variable
packages/react/src/Link/__tests__/Link.test.tsx Adds assertion to existing "muted" test to verify the bare muted attribute is absent from the DOM

@github-actions github-actions bot added the integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm label Mar 6, 2026
@github-actions
Copy link
Contributor

github-actions bot commented Mar 6, 2026

⚠️ Action required

👋 Hi, this pull request contains changes to the source code that github/github-ui depends on. If you are GitHub staff, test these changes with github/github-ui using the integration workflow. Or, apply the integration-tests: skipped manually label to skip these checks.

@github-actions github-actions bot requested a deployment to storybook-preview-7631 March 6, 2026 19:31 Abandoned
@github-actions github-actions bot temporarily deployed to storybook-preview-7631 March 6, 2026 19:42 Inactive
Co-authored-by: mattcosta7 <8616962+mattcosta7@users.noreply.github.com>
@github-actions github-actions bot temporarily deployed to storybook-preview-7631 March 6, 2026 20:26 Inactive
@mattcosta7 mattcosta7 added this pull request to the merge queue Mar 9, 2026
@TylerJDev TylerJDev removed this pull request from the merge queue due to a manual request Mar 9, 2026
@github-actions github-actions bot temporarily deployed to storybook-preview-7631 March 9, 2026 03:15 Inactive
@mattcosta7 mattcosta7 enabled auto-merge March 9, 2026 13:30
@mattcosta7 mattcosta7 disabled auto-merge March 9, 2026 13:30
@mattcosta7 mattcosta7 added this pull request to the merge queue Mar 11, 2026
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Mar 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm integration-tests: skipped manually Changes in this PR do not require an integration test

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants