{# Single source of truth for task/run status visuals. status_dot(status): renders the status indicator — a glyph per state (completed -> check, failed -> x, dep_failed -> skipped, pending -> hourglass, submitted -> arrow up, queued -> arrow-to-bar, settling -> arrow down) and a colored dot for running and cancelled. Centralising this means no view can drift or silently forget a state (settling was previously missing a dot in four separate templates). Pass the *string* value, e.g. item.status.value or run.status.value. #} {% macro status_dot(status) -%} {%- if status == 'completed' -%} {%- elif status == 'failed' -%} {%- elif status == 'dep_failed' -%} {%- elif status == 'running' -%} {%- elif status == 'settling' -%} {%- elif status == 'submitted' -%} {%- elif status == 'queued' -%} {%- elif status == 'pending' -%} {%- else -%}{# cancelled and any unknown state #} {%- endif -%} {%- endmacro %} {# status_bar(counts, classes): stacked run progress bar with one segment per item state, sized by its share of the item count. Colors mirror status_dot. Pass run.status_counts and the sizing classes for the outer track (width + height); segments fill via flex-grow so shares always sum to the full track with no rounding gaps. Pending keeps the track color so "empty = not started" still reads as before; hover any segment for its count. #} {% macro status_bar(counts, classes='w-full h-2') -%}
{%- for s, color in [ ('completed', 'bg-green-600'), ('failed', 'bg-red-600'), ('dep_failed', 'bg-orange-600'), ('settling', 'bg-gray-400 animate-pulse'), ('running', 'bg-indigo-500 animate-pulse'), ('queued', 'bg-yellow-600'), ('submitted', 'bg-yellow-500'), ('pending', 'bg-gray-200'), ] -%} {%- set n = counts.get(s, 0) -%} {%- if n > 0 -%}
{%- endif -%} {%- endfor -%}
{%- endmacro %}