Skip to content

[web-shared] One semantic status colour map for runs, steps, hooks and streams - #5523

Draft
mitul-s wants to merge 4 commits into
mainfrom
web-shared/status-colors
Draft

mitul-s wants to merge 4 commits into
mainfrom
web-shared/status-colors

Conversation

@mitul-s

@mitul-s mitul-s commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Colours every run, step, hook, attempt and stream status from one semantic status map in @workflow/web-shared, so a status looks the same everywhere and adapts to dark mode.

Why

Four surfaces each had their own status palette, and they disagreed:

Surface running completed / succeeded failed
web lib/status-colors.ts (status badge) geist-warning geist-cyan geist-error
web runs-table.tsx status filter blue-600 / dark:blue-400 green-600 / dark:green-400 red-600
web-shared timeline segments blue blue (run) / green (step attempt) red
web-shared event details timing breakdown – green-700 amber-700 (red on the timeline)

geist-cyan and geist-warning are temporary migration colours in the design tokens: fixed hex values that don't follow the theme. The runs-table dots mixed bg-neutral-* with dark:*-400 overrides. The stream viewer's "Live" dot and the decrypt button's done state used generic green.

Approach

Add packages/web-shared/src/lib/status.ts. It has five tones, each with a colour scale hue, a dot fill, -800 status text and a Badge variant. STATUS maps each status (run/step pending|running|completed|failed|cancelled, the timeline's queued|retrying|succeeded|waiting|sleeping, and a stream's live) to its label, tone and subtle timeline bar classes. A new StatusDot primitive uses the design system's status dot geometry (size-2.5) and is decorative, because a label always sits next to it. Both are exported from the package root and /components.

Tone Dot Used for
progress amber-700 running, retrying / backoff
success teal-600 completed, succeeded attempt, live stream
error red-700 failed run, failed attempt
neutral gray-700 pending, queued, waiting, sleeping, cancelled
positive blue-700 decrypted payload

Moved onto the map: the web app's StatusBadge (and lib/status-colors.ts, now deleted) and the runs-table status filter, which read it from @workflow/web-shared; the timeline segments and the timeline's errored/cancelled fallback bars, which replaces the duplicated errorClassName on every resource; the event-details timing breakdown, where backoff maps to retrying and ok maps to succeeded; the stream viewer's Live indicator; and the decrypt button's done state, which builds its inline CSS from the tone's hue. The timeline keeps its animated stripes for pending and running, now amber on amber.

Also in this PR:

  • Deleted getEventColor and its test. Only its test used it, it isn't reachable through the package exports, and a code search finds no other consumer. attr_set's off-scale palette goes with it.
  • Removed the received timeline segment status. No segment builder produces it.
  • Moved the hand-made chips in data-inspector.tsx (stream/run refs) and sidebar/conversation-view.tsx (role bubbles, tool call/result) from border-*-300 to border-*-400, the design system's default border step. Their hues are a role taxonomy, not statuses, so they keep them.

How this differs from the review's proposal

The review proposed running = blue-700, completed = teal-600, failed = red-700, retrying = amber-700 and pending/cancelled = gray-700. I checked it against the Vercel dashboard and changed one value:

  • Running is amber, not blue. The dashboard's status dot shows a building deployment in amber, the dashboard's own workflow runs table (which embeds this package) shows running in amber, and Vercel CI uses bg-amber-700 for running. The design guidance reserves blue for a positive action outcome, not for work in progress. This PR uses amber-700, the themed equivalent CI already uses, so the dots keep the dashboard's meaning without the fixed hex.
  • Completed is teal-600, the design guidance's colour for a persistent successful status. It replaces geist-cyan (#50e3c2), which is also a teal.
  • Failed is red-700, which matches CI. Pending and cancelled are gray-700. The dashboard uses gray-500 here, but the design guidance asks for 3:1 contrast on state indicators, and gray-500 is close to the dark background.
  • The decrypt button's done state is blue, because decrypting is a positive action outcome.

Status text step

packages/web-shared/AGENTS.md says status text uses the -800 step, while the design system's style guide uses text-{color}-900 for secondary text and icons. Following AGENTS.md, STATUS[*].text is -800 (the Live label is text-teal-800). The decrypt button keeps its tinted-surface treatment (-100 fill, -400 edge, -900 text) and only changes hue.

Validation

Re-run after updating the branch onto current main (including #5524's token layer and #5518's shared cn):

  • pnpm turbo typecheck test build --filter=@workflow/web-shared --filter=@workflow/web: all 12 tasks pass (web-shared: 35 test files, 293 tests; web: 23 files, 155 tests). The filtered install includes @workflow/cli's dependencies, which test/serializable-revivers.test.ts needs.
  • biome check packages/web-shared packages/web: passes, with the same 117 warnings and 4 infos as main and no new diagnostics in the changed files.
  • New src/lib/status.test.ts covers every run and step status, the five run dot colours, segment and run parity, and the absence of green or geist-* classes.

Visuals were not rendered. I made no screenshots and didn't check light or dark mode in a browser. Please look at the runs table, run detail status, trace timeline (running stripes, retries, failures), event details timing breakdown, stream viewer and decrypt button in both themes.

Follow-ups (not in this PR)

  • Timeline bug: a step whose last mark is step_started (still running) gets a succeeded segment (trace-viewer/utils.ts, the i === marks.length - 1 branch of the step segment builder), so running steps show teal instead of striped amber.
  • The --color-geist-cyan / --color-geist-warning theme aliases in web-shared/src/styles.css have no users left in this repo. The token layer is out of scope here.
  • Resource identity colours (RESOURCE_CLASS_NAMES: run blue, step green, sleep purple) and the flow-graph legends are not statuses, so this PR doesn't change them.

Co-authored-by: vercel-v[bot] <353008837+vercel-v[bot]@users.noreply.github.com>

…d streams

Co-authored-by: vercel-v[bot] <353008837+vercel-v[bot]@users.noreply.github.com>
@vercel

vercel Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
example-nextjs-workflow-turbopack Ready Ready Preview, v0 Nov 17, 2026 9:15pm UTC
example-nextjs-workflow-webpack Ready Ready Preview, v0 Nov 17, 2026 9:15pm UTC
example-workflow Ready Ready Preview, v0 Nov 17, 2026 9:15pm UTC
workbench-astro-workflow Ready Ready Preview, v0 Nov 17, 2026 9:15pm UTC
workbench-express-workflow Ready Ready Preview, v0 Nov 17, 2026 9:15pm UTC
workbench-fastify-workflow Ready Ready Preview, v0 Nov 17, 2026 9:15pm UTC
workbench-hono-workflow Ready Ready Preview, v0 Nov 17, 2026 9:15pm UTC
workbench-nestjs-workflow Ready Ready Preview, v0 Nov 17, 2026 9:15pm UTC
workbench-nitro-workflow Ready Ready Preview, v0 Nov 17, 2026 9:15pm UTC
workbench-nuxt-workflow Ready Ready Preview, v0 Nov 17, 2026 9:15pm UTC
workbench-python-workflow Ready Ready Preview, v0 Nov 17, 2026 9:15pm UTC
workbench-sveltekit-workflow Ready Ready Preview, v0 Nov 17, 2026 9:15pm UTC
workbench-tanstack-start-workflow Ready Ready Preview, v0 Nov 17, 2026 9:15pm UTC
workbench-vite-workflow Ready Ready Preview, v0 Nov 17, 2026 9:15pm UTC
workflow-docs Ready Ready Preview, v0 Nov 17, 2026 9:15pm UTC
workflow-swc-playground Ready Ready Preview, v0 Nov 17, 2026 9:15pm UTC
workflow-tarballs Ready Ready Preview, v0 Nov 17, 2026 9:15pm UTC
workflow-web Ready Ready Preview, v0 Nov 17, 2026 9:15pm UTC

@changeset-bot

changeset-bot Bot commented Nov 17, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 5fd3f82

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 18 packages
Name Type
@workflow/web-shared Patch
@workflow/web Patch
@workflow/cli Patch
@workflow/nitro Patch
workflow Patch
@workflow/world-testing Patch
@workflow/nuxt Patch
@workflow/world-cloudflare Patch
@workflow/core Patch
@workflow/world-vercel Patch
@workflow/builders Patch
@workflow/next Patch
@workflow/vitest Patch
@workflow/astro Patch
@workflow/nest Patch
@workflow/rollup Patch
@workflow/sveltekit Patch
@workflow/vite Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions

github-actions Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Sim World

Simulated world deterministic testing for races. Traces

🟢 world-sim scenario book — 0 fail of 45 total
scenario outcome events virt replay violations
✅ smoke-no-steps completed 3 0ms ok 0
✅ smoke-one-step completed 5 0ms ok 0
✅ hook-at-step-started completed 9 0ms ok 0
✅ hook-at-step-completed completed 9 0ms ok 0
✅ hook-at-hook-created completed 9 0ms ok 0
✅ claim-hook-at-registration completed 9 0ms ok 0
✅ claim-hook-at-step-started completed 9 0ms ok 0
✅ deadline-hook-wins completed 6 1.0h ok 0
✅ deadline-expires completed 6 1.0h ok 0
✅ step-vs-timer-early-settlement completed 6 1.0h ok 0
✅ long-sleep completed 9 30.0d ok 0
✅ hook-never-arrives stalled 3 0ms skipped 0
✅ step-retries-twice completed 9 2.0s ok 0
✅ parallel-steps completed 7 0ms ok 0
✅ hook-on-execution-state completed 9 0ms ok 0
✅ peek-hook-before-branch completed 9 0ms ok 0
✅ peek-hook-after-branch completed 9 0ms ok 0
✅ peek-hook-at-registration completed 9 0ms ok 0
✅ race-hook-before-probe completed 9 0ms ok 0
✅ race-hook-after-probe completed 9 0ms ok 0
✅ race-duplicate-delivery completed 10 0ms ok 0
✅ attr-hook-before-step completed 9 0ms ok 0
✅ attr-hook-after-step completed 9 0ms ok 0
✅ attr-from-step-body completed 10 0ms ok 0
✅ fork-hook-after-timeout completed 11 1.0m ok 0
✅ fork-hook-before-timeout completed 11 1.0m ok 0
✅ count-hook-after-timeout completed 13 1.0m ok 0
✅ count-hook-before-timeout completed 15 1.0m ok 0
✅ stale-read-step-count-fork completed 15 1.0m ok 0
✅ stale-read-equal-step-counts completed 11 1.0m ok 0
✅ step-vs-step-fork completed 9 0ms ok 0
✅ step-vs-step-fork-fenced completed 9 1.0s ok 0
✅ fence-catches-benign-direction completed 9 1.0s ok 0
✅ run-ahead-fenced-overlap completed 10 1.0s ok 0
✅ in-flight-before-decision completed 15 1.0m ok 0
✅ in-flight-before-decision-counted completed 13 1.0m ok 0
✅ in-flight-after-decision completed 15 2.0m ok 0
✅ stale-read-step-count-fork-fenced completed 15 1.0m ok 0
✅ fork-hook-wins completed 10 1.0m ok 0
✅ fork-timeout-wins completed 10 1.0m ok 0
✅ unclaimed-payload-under-fork completed 14 1.0m ok 0
✅ claimed-payload-under-fork completed 14 1.0m ok 0
✅ writers-independent-step-bodies completed 9 0ms ok 0
✅ writers-scripted-tempo completed 9 0ms ok 0
✅ cancel-mid-step cancelled 6 0ms skipped 0

Full trace: world-sim.txt

mitul-s and others added 2 commits November 17, 2026 16:06
Signed-off-by: Mitul Shah <[email protected]>

Co-authored-by: vercel-v[bot] <353008837+vercel-v[bot]@users.noreply.github.com>
Comment thread packages/web/app/lib/status-colors.ts Resolved
Keep main's IconButton/Tooltip header in the event details panel, the shared cn import in StatusBadge and the cn export in web-shared's index, and re-apply the status map on top. Describe the palette's sources neutrally in code comments.

Signed-off-by: Mitul Shah <[email protected]>
Co-authored-by: vercel-v[bot] <353008837+vercel-v[bot]@users.noreply.github.com>
@mitul-s mitul-s mentioned this pull request Nov 17, 2026
2 of 3 tasks
mitul-s added a commit that referenced this pull request Nov 17, 2026
### What

Deletes dead code in `@workflow/web-shared`, and removes every public
export that neither `@workflow/web` nor the Vercel dashboard
(`vercel/front`) imports, including the unused
`@workflow/web-shared/components` entry point. This is the web-shared
half of #5529. The `@workflow/web` half is in #5543, and the two PRs
don't depend on each other.

### Why

Code that nothing runs still has to be maintained and reviewed, and
every export is API we have to keep working. Consumers are expected to
update with this change rather than hold the cleanup back. The dashboard
only needs one change, listed below.

### Preview

[workflow-web
preview](https://workflow-web-git-web-shared-delete-dead-code.labs.vercel.dev/?tab=runs)

1. Open a run whose input or output contains a stream, a run reference,
a class instance or encrypted data, and go to `?tab=trace`.
2. Select the step and check that the inspector still renders stream and
run refs as links, class instances with their class name, and encrypted
fields as `Encrypted` with a Decrypt button that decrypts them.

#### Change needed in `vercel/front`

`hydrateResourceIOWithKey` is removed. Swap it for
`hydrateResourceIOAsync`, which takes the same arguments:

- `observability/(tabs)/workflows/lib/use-events-list-data.ts` (lines 8,
73, 107, 141)
- `observability/(tabs)/workflows/components/run-details-view.tsx`
(lines 9, 192)

Nothing else the dashboard imports changes (checked against front's
`main` on 2026-11-17), and front never imports the `/components`
subpath.

#### Removed exports

| Export | What happened to the code |
| --- | --- |
| `hydrateResourceIOWithKey` | Deleted. It only forwarded to
`hydrateResourceIOAsync`. |
| `MenuDropdown`, `MenuDropdownOption` | Deleted. Unused here, in front,
and anywhere else in the org (`gh search code --owner vercel`). |
| `materializeSteps`, `materializeHooks`, `materializeWaits`,
`materializeAll` and the `Materialized*` types | Deleted
`lib/event-materialization.ts` and its tests. Only `index.ts` and tests
imported it. |
| `shouldShowReenqueueButton`, `hasPendingStepsFromEvents`,
`hasPendingHooksFromEvents`, `isTerminalStatus` | Deleted.
`analyzeEvents` stays. |
| `identifyStreamSteps`, `StreamStep` | Deleted. |
| `looksLikeWorkflowIdSearchInput` | Deleted, along with its tests. |
| `CLASS_INSTANCE_REF_TYPE`, `ClassInstanceRef`, `extractStreamIds`,
`isClassInstanceRef`, `isStreamId`, `isStreamRef`, `STREAM_REF_TYPE`,
`truncateId`, `StreamRef` | Re-exports from
`@workflow/core/serialization-format`. Import them from there. |
| `hookEventsToHookEntity`, `isEncryptedMarker`,
`DUPLICATE_EVENT_MESSAGE`, `findDuplicateEventIds`, `isSealedNoopEvent`,
`SEALED_EVENT_MESSAGE`, `parseExactWorkflowSearchId`,
`ExactWorkflowSearchId`, `isQuickJSSnapshotRun`, `extractConversation`,
`isDoStreamStep`, `formatDurationPrecise`, `DecodedStreamChunkSource`,
`useToast` | Still used inside the package. Only the export from the
entry point goes. |
| `ResolveHookModal`, `ConversationView`, `SidebarDataProvider`,
`SelectedSpanInfo`, `DecryptClickContext`, `DecryptClickContextValue`,
`IconButton`, `Kbd`, `LoadMoreButton` | Same: used internally, no longer
exported. |

#### Kept on purpose

- Types that are part of an API that stays public, so callers can
annotate what they pass in or get back: `ButtonProps`,
`DataInspectorProps`, the
`useHookActions`/`HookResolveModalWrapper`/`ResolveHookDropdownItem`
prop and option types, `EventAnalysis`,
`RunLimitGuidance`/`RunLimitGuidanceKind`,
`RunStateHydratorOptions`/`StateHistoryPage` (the docs describe
`createRunStateHydrator` for custom inspectors), and
`SpanSelectionInfo`/`DetailResource` (the arguments and result of
`FetchSpanDetail`).
- `SpanEvent`, which is part of `Span`, and which the v5 What's New page
says is still exported.
- `collapseRefs` and `isDeepEqual` stay exported from their modules for
their tests.

#### Other cleanup

- Deleted `ui/card.tsx` and `ui/alert.tsx` (unused copies of web's
shadcn components), `hooks/use-dark-mode.ts`, `DuplicateEventTooltip`,
and the unused `getPaginationDisplay` in `lib/utils.ts`.
- Deleted `src/index.d.ts` and `src/components/index.d.ts`: tsc ignores
a `.d.ts` next to a `.ts` of the same name, and the published types come
from `dist/`.
- `ui/data-inspector.tsx` drops its private copies of the ref type
guards and imports them from `lib/hydration.ts`.
- Dropped `export` from symbols that only their own file uses
(`AttributeBlock`, `DetailKeyValueRow`, `sortAttributeKeys`,
`TimelineBar`, `kbdVariants`,
`MIN_START`/`MIN_END`/`MeasureFn`/`TruncateResult`,
`EXPIRED_DISPLAY_NAME`, `summarizeArrayBufferView`, `isRunLevelEvent`,
`convertEventsToSpanEvents`).
- Comments that still mentioned `ObjectInspector` now say
`DataInspector`.
- Removed the unused `shiki` dependency. The lockfile diff is three
deleted lines.

#### Overlap with other open PRs

- #5557 rebuilds `MenuDropdown` on Radix, but this PR deletes it because
nothing uses it. Only one of the two should land.
- #5528 edits `lib/event-materialization.ts` and `start-hook.test.ts`,
which this PR deletes and trims. Whichever lands second resolves the
conflict by keeping the deletion.
- #5522, #5523, #5528 and #5530 edit the same entry-point barrels
(`src/index.ts`, `src/components/index.ts`), so expect small conflicts
there.

#### Differences from #5529

- #5529's sync with `main` restored `ui/alert.tsx` and `shiki` by taking
`main`'s copies of conflicting files. This PR deletes them again because
they are still unused on `main`.
- #5529 kept `hydrateResourceIOWithKey` as a deprecated alias for the
dashboard. This PR removes it.

### How did you test your changes?

- `pnpm turbo typecheck test build --filter=@workflow/web-shared` on the
first commit: 10/10 tasks passed.
- `pnpm typecheck` in `packages/web-shared`: no errors.
- `pnpm vitest run` in `packages/web-shared`: 34 files, 276 tests
passed. Ten fewer than `main`: the seven `event-materialization` tests,
the start Hook materialization test, and the two
`looksLikeWorkflowIdSearchInput` tests, all of which covered deleted
code.
- `pnpm turbo build test --filter=@workflow/web` against this branch:
10/10 passed, so `web` builds on the smaller API. `react-router typegen
&& tsc --noEmit` in `packages/web` reports the same 19 errors as `main`.
- `pnpm biome check packages/web-shared`: no errors.
- Export audit: every remaining export from `src/index.ts` is imported
by `packages/web` or front, apart from the types kept on purpose above.
- Visuals were not rendered. The only runtime change is
`DataInspector`'s ref detection, which now uses the `@workflow/core`
guards. They check `__type` with `in`, so they also match the
non-enumerable opaque refs that `collapseRefs` builds, and the existing
`DataInspector`/`collapseRefs` tests pass.

### PR Checklist - Required to merge

- [x] 📦 `pnpm changeset` was run to create a changelog for this PR
- Use the correct semver bump type: `patch` for bug fixes, `minor` for
new features, `major` for breaking changes.
- Use `pnpm changeset --empty` if you are changing documentation or
workbench apps
- [x] 🔒 DCO sign-off passes (run `git commit --signoff` on your commits)
- [ ] 📝 Ping `@vercel/workflow` in a comment once the PR is ready, and
the above checklist is complete

_Written by fx_

---------

Signed-off-by: mitul-s <[email protected]>

This branch was successfully deployed

1 active deployment
Preview – workflow-docs — 5fd3f828 Deployed Nov 17, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant