Repository navigation
Conversation
…d streams Co-authored-by: vercel-v[bot] <353008837+vercel-v[bot]@users.noreply.github.com>
Contributor
🦋 Changeset detectedLatest commit: 5fd3f82 The changes in this PR will be included in the next version bump. This PR includes changesets to release 18 packages
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 |
Contributor
Sim WorldSimulated world deterministic testing for races. Traces 🟢 world-sim scenario book — 0 fail of 45 total
Full trace: |
Signed-off-by: Mitul Shah <[email protected]> Co-authored-by: vercel-v[bot] <353008837+vercel-v[bot]@users.noreply.github.com>
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>
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
weblib/status-colors.ts(status badge)geist-warninggeist-cyangeist-errorwebruns-table.tsxstatus filterblue-600/dark:blue-400green-600/dark:green-400red-600web-sharedtimeline segmentsweb-sharedevent details timing breakdowngreen-700amber-700(red on the timeline)geist-cyanandgeist-warningare temporary migration colours in the design tokens: fixed hex values that don't follow the theme. The runs-table dots mixedbg-neutral-*withdark:*-400overrides. 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,-800status text and aBadgevariant.STATUSmaps each status (run/steppending|running|completed|failed|cancelled, the timeline'squeued|retrying|succeeded|waiting|sleeping, and a stream'slive) to its label, tone and subtle timeline bar classes. A newStatusDotprimitive 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.amber-700teal-600red-700gray-700blue-700Moved onto the map: the web app's
StatusBadge(andlib/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 duplicatederrorClassNameon every resource; the event-details timing breakdown, where backoff maps toretryingand ok maps tosucceeded; 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 forpendingandrunning, now amber on amber.Also in this PR:
getEventColorand 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.receivedtimeline segment status. No segment builder produces it.data-inspector.tsx(stream/run refs) andsidebar/conversation-view.tsx(role bubbles, tool call/result) fromborder-*-300toborder-*-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:
runningin amber, and Vercel CI usesbg-amber-700for running. The design guidance reserves blue for a positive action outcome, not for work in progress. This PR usesamber-700, the themed equivalent CI already uses, so the dots keep the dashboard's meaning without the fixed hex.teal-600, the design guidance's colour for a persistent successful status. It replacesgeist-cyan(#50e3c2), which is also a teal.red-700, which matches CI. Pending and cancelled aregray-700. The dashboard usesgray-500here, but the design guidance asks for 3:1 contrast on state indicators, andgray-500is close to the dark background.Status text step
packages/web-shared/AGENTS.mdsays status text uses the-800step, while the design system's style guide usestext-{color}-900for secondary text and icons. Following AGENTS.md,STATUS[*].textis-800(the Live label istext-teal-800). The decrypt button keeps its tinted-surface treatment (-100fill,-400edge,-900text) and only changes hue.Validation
Re-run after updating the branch onto current
main(including #5524's token layer and #5518's sharedcn):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, whichtest/serializable-revivers.test.tsneeds.biome check packages/web-shared packages/web: passes, with the same 117 warnings and 4 infos asmainand no new diagnostics in the changed files.src/lib/status.test.tscovers every run and step status, the five run dot colours, segment and run parity, and the absence of green orgeist-*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)
step_started(still running) gets asucceededsegment (trace-viewer/utils.ts, thei === marks.length - 1branch of the step segment builder), so running steps show teal instead of striped amber.--color-geist-cyan/--color-geist-warningtheme aliases inweb-shared/src/styles.csshave no users left in this repo. The token layer is out of scope here.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>