-
Notifications
You must be signed in to change notification settings - Fork 645
Revert "Remove deprecated underline prop from Link component" #7125
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Revert "Remove deprecated underline prop from Link component" #7125
Conversation
This reverts commit fb773ad.
|
|
👋 Hi, this pull request contains changes to the source code that github/github depends on. If you are GitHub staff, we recommend testing these changes with github/github using the integration workflow. Thanks! |
There was a problem hiding this 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 pull request re-introduces the deprecated underline prop to the Link component for backwards compatibility. The changeset indicates this was originally planned as a breaking change (removing the prop), but the PR reverses that decision.
Key Changes
- Added the deprecated
underlineprop back to the Link component with a deprecation notice - Updated CSS to support the
data-underlineattribute while maintaining inline link behavior - Added Storybook stories and visual regression tests for the underline feature
- Removed the changeset that documented the breaking change removal
Reviewed Changes
Copilot reviewed 8 out of 17 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| packages/react/src/Link/Link.tsx | Added back underline prop with deprecation warning and data-underline attribute |
| packages/react/src/Link/Link.module.css | Added CSS rule to style links when data-underline='true' with backwards compatibility comment |
| packages/react/src/Link/Link.stories.tsx | Added underline: false to playground args |
| packages/react/src/Link/Link.features.stories.tsx | Added Underline feature story demonstrating the prop |
| packages/react/src/Link/Link.docs.json | Added reference to the new Underline story in documentation |
| packages/react/src/Link/Link.dev.stories.tsx | Expanded dev stories to test various combinations of inline and underline props |
| e2e/components/Link.test.ts | Added visual regression test for the Underline story |
| .playwright/snapshots/.../Link-Dev-Inline-light-tritanopia-linux.png | Updated visual regression snapshot reflecting new test combinations |
| .changeset/swift-queens-smoke.md | Removed changeset file that documented the breaking change |
Comments suppressed due to low confidence (2)
packages/react/src/Link/Link.module.css:31
- The comment on line 27 states 'setting underline={false} does not override this' for inline links, but this behavior should be more clearly documented. The current implementation means
inlinelinks will always be underlined when the a11y setting is true, regardless of theunderlineprop value. This could be confusing for developers. Consider expanding the deprecation notice in the TypeScript prop definition to include this important caveat.
/* Deprecated: but need to support backwards compatibility */
&:where([data-underline='true']),
/*
Inline links (inside a text block), however, should have underline based on accessibility setting set in data-attribute
Note: setting underline={false} does not override this
*/
[data-a11y-link-underlines='true'] &:where([data-inline='true']) {
text-decoration: underline;
}
.changeset/swift-queens-smoke.md:1
- The entire changeset file is being deleted, which suggests this PR is reversing a planned breaking change. However, since the
underlineprop is being re-introduced as deprecated, a new changeset should be created documenting this change as a patch or minor version bump (depending on your versioning strategy) that explains the prop is being maintained for backwards compatibility. This ensures proper release notes and version tracking.
Uh oh!
There was an error while loading. Please reload this page.