Skip to content

Components

WorkSteps: what a long job is doing

WorkSteps shows a job that takes more than a moment, such as an import or an assistant's answer, as the one step it is on, with the step's words shimmering. When the job ends it folds into one quiet line with the time and the number of steps, and that line opens the steps and what each one found.

By Bohuslav PoláčekChecked

The demo's VAT and CIS check on Kline Air Systems at three moments: the first step at once, the second after 650 ms, the summary when the answer came at 1.4 s. A click on the summary opens the three steps with their findings, which a page built ahead of time does not do.

What it is for

Some jobs take a few seconds and have steps a person would recognise: reading a file, matching its rows, checking a number with an outside register. A spinner hides what is happening; WorkSteps names the one step that is running, then gets out of the way.

The preview is one run of the check a site manager starts on a subcontractor in the Stonebridge example: look the company up, check the VAT number, verify it under CIS. While the job runs, a single line shows the current step with a twinkling dot matrix and the words shimmering. When it ends, the line becomes "Done in 1.4 s · 3 steps", quiet enough to leave on the record, and a click opens the three steps with what each one found: the company's name and number, a valid VAT number, the verification number. The demo uses the same component for importing fuel card statements, where the steps are reading the file, matching cards and plates to trucks and looking for anomalies.

The manifest keeps it for long jobs: an assistant's answer, an import. A short wait is a Spinner or ThinkingState instead.

The rules and where they live

  • Steps of a job, then a quiet summary that opens them. docs/patterns.md, Motion and feedback, after ChatGPT and Linear, with the place to try it: the subcontractor panel at Stonebridge.
  • Nothing blanks the page. docs/principles.md, Response time: changes show at once, anything over 120 ms shows the route line, and a job with steps says which step it is on rather than covering the screen.
  • Motion is mandatory and comes from the catalogue. The root AGENTS.md (Motion) and docs/motion.md: the shimmer and the dot matrix are the kit's, reduced motion keeps fades only, and npm run check:motion guards the curves and lengths.
  • After the job the screen stays. AGENTS.md: the data swaps in quietly, here the line under the check that says what was verified and by whom.
  • Copy says what is being done, in plain words, as every message in an app does (AGENTS.md, Copy): "Checking the VAT number with HMRC", not "Processing".

What AI coding tools write instead

The manifest names a hand-built progress list. The usual results are a spinner with "Loading…" for ten seconds, a progress bar whose percentage is not tied to any work, or a list of every step with ticks that stays on the screen and pushes the record down long after the job ended. Another is a row of timers that pretend to be steps while the request is still on its way, so the ticks say nothing about what happened.

WorkSteps takes each step's status from the job (waiting, running, done, failed), so the line can only say what the code knows, and it folds itself into one line once the job has a duration. A failed step turns the summary into a line that says it did not work, and the steps underneath show which one stopped.

How to use it

Build the steps from your job's progress, as the demo does with one index, and keep the labels in the order the job runs them. For a job that runs in the background while the person works on, the kit's WorkingPill shows a label and the time since startedAt.

Its entry in the manifest

The component's rules as the kit's manifest states them, the same entry an AI coding tool reads.Read from the kit's component manifest when the site was built (126 components, packages/kit/src/components.json); the same entry answers an AI coding tool through the kit's MCP server.

Where the example apps use it

The example apps and modules that render WorkSteps, read from the demo's code when the site builds.Read from the demo's source when the site was built: 2 of 9 example apps render <WorkSteps>, in the modules named here as each app's sidebar names them.

How the demo drives it

apps/demo/src/modules/crews/components/sub-panel.tsx
const stepsAt = (done: number, details: string[] = []): WorkStep[] =>
  labels.map((label, index) => ({
    id: `step-${index}`,
    label,
    detail: details[index],
    status: index < done ? "done" : index === done ? "running" : "waiting",
  }));

const verify = async () => {
  const started = Date.now();
  setRun({ steps: stepsAt(0) });
  // The register answers from the server; the first two steps are shown as they would take, the answer ends the third.
  const answer = verifyVat(company.slug, sub.id, person);
  answer.catch(() => undefined);
  await sleep(650);
  setRun({ steps: stepsAt(1) });
  await sleep(750);
  setRun({ steps: stepsAt(2) });
Three labels and one index: the steps before it are done, the one at it runs, the rest wait. The demo's register answers from its simulated server, so the first two steps are shown for as long as they would take and the answer ends the third.

Questions

When should I use WorkSteps instead of a spinner?

When the job has steps a person would understand and takes long enough to watch, such as an import or a check against an outside register. A short wait gets a spinner or the thinking state.

What does the summary line show?

How long the job took and how many steps it had, as Done in 1.4 s · 3 steps in the demo. A click opens the steps with what each one found.

What happens when a step fails?

The step is marked failed and the summary says it did not work instead of giving the time, so the person opens it and sees which step stopped.

Does every step stay on the screen while the job runs?

No. Only the step that is running shows, on one line, so the record does not jump while the job works through its steps.

Two ways

Build it yourself, or have it built

  • Build it yourself

    Build your app on the framework

    Get the codebase these apps stand on and build yours with Claude Code, Cursor or Codex.

    One payment, lifetime updates

    Get the framework
  • Have it built

    Have us build your app

    Tell us how your team works. We plan the app with you and build it on the same framework at a fixed price.

    After launch, Care keeps it improving, from €99 a month.

    from €1,990

    Describe your app