feat: run button

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

View File

@@ -165,23 +165,21 @@ function RenderingNodeComponent({ id, data, width, height, selected }: Props) {
state.incomingIds.length > 0 ? ( state.incomingIds.length > 0 ? (
<div className="flex items-center gap-2 shrink-0"> <div className="flex items-center gap-2 shrink-0">
<ButtonGroup className="nodrag nopan"> <ButtonGroup className="nodrag nopan">
{state.effectiveUpdateMode === 'manual' ? (
<Button <Button
type="button" type="button"
size="sm" size="sm"
variant="outline" variant="outline"
disabled={ disabled={state.loading || !state.hasPendingInputs}
state.loading ||
(state.effectiveUpdateMode === 'manual' && !state.hasPendingInputs)
}
className="h-7 gap-1.5 rounded-r-none border-r-0 px-2.5 text-xs" className="h-7 gap-1.5 rounded-r-none border-r-0 px-2.5 text-xs"
onClick={(e) => { onClick={(e) => {
e.stopPropagation() e.stopPropagation()
state.incrementRunTrigger() state.incrementRunTrigger()
}} }}
title={ title={
state.effectiveUpdateMode === 'manual' && state.hasPendingInputs state.hasPendingInputs
? 'Inputs changed — click to render' ? 'Inputs changed — click to render'
: state.effectiveUpdateMode === 'manual' && !state.hasPendingInputs : !state.hasPendingInputs
? 'No new data to render' ? 'No new data to render'
: undefined : undefined
} }
@@ -193,13 +191,25 @@ function RenderingNodeComponent({ id, data, width, height, selected }: Props) {
)} )}
Run Run
</Button> </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 />
</Button>
) : null}
<DropdownMenu> <DropdownMenu>
<DropdownMenuTrigger asChild> <DropdownMenuTrigger asChild>
<Button <Button
type="button" type="button"
size="sm" size="sm"
variant="outline" 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" aria-label="Update mode"
onClick={(e) => e.stopPropagation()} onClick={(e) => e.stopPropagation()}
> >