-
Notifications
You must be signed in to change notification settings - Fork 245
chore(connections-navigation): disable sidebar right-caret on disconnected connections #6499
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
Changes from all commits
61d704d
a2c3f42
dde7f36
f7dfdfc
03449f7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -28,7 +28,7 @@ type NavigationBaseItemProps = { | |
| actions: NavigationItemActions; | ||
| onAction: (action: Actions) => void; | ||
| }; | ||
| onExpand: (toggle: boolean) => void; | ||
| toggleExpand: () => void; | ||
| }; | ||
|
|
||
| const menuStyles = css({ | ||
|
|
@@ -98,7 +98,7 @@ export const NavigationBaseItem: React.FC<NavigationBaseItemProps> = ({ | |
| isExpanded, | ||
| isFocused, | ||
| hasDefaultAction, | ||
| onExpand, | ||
| toggleExpand, | ||
| children, | ||
| }) => { | ||
| const [hoverProps, isHovered] = useHoverState(); | ||
|
|
@@ -114,12 +114,13 @@ export const NavigationBaseItem: React.FC<NavigationBaseItemProps> = ({ | |
| <div className={cx('item-wrapper', itemWrapperStyles)} style={style}> | ||
| {isExpandVisible && ( | ||
| <ExpandButton | ||
| onClick={(evt) => { | ||
| if (isExpandDisabled) return; | ||
| evt.stopPropagation(); | ||
| onExpand(!isExpanded); | ||
| onClick={(event) => { | ||
| // Prevent the click from propagating to the `TreeItem`, triggering the default action | ||
| event.stopPropagation(); | ||
| toggleExpand(); | ||
| }} | ||
| isExpanded={isExpanded} | ||
| disabled={isExpandDisabled} | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Based on what Betsy's message, I was under the impression we were going to hide the caret altogether, not make it disabled: https://mongodb.slack.com/archives/G2L10JAV7/p1731623253437699?thread_ts=1731413469.751959&cid=G2L10JAV7
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @bsradcliffe wanted to keep them (see #6449 (comment))
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Cool cool, fine as is then. I'll ping @bsradcliffe to see if making them clickable to connect is an option, or if we want to keep it as is with the disabled. |
||
| ></ExpandButton> | ||
| )} | ||
| <div className={labelAndIconWrapperStyles}> | ||
|
|
||
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.
I think this is still desirable because what I noticed - once you connect, and click on the expanded caret to collapse the tree, the default action (to open the tab for databases list) happens instead of collapse.
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.
I was hoping you'd share context on this. I forgot to ask directly 😬
I'll add it back and write a comment on why it's there 👍