Files
windmill/frontend/src/lib/components/ModuleStatus.svelte
182356ec35 feat: show why a step waits: sleep, concurrency limit, approval (#12607)
* feat: show sleeping and concurrency-held steps in the run page and graph

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix: keep waiting reasons live while a run or flow sits idle

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix: stop polling waits a concurrency limit cannot hold

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix: drop stale waiting-step reads and clear ended sleeps

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* feat: show who approved a flow run and the runs waiting for your approval

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix: skip consumed approvals of a workflow as code and keep agent approval requests on the run page

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix: confine waiting approvals to a token's tags, track a workflow's pending approval, show continued rejections

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix: mark a recent run suspended only while it waits on an approval

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* chore: regenerate the files derived from the OpenFlow schema

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix: list a step's approvers without keying on their truncated resume id

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix: drop the doubled lines in the run page's approvals card

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* feat: show the approvals section on home by default, like recently run

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* feat: show sleep and concurrency holds across the run graph, header and timeline

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix: show sleeps in the blue of a job scheduled for later

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* feat: list a waiting approval on home only when its step opts in

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* feat: show waiting runs in recently run in violet with how long they have waited

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix: show a waiting run's age in recently run like every other row's

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix: show a sleep as a wait, marked by its moon rather than a color

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* refactor: open every waiting approval on its approval page

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* feat: open approval pages and the recent run link in a new tab

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix: word approval rows like the approval page and align them with sibling UI

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* feat: list a subflow, branch or loop approval in the run's approvals card

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* feat: show nested approvals on the run page, with the steps leading to them

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* perf: read only the nested runs that can hold an approval, and chain their step ids

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix: select a nested approval's own node, refetch only when its waits change

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix: keep nested approvals within the token's tag scope, test which steps are followed

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* feat: link each waiting approval row to its approval page

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix: order finished approvals by decision time, count approvals instead of steps

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* feat: say a step is retrying in the progress bar instead of above the graph

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix: show a nested wait in the progress bar, drop the graph's suspended line

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix: follow nested loops of deployed flows, show continued timeouts, violet waiting bar

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* feat: show the flow progress bar on the public run page

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix: list approvals that timed out with no response, refresh the count after approving

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* refactor: read approvers with a checked query

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* feat: name who approved a waiting step so far

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* feat: show each approval's time on hover

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* perf: list Home approvals from the waiting step's status, not flow definitions

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* feat: show the Approvals card in the runs page's detail panel

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix: show approval times in a popover, not a native tooltip

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix: put an approval step's resume form above its buttons

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* feat: label a step waiting for approval and move concurrency holds above the step

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix: label an approval wait above the step that waits for it

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* feat: show the approval count and times on the approval page

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix: leave skipped nested approval steps out of the history

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix: count only the current step's approvals on the approval page

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix: count a hold live on the key badge, quote step ids, drop the step count from wait badges

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix: keep wait text gray with the color in its icon, say waiting for approval in node status

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix: stop counting the hold of a run canceled while held

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* chore: update ee-repo-ref to 302da0e8e3817d5cbda5cf1053a9fe89019d7c27

This commit updates the EE repository reference after PR #1006 was merged in windmill-ee-private.

Previous ee-repo-ref: 6f6d8e3bf42a298c5eb90edab61d5a273d304a1a

New ee-repo-ref: 302da0e8e3817d5cbda5cf1053a9fe89019d7c27

Automated by sync-ee-ref workflow.

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: windmill-internal-app[bot] <windmill-internal-app[bot]@users.noreply.github.com>
Co-authored-by: Ruben Fiszel <ruben@windmill.dev>
2026-11-26 00:09:00 +01:00

84 lines
2.8 KiB
Svelte

<script lang="ts">
import type { FlowStatusModule } from '$lib/gen'
import type { GraphModuleState } from './graph'
import { Badge } from './common'
import { forLater } from '$lib/forLater'
import { displayDate, msToCompactDuration } from '$lib/utils'
import { Gauge, Hourglass, Moon } from 'lucide-svelte'
import { useApprovalCount } from './graph/approvalCount.svelte'
interface Props {
type: FlowStatusModule['type']
scheduled_for: Date | undefined
waiting_reason?: GraphModuleState['waiting_reason']
concurrency_key?: string
/** When its concurrency limit first held the step back. */
held_since?: string
approval_wait?: GraphModuleState['approval_wait']
skipped?: boolean
}
let {
type,
scheduled_for,
waiting_reason = undefined,
concurrency_key = undefined,
held_since = undefined,
approval_wait = undefined,
skipped = false
}: Props = $props()
const approval = useApprovalCount(() => approval_wait)
let now = $state(Date.now())
$effect(() => {
if (!waiting_reason) return
const id = setInterval(() => (now = Date.now()), 1000)
return () => clearInterval(id)
})
let sleepLeft = $derived(Math.max(new Date(scheduled_for ?? now).getTime() - now, 0))
let heldFor = $derived(held_since ? Math.max(now - new Date(held_since).getTime(), 0) : undefined)
</script>
{#if type == 'WaitingForEvents'}
<span class="italic text-xs text-primary">
<Hourglass class="inline text-violet-500" size={14} />
{approval_wait ? approval.label : 'Waiting to be resumed by resume events such as approvals'}
</span>
{:else if type == 'WaitingForPriorSteps'}
<span class="italic text-xs text-primary">
<Hourglass class="inline" size={14} />
Waiting for prior steps to complete
</span>
{:else if type == 'WaitingForExecutor' && waiting_reason === 'sleep'}
<span class="italic text-xs text-primary">
<Moon class="inline" size={14} />
Sleeping until {displayDate(scheduled_for, true)} · {msToCompactDuration(sleepLeft, 0)} left
</span>
{:else if type == 'WaitingForExecutor' && waiting_reason === 'concurrency'}
<span class="italic text-xs text-primary">
<Gauge class="inline text-orange-500" size={14} />
Held by concurrency limit{heldFor != undefined
? ` · ${msToCompactDuration(heldFor, 0)}`
: ''}{concurrency_key ? ` (key ${concurrency_key})` : ''}, next check by {displayDate(
scheduled_for,
true
)}
</span>
{:else if type == 'WaitingForExecutor'}
<span class="italic text-xs text-primary">
<Hourglass class="inline" size={14} />
{#if scheduled_for && forLater(scheduled_for.toString())}
Job is scheduled to be executed at {displayDate(scheduled_for, true)}
{:else}
Job is waiting for an executor
{/if}
</span>
{:else if skipped}
<Badge color="blue">Skipped</Badge>
{:else if type == 'Success'}
<Badge color="green">Success</Badge>
{:else if type == 'Failure'}
<Badge color="red">Failure</Badge>
{/if}