-
Notifications
You must be signed in to change notification settings - Fork 188
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(connections-navigation): connect in new window via connect split-button COMPASS-8473 #6577
base: main
Are you sure you want to change the base?
Conversation
@@ -63,6 +63,7 @@ | |||
"@leafygreen-ui/search-input": "^4.0.0", | |||
"@leafygreen-ui/segmented-control": "^9.0.0", | |||
"@leafygreen-ui/select": "^13.0.0", | |||
"@leafygreen-ui/split-button": "../../../leafygreen-ui/packages/split-button/leafygreen-ui-split-button-v3.0.0.tgz", |
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.
This is a temporary workaround and needs to be updated once my proposed changes merge and release.
9bbdf1c
to
1dcbbfb
Compare
@@ -39,7 +33,7 @@ export type ItemActionControlsProps<Action extends string> = { | |||
'data-testid'?: string; | |||
}; | |||
|
|||
export function ItemActionControls<Action extends string>({ | |||
export function ItemActionControls<Action extends string = string>({ |
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.
TIL that you can have a default
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.
Yeah – it usually just reduces type safety, though, because then consumers are likely to omit the type (and the default is typically the most generic type available).
This also seems to be one of those cases where type safety goes away – I don't seen an obvious reason for that in the rest of the code, though, so maybe in this particular case we could reconsider?
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.
🙂 TBH, it's likely not strictly needed here, since we'll always be using this in a way that can infer the type of this type parameter from the props
.
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.
That being said - those changes are actually a part of #6560 (which needs to be reviewed and merged first).
c432c5a
to
cffbfbb
Compare
cffbfbb
to
ddc2f45
Compare
Description
Merging this PR will:
SplitButton
with a dropdown menu, containing options to "Connect Here" and "Connect in a New Window".ItemActionControls
being "hideable" (through thesetHideable
callback) allowing children (theConnectButton
in particular) to prevent the controls from being hidden once the cursor leaves the connection row. I use this to prevent controls (henceSplitButton
and it'sMenu
) to be removed from the tree as the cursor is moved out of theConnectButton
, across and into the menu: If the menu is opened, the controls stay visible.connect-in-new-window-1.mov
TODOs
ItemActionControls
#2 #6560 merge.SplitButton
component once we're able to passrenderDarkMenu
LG-4721: FixSplitButton
's menu is rendered in dark-mode regardless of value passed throughrenderDarkMenu
mongodb/leafygreen-ui#2601 and to get LG-4714: Fix usingSplitButton
as a managed component mongodb/leafygreen-ui#2596. I'm currently using a local install of the@leafygreen-ui/split-button
.Checklist
Motivation and Context
Open Questions
Dependents
SplitButton
as a managed component mongodb/leafygreen-ui#2596SplitButton
's menu is rendered in dark-mode regardless of value passed throughrenderDarkMenu
mongodb/leafygreen-ui#2601ItemActionControls
#2 #6560Types of changes