feat: run button

This commit is contained in:
2026-03-14 07:58:50 +01:00
parent b642a7aab2
commit 1ee078c350

View File

@@ -165,41 +165,51 @@ function RenderingNodeComponent({ id, data, width, height, selected }: Props) {
state.incomingIds.length > 0 ? (
<div className="flex items-center gap-2 shrink-0">
<ButtonGroup className="nodrag nopan">
<Button
type="button"
size="sm"
variant="outline"
disabled={
state.loading ||
(state.effectiveUpdateMode === 'manual' && !state.hasPendingInputs)
}
className="h-7 gap-1.5 rounded-r-none border-r-0 px-2.5 text-xs"
onClick={(e) => {
e.stopPropagation()
state.incrementRunTrigger()
}}
title={
state.effectiveUpdateMode === 'manual' && state.hasPendingInputs
? 'Inputs changed — click to render'
: state.effectiveUpdateMode === 'manual' && !state.hasPendingInputs
? 'No new data to render'
: undefined
}
>
{state.loading ? (
{state.effectiveUpdateMode === 'manual' ? (
<Button
type="button"
size="sm"
variant="outline"
disabled={state.loading || !state.hasPendingInputs}
className="h-7 gap-1.5 rounded-r-none border-r-0 px-2.5 text-xs"
onClick={(e) => {
e.stopPropagation()
state.incrementRunTrigger()
}}
title={
state.hasPendingInputs
? 'Inputs changed — click to render'
: !state.hasPendingInputs
? 'No new data to render'
: undefined
}
>
{state.loading ? (
<Loader2 className="size-3.5 animate-spin shrink-0" aria-hidden />
) : (
<Play className="size-3.5 shrink-0" />
)}
Run
</Button>
) : state.loading ? (
<Button
type="button"
size="sm"
variant="outline"
disabled
className="h-7 gap-1.5 rounded-r-none border-r-0 px-2.5 text-xs"
aria-label="Updating"
>
<Loader2 className="size-3.5 animate-spin shrink-0" aria-hidden />
) : (
<Play className="size-3.5 shrink-0" />
)}
Run
</Button>
</Button>
) : null}
<DropdownMenu>
<DropdownMenuTrigger asChild>
<Button
type="button"
size="sm"
variant="outline"
className="h-7 min-w-[4.5rem] gap-1 rounded-l-none pl-2 pr-1.5 text-xs font-normal"
className={`h-7 min-w-[4.5rem] gap-1 pl-2 pr-1.5 text-xs font-normal ${state.effectiveUpdateMode === 'manual' || state.loading ? 'rounded-l-none' : 'rounded-l-md'}`}
aria-label="Update mode"
onClick={(e) => e.stopPropagation()}
>