Skip to content

Commit ce442b1

Browse files
committed
Improved the menu items
1 parent e6de253 commit ce442b1

File tree

2 files changed

+64
-5
lines changed

2 files changed

+64
-5
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ export const TableCellMenu = forwardRef<
277277
hasAction={true}
278278
>
279279
<div className="relative p-1">
280-
<div className="absolute right-0 top-1/2 mr-1 flex -translate-y-1/2 items-center justify-end gap-0.5 bg-background-dimmed p-0.5 shadow-lg group-hover/table-row:rounded-[0.25rem] group-hover/table-row:bg-background-bright group-hover/table-row:ring-1 group-hover/table-row:ring-grid-bright">
280+
<div className="absolute right-0 top-1/2 mr-1 flex -translate-y-1/2 items-center justify-end gap-0.5 bg-background-dimmed p-0.5 group-hover/table-row:rounded-[0.25rem] group-hover/table-row:bg-background-bright group-hover/table-row:ring-1 group-hover/table-row:ring-grid-bright">
281281
{/* Hidden buttons that show on hover */}
282282
{hiddenButtons && (
283283
<div className="hidden pr-0.5 group-hover/table-row:block group-hover/table-row:border-r group-hover/table-row:border-grid-dimmed">

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

Lines changed: 63 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
import {
22
ArrowPathIcon,
3+
ArrowRightIcon,
34
ClockIcon,
45
CpuChipIcon,
56
NoSymbolIcon,
67
RectangleStackIcon,
7-
StopCircleIcon,
8-
StopIcon,
98
} from "@heroicons/react/20/solid";
109
import { BeakerIcon, BookOpenIcon, CheckIcon } from "@heroicons/react/24/solid";
1110
import { useLocation } from "@remix-run/react";
@@ -16,6 +15,7 @@ import { Button, LinkButton } from "~/components/primitives/Buttons";
1615
import { Checkbox } from "~/components/primitives/Checkbox";
1716
import { Dialog, DialogTrigger } from "~/components/primitives/Dialog";
1817
import { Header3 } from "~/components/primitives/Headers";
18+
import { PopoverMenuItem } from "~/components/primitives/Popover";
1919
import { useSelectedItems } from "~/components/primitives/SelectedItemsProvider";
2020
import { SimpleTooltip } from "~/components/primitives/Tooltip";
2121
import { useEnvironments } from "~/hooks/useEnvironments";
@@ -412,9 +412,65 @@ function RunActionsCell({ run, path }: { run: RunListItem; path: string }) {
412412
return (
413413
<TableCellMenu
414414
isSticky
415+
popoverContent={
416+
<>
417+
<PopoverMenuItem
418+
to={path}
419+
icon={ArrowRightIcon}
420+
leadingIconClassName="text-blue-500"
421+
title="View run"
422+
/>
423+
{!run.isCancellable && (
424+
<Dialog>
425+
<DialogTrigger
426+
asChild
427+
className="size-6 rounded-sm p-1 text-text-dimmed transition hover:bg-charcoal-700 hover:text-text-bright"
428+
>
429+
<Button
430+
variant="small-menu-item"
431+
LeadingIcon={NoSymbolIcon}
432+
leadingIconClassName="text-error"
433+
fullWidth
434+
textAlignLeft
435+
className="w-full px-1.5 py-[0.9rem]"
436+
>
437+
Cancel run
438+
</Button>
439+
</DialogTrigger>
440+
<CancelRunDialog
441+
runFriendlyId={run.friendlyId}
442+
redirectPath={`${location.pathname}${location.search}`}
443+
/>
444+
</Dialog>
445+
)}
446+
{run.isReplayable && (
447+
<Dialog>
448+
<DialogTrigger
449+
asChild
450+
className="h-6 w-6 rounded-sm p-1 text-text-dimmed transition hover:bg-charcoal-700 hover:text-text-bright"
451+
>
452+
<Button
453+
variant="small-menu-item"
454+
LeadingIcon={ArrowPathIcon}
455+
leadingIconClassName="text-success"
456+
fullWidth
457+
textAlignLeft
458+
className="w-full px-1.5 py-[0.9rem]"
459+
>
460+
Replay run
461+
</Button>
462+
</DialogTrigger>
463+
<ReplayRunDialog
464+
runFriendlyId={run.friendlyId}
465+
failedRedirect={`${location.pathname}${location.search}`}
466+
/>
467+
</Dialog>
468+
)}
469+
</>
470+
}
415471
hiddenButtons={
416-
<div className="flex items-center gap-1">
417-
{run.isCancellable && (
472+
<div className="flex items-center">
473+
{!run.isCancellable && (
418474
<SimpleTooltip
419475
button={
420476
<Dialog>
@@ -435,6 +491,9 @@ function RunActionsCell({ run, path }: { run: RunListItem; path: string }) {
435491
disableHoverableContent
436492
/>
437493
)}
494+
{!run.isCancellable && run.isReplayable && (
495+
<div className="mx-0.5 h-6 w-px bg-grid-dimmed" />
496+
)}
438497
{run.isReplayable && (
439498
<SimpleTooltip
440499
button={

0 commit comments

Comments
 (0)