Skip to content

feat(dashboard/workflows): surface run params, errors, and one-click re-run (#6292)#6324

Merged
houko merged 2 commits into
mainfrom
workflow-runs-ui
Jun 26, 2026
Merged

feat(dashboard/workflows): surface run params, errors, and one-click re-run (#6292)#6324
houko merged 2 commits into
mainfrom
workflow-runs-ui

Conversation

@houko

@houko houko commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes #6292. Completes the dashboard half of the workflow-runs visibility work. The backend already exposes everything the issue asked for — input and error on the runs list, run-level and step-level error on the run detail, and a dedicated POST /api/workflows/runs/{run_id}/rerun endpoint (landed via #6293 / #6302 / #6298) — but the dashboard never surfaced it. This PR is frontend-only; no backend changes were needed.

Changes

Dashboard (crates/librefang-api/dashboard/):

  • Parameters in run history — each run row now shows the params it was launched with (formatRunParamsPreview renders a JSON object as key: value, …, anything else verbatim, truncated with the full value on hover).
  • Error in run list — failed run rows show the failure reason inline, so you can see why a run failed without opening the detail panel.
  • Step-level errors — the step accordion renders each step's own error and flips the step header icon from the success hue to the error hue when that step failed.
  • Re-run with same parameters — a per-row control wired to the existing rerun endpoint. The backend reads the workflow + input off the stored run, so this is a faithful, non-destructive repeat (no form re-typing). The new run is queued and the workflow's run list is invalidated so it appears.

Plumbing (per dashboard/AGENTS.md data-layer rules):

  • api.ts: WorkflowRunItem gains input?/error?, WorkflowStepResult gains error? (types had drifted from what the backend already returns); new rerunWorkflowRun(runId) call.
  • lib/http/client.ts: re-export rerunWorkflowRun.
  • lib/mutations/workflows.ts: new useRerunWorkflowRun() hook; invalidates workflowKeys.runs(workflowId) + the workflow lists in onSuccess (colocated invalidation).
  • locales/{en,zh,uk}.json: workflows.rerun / rerun_started / rerun_failed added to all three (locale-parity kept).

Verification

All run in crates/librefang-api/dashboard/:

  • pnpm typecheck — clean
  • pnpm lint — 0 errors (warnings are pre-existing baseline)
  • pnpm test --run839 passed (85 files), including the vitest locale-parity gate
  • pnpm build — succeeds

Added a WorkflowsPage.test.tsx case asserting the run row surfaces params (sector: fintech) + the failure reason inline, and that the re-run control calls the mutation with { runId, workflowId }. The page test's vi.mock("../lib/mutations/workflows") was extended to expose the new useRerunWorkflowRun symbol (the page imports it, so the mock must too).

No backend / OpenAPI changes, so no regeneration needed.

…re-run (#6292)

The backend already returns `input`/`error` on the runs list, run-level and step-level `error` on the run detail, and a `POST /api/workflows/runs/{run_id}/rerun` endpoint (shipped via #6293 / #6302 / #6298), but the dashboard never surfaced any of it.

Run-history rows now show the parameters the run was launched with and, for failed runs, the failure reason inline — no need to open the detail panel.

The step accordion shows each step's own error and switches its header icon to the error hue when that step failed.

Each run row gets a "Re-run with same parameters" control wired to the existing rerun endpoint, which faithfully repeats the stored input rather than re-submitting caller-typed params.

Sync the TypeScript types that had drifted from the backend (`WorkflowRunItem` gains `input`/`error`; `WorkflowStepResult` gains `error`), add the `rerunWorkflowRun` client call plus a `useRerunWorkflowRun` mutation hook that invalidates the workflow's run list, and add `workflows.rerun*` i18n keys to en/zh/uk.
@github-actions github-actions Bot added size/M 50-249 lines changed no-rust-required This task does not require Rust knowledge labels Jun 25, 2026

@houko houko left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Logic and data-layer wiring look correct — useRerunWorkflowRun correctly threads workflowId through to onSuccess invalidation, locale parity across en/uk/zh is maintained, and the test mock setup matches the new hook. Three files have multi-line comment blocks that violate CLAUDE.md's one-line-max rule — see inline notes.


Generated by Claude Code

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CLAUDE.md: "Don't write multi-paragraph docstrings or multi-line comment blocks — one short line max."

The JSDoc on rerunWorkflowRun spans six lines across two paragraphs. Collapse to one line:

/** Re-run a stored workflow run with its original parameters; returns `{ run_id }` of the freshly-queued run. */

Generated by Claude Code

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CLAUDE.md: "Don't write multi-paragraph docstrings or multi-line comment blocks — one short line max."

The JSDoc on useRerunWorkflowRun spans six lines. Collapse to one line:

/** Re-run a previous run with its stored parameters; invalidates `workflowKeys.runs(workflowId)` on success (#6292). */

Generated by Claude Code

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CLAUDE.md: "Don't write multi-paragraph docstrings or multi-line comment blocks — one short line max."

Four multi-line comment blocks in this file:

  1. JSDoc on formatRunParamsPreview (four lines). Collapse to: /** Format inputas a compactk: v, … preview; non-object JSON and raw strings are shown verbatim. */

  2. {/* Parameters the run was launched with … */} (three lines). Collapse to: {/* Params preview — shows WHAT was passed without opening the detail panel (#6292). */}

  3. {/* Failure reason, surfaced inline … */} (two lines). Collapse to: {/* Failure reason surfaced inline so the list shows WHY a run failed (#6292). */}

  4. {/* Re-run with the same parameters … */} (three lines). Collapse to: {/* Re-run sibling: never nested inside the row button so it is a valid standalone control (#6292). */}


Generated by Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no-rust-required This task does not require Rust knowledge size/M 50-249 lines changed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Workflow runs: show parameters, step errors, and allow re-run with same params

2 participants