-
Notifications
You must be signed in to change notification settings - Fork 602
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
feat: Introduce Tooltip to SegmentedControlIconButton #5679
Conversation
🦋 Changeset detectedLatest commit: c92f2d7 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
👋 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! |
size-limit report 📦
|
58d5f8a
to
d0c3f0a
Compare
3487280
to
0b6f964
Compare
<SegmentedControlIconButtonStyled | ||
aria-current={selected} | ||
// If description is provided, we will use the tooltip to describe the button, so we need to keep the aria-label to label the button. | ||
aria-label={description ? ariaLabel : undefined} |
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.
Since several of the props are the same in line 79-89 should we make a const
.
const rest = {
aria-current: selected,
sx: enabled ? undefined : getSegmentedControlButtonStyles({selected}),
className: clsx(enabled && classes.Button, enabled && classes.IconButton),
...rest
}
We could also add children ^.
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.
good thought! hmmmm this is a lot of duplication, but I'm thinking that it's maybe fine since we'll remove everything in the else
in 1-2 weeks when we GA the code!
I'm wondering if we just want to ship it without using We could also feature flag it and staff ship it soon after it's released in Dotcom. Either option is good! |
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.
LGTM! Only comments are how you'd want to ship it in #5679 (comment)
@@ -144,7 +144,7 @@ | |||
"description": "Whether the segment is selected. This is used for controlled SegmentedControls, and needs to be updated using the onChange handler on SegmentedControl." | |||
}, | |||
{ | |||
"name": "selected", | |||
"name": "size", |
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.
Oh no, this was a typo? 🫣 Good catch! Hope no one used this the wrong way 😅
"name": "unsafeDisableTooltip", | ||
"type": "boolean", | ||
"defaultValue": "false", | ||
"required": false | ||
}, |
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.
We could probably forgo this one, as it will only be temporary, and will (hopefully) only be used by us.
👋 Hi from github/github! Your integration PR is ready: https://github.com/github/github/pull/361860 |
9a92198
to
c92f2d7
Compare
I updated the changes to be wrapped by a new feature flag, after discussing some more with @TylerJDev:
|
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.
Feature flag looks good! Reapproving! ✨
To do:
Relates to:
This enables a tooltip by default on the SegmentedControl.IconButton. For safe rollout, this wraps the updates in a new feature flag,
primer_react_segmented_control_tooltip
which will be tracked in https://github.com/github/primer/issues/4775.We can enable this feature flag for 1-2 weeks in dotcom, before we clean it up and formally GA.
I welcome others thoughts.
Changelog
New
SegmentedControl.IconButton
.Rollout strategy
Merge checklist