# KAN-11: Show workflow step durations and live timers

## Ticket

https://danubii.atlassian.net/browse/KAN-11

## Branches

- Source: `ai/KAN-11-show-workflow-step-durations-and-live-timers`
- Target: `main`

## Repositories

- `danubii/openclaw-orchestrator`: `ai/KAN-11-show-workflow-step-durations-and-live-timers` -> `main` (Completed)

## Summary

https://danubii.atlassian.net/browse/KAN-11
Show how long each workflow step has taken in minutes and seconds, including live timers for steps that are currently running. Surface the timing data both on workflow detail pages and on the workflow dashboard/overview.
Scope
- Track start and completion timestamps for each workflow step/job, including plan, implementation, repository tests, integration tests, smoke tests, Claude review, feedback loop, and GitHub/PR handoff steps.
- Expose step duration data through the API in a UI-friendly format while preserving raw timestamps for accurate client-side live calculations.
- Display completed step durations as minutes and seconds, for example 03:42 or 3m 42s, consistently across the UI.
- For running steps, show a live counter that increments without requiring a page refresh.
- Add timing indicators to the workflow detail timeline/status area and to the workflow dashboard cards/table so users can quickly see elapsed time and current running duration.

## Approved Plan

KAN-11 adds workflow timing visibility: completed step durations and live elapsed timers for running workflow steps on both the workflow detail page and dashboard.
- Completed visible workflow steps show a duration.
- Running steps show live elapsed timers without page refresh.
- Dashboard shows total workflow elapsed time and current step elapsed time where applicable.
- Durations are formatted consistently in minutes/seconds and handle long-running steps.
- Timing remains correct after reload and SignalR-driven workflow updates.
- Backend tests cover completed, running, queued, and failed timing mapping.
- Frontend or Playwright tests cover completed durations and live counters.

## Test Summary

Running repository test profile `openclaw-local` for `KAN-11`.
danubii/openclaw-orchestrator
- Target: `main`
- Working: `ai/KAN-11-show-workflow-step-durations-and-live-timers`
Required: `True`
Exit code: `0`
Timed out: `False`
Blocked: `False`

## Cross-Repository Integration Summary

Single-repository workflow; cross-repository integration was not required.

## Smoke Test Summary

Running repository smoke profiles for `KAN-11` after implementation, tests, and cross-repository integration.
- `danubii/openclaw-orchestrator` in `repo-10-danubii-openclaw-orchestrator`: `ai/KAN-11-show-workflow-step-durations-and-live-timers` -> `main`
Required: `True`
Exit code: `0`
Timed out: `False`
Blocked: `False`
```bash
GIT_TERMINAL_PROMPT=0 GIT_ASKPASS=/workspace/git-askpass.sh git clone --branch 'main' 'https://github.com/Danubii/openclaw-orchestrator.git' 'repo-10-danubii-openclaw-orchestrator' && git -C 'repo-10-danubii-openclaw-orchestrator' checkout --detach 'de4fb9747ea15e234aa6fbc7987126be16412c84'

## Review Summary

KAN-11 adds workflow timing visibility to the OpenClaw Orchestrator. The implementation introduces a new `WorkflowTiming` backend helper, extends step and summary DTOs with duration/elapsed fields, converts the dashboard to a client component with live SignalR-driven refresh, and adds shared frontend formatter utilities and the `useNowTick` SSR-safe tick hook. All 55 backend tests pass, lint and build are clean, and 2 Playwright smoke tests pass (one existing, one new). Playwright ran successfully in the smoke environment after browser dependency installation.
The overall design is sound: derived timestamps rather than stored formatted strings, a single shared formatter, no N+1 in `ListAsync`, and a hydration-safe approach where `useNowTick` starts as `null` and the UI falls back to DTO snapshot values until after mount.
APPROVE_WITH_NOTES
None.
None.
**M-1 — Playwright timing test hardcodes `/workflows/timing-demo` and relies on server-rendered fallback**
`web/tests/e2e/project-repository-workflow.spec.ts` (line 266) navigates to `/workflows/timing-demo`. The test only works when the backend is unavailable (ECONNREFUSED), causing the server to render with `fallbackWorkflow`. In any environment where the API is reachable, the server returns 404 for that ID and the page will not contain "Duration 7m 00s". The test should mock the API route with `page.route(...)` instead of depending on fallback-mode behavior.
**M-2 — No direct unit tests for `WorkflowTiming` helper**

## Manual QA

KAN-11: Show workflow step durations and live timers
Automated flow completed through test deploy. Medium review findings accepted for this run; no blocker/high findings remain.

## Guardrails

- OpenClaw created this PR handoff record, but does not merge automatically.
- Human review is required before merge.