-
Notifications
You must be signed in to change notification settings - Fork 12
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
Allow links in row actions and more actions dropdowns #2751
base: main
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
onActivate() { | ||
navigate(pb.serialConsole({ project, instance: instance.name })) | ||
}, | ||
to: pb.serialConsole({ project, instance: instance.name }), |
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 the narrow change asked for on behalf of an external user in #1855. This allows serial console to be opened in a new tab from both instance list row actions and instance detail "more actions".
<MoreActionsMenu label="Router actions" actions={actions} /> | ||
<MoreActionsMenu label="Router actions"> | ||
<CopyIdItem id={routerData.id} /> | ||
</MoreActionsMenu> |
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.
net negative lines speak for themselves I think
})} | ||
className="destructive" | ||
/> | ||
</MoreActionsMenu> |
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 shows why the children approach is nice. There's no config object where you then elsewhere have to decide what it renders. You just render those things directly.
d27468f
to
dffc1ca
Compare
dffc1ca
to
48cb2bd
Compare
/> | ||
) | ||
)} | ||
</MoreActionsMenu> |
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 the one spot where we are adding some noise, because this is the one spot where we were passing the same set of action config objects to RowActions
in one place (instance list) and MoreActionsMenu
in another (here, instance detail). Because MoreActionsMenu
has been converted to take children directly, we have to do the conversion to elements here. Maybe this should be extracted since it's the same as what RowActions does internally....
@@ -66,7 +78,6 @@ type RowActionsProps = { | |||
export const RowActions = ({ id, copyIdLabel = 'Copy ID', actions }: RowActionsProps) => { | |||
return ( | |||
<DropdownMenu.Root> | |||
{/* TODO: This name should not suck; future us, make it so! */} |
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 comment is from May 2022 #883 and refers to the aria label "Row actions", which tbh I don't see anything wrong with. That's what they are.
Tolerable external link icon, @benjaminleonard? (I changed it to "about this metric" — somehow "about metric" felt like a typo.) ![]() |
Closes #1855
It's more noisy than it needs to be because I also cleaned up some duplicated logic that didn't need to exist — notice there are net deletes despite the increase in functionality. I think I would like to convert
RowActions
to taking elements directly as children as well instead of using these action config objects we have to memoize, but that would be too much churn for this PR: we have row actions in like 20 files.