Skip to content

Commit 1e4c080

Browse files
committed
Makes the “hiddenButtons” support a single button instead of adding a new property
1 parent 9c9a22f commit 1e4c080

File tree

3 files changed

+7
-14
lines changed

3 files changed

+7
-14
lines changed

apps/webapp/app/components/primitives/Table.tsx

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ const variants = {
2121
stickyCell: "group-hover/table-row:bg-charcoal-800",
2222
menuButton:
2323
"bg-background-dimmed group-hover/table-row:bg-charcoal-800 group-hover/table-row:ring-grid-bright group-has-[[tabindex='0']:focus]/table-row:bg-background-bright",
24-
menuButtonDivider: "group-hover/table-row:border-grid-dimmed",
24+
menuButtonDivider: "group-hover/table-row:border-grid-bright",
2525
rowSelected: "bg-charcoal-750 group-hover/table-row:bg-charcoal-750",
2626
},
2727
} as const;
@@ -302,7 +302,6 @@ export const TableCellMenu = forwardRef<
302302
onClick?: (event: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void;
303303
visibleButtons?: ReactNode;
304304
hiddenButtons?: ReactNode;
305-
hiddenSoloButton?: ReactNode;
306305
popoverContent?: ReactNode;
307306
children?: ReactNode;
308307
isSelected?: boolean;
@@ -315,7 +314,6 @@ export const TableCellMenu = forwardRef<
315314
onClick,
316315
visibleButtons,
317316
hiddenButtons,
318-
hiddenSoloButton,
319317
popoverContent,
320318
children,
321319
isSelected,
@@ -346,17 +344,14 @@ export const TableCellMenu = forwardRef<
346344
{hiddenButtons && (
347345
<div
348346
className={cn(
349-
"hidden pr-0.5 group-hover/table-row:block group-hover/table-row:border-r",
347+
"hidden group-hover/table-row:block",
348+
popoverContent && "pr-0.5 group-hover/table-row:border-r",
350349
variants[variant].menuButtonDivider
351350
)}
352351
>
353-
{hiddenButtons}
352+
<div className={cn("flex items-center gap-x-0.5")}>{hiddenButtons}</div>
354353
</div>
355354
)}
356-
{/* Hidden solo button that shows on hover. To be used without the ellipsis popover content */}
357-
{hiddenSoloButton && (
358-
<div className={cn("hidden group-hover/table-row:block")}>{hiddenSoloButton}</div>
359-
)}
360355
{/* Always visible buttons */}
361356
{visibleButtons}
362357
{/* Always visible popover with ellipsis trigger */}

apps/webapp/app/components/runs/v3/TaskRunsTable.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -472,7 +472,7 @@ function RunActionsCell({ run, path }: { run: RunListItem; path: string }) {
472472
</>
473473
}
474474
hiddenButtons={
475-
<div className="flex items-center">
475+
<>
476476
{run.isCancellable && (
477477
<SimpleTooltip
478478
button={
@@ -518,7 +518,7 @@ function RunActionsCell({ run, path }: { run: RunListItem; path: string }) {
518518
disableHoverableContent
519519
/>
520520
)}
521-
</div>
521+
</>
522522
}
523523
/>
524524
);

apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.queues/route.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -399,9 +399,7 @@ export default function Page() {
399399
<TableCellMenu
400400
isSticky
401401
visibleButtons={queue.paused && <QueuePauseResumeButton queue={queue} />}
402-
hiddenSoloButton={
403-
!queue.paused && <QueuePauseResumeButton queue={queue} />
404-
}
402+
hiddenButtons={!queue.paused && <QueuePauseResumeButton queue={queue} />}
405403
/>
406404
</TableRow>
407405
))

0 commit comments

Comments
 (0)