Skip to content

[web-shared] Build the observability UI's loading buttons and spinners on Button - #5522

Merged
mitul-s merged 15 commits into
mainfrom
web-shared/button-variants
Nov 17, 2026
Merged

mitul-s merged 15 commits into
mainfrom
web-shared/button-variants

Conversation

@mitul-s

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

Copy link
Copy Markdown
Contributor

What

The observability UI's loading buttons and spinners now render through a single Button and a single Spinner. Their sizes, slots, focus ring and loading state match the design system's button pixel for pixel. LoadMoreButton and the tiny size are gone.

Why

LoadMoreButton and DecryptButton each built their own secondary button out of injected <style> tags, and spinners were drawn three different ways. As a result, heights, hover fills, disabled styles and focus rings all varied. With one Button, those details live in one place.

Preview

Observability UI preview

  1. Tab to Health Check. A 2px focus ring replaces the border, with a 2px gap.
  2. Click Health Check. The spinner takes the icon's slot and the label stays put.
  3. Select runs. Re-enqueue and Cancel show the same spinner while working.
  4. On a run with more than one page of events, open Events. Load more shows the spinner while loading.

Changes

  • Button
    • The label has its own span with 6px of padding, which truncates when the button is squeezed. It sits between a 20px prefix slot and a suffix slot, and asChild gets the same structure.
    • loading disables the button, sets aria-busy, and swaps the prefix for a spinner sized to the button: 12px at small, 16px at medium, 20px at large.
    • Slot icons are 14px, and labels use a 1.5× line height.
    • Keyboard focus draws --ds-focus-ring in place of the border.
    • Disabled tertiary keeps its text colour, at 50% opacity.
    • tiny is removed.
  • Spinner takes named sizes from sm to 4xl, defaulting to lg (20px). It's sized with classes and drawn from one table of line sizes, angles, delays and durations. It paints with currentColor, and its keyframes live in styles.css.
  • LoadMoreButton is removed. The Events list renders a secondary Button with loading instead.
  • DecryptButton is a small secondary Button with a Lock/LockOpen prefix.
  • Call sites
    • Icons go in prefix/suffix: Replay, Cancel, Newest, Previous/Next, Docs, Health Check, and the bulk actions.
    • The Refresh buttons use loading.
    • Icon-only buttons use shape="square".
    • Buttons that used tiny are now small.
  • IconButton drops muted, which was the same as the default.
  • Comments in styles.css and runs-table.tsx describe this code on its own terms.

Public API:

  • Button's size="tiny" is removed.
  • Spinner drops pixel sizes and the color prop, and defaults to 20px.

LoadMoreButton and IconButton were already removed from the package's exports on main (#5542).

How did you test your changes?

  • Rendered comparison against the reference implementation, in light and dark, at rest, on hover and with keyboard focus. It covered 132 button cases (every variant, size and content, including a long label that truncates), all 7 spinner sizes, and the load-more button.
    • Computed styles, element positions and screenshots all match. This revision ran in Chromium; WebKit matched on the previous one.
    • The only differences aren't visual:
      • loading buttons set aria-busy;
      • buttons default to type="button";
      • the spinner is a <span>, because a <div> isn't valid inside a button.
    • Under the standalone app's stylesheet, the extra differences come from app tokens, not Button: the page doesn't set the ss11/calt font features, and --ds-focus-color is a shade off.
  • In the app: Health Check, Newest, Refresh and Docs measure the same as the reference.
  • pnpm turbo typecheck test build --filter=@workflow/web-shared --filter=@workflow/web: 12 of 12 tasks passed. web-shared passed 281 tests and web passed 160.
  • test/button.test.ts covers loading, idle and asChild rendering, and the spinner size for each button size.
  • pnpm biome check: no errors on the changed files.

PR Checklist - Required to merge

  • 📦 pnpm changeset was run to create a changelog for this PR
  • 🔒 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 Claude Opus 5.5

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

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 11:01pm UTC
example-nextjs-workflow-webpack Ready Ready Preview, v0 Nov 17, 2026 11:01pm UTC
example-workflow Ready Ready Preview, v0 Nov 17, 2026 11:01pm UTC
workbench-astro-workflow Ready Ready Preview, v0 Nov 17, 2026 11:01pm UTC
workbench-express-workflow Ready Ready Preview, v0 Nov 17, 2026 11:01pm UTC
workbench-fastify-workflow Ready Ready Preview, v0 Nov 17, 2026 11:01pm UTC
workbench-hono-workflow Ready Ready Preview, v0 Nov 17, 2026 11:01pm UTC
workbench-nestjs-workflow Ready Ready Preview, v0 Nov 17, 2026 11:01pm UTC
workbench-nitro-workflow Ready Ready Preview, v0 Nov 17, 2026 11:01pm UTC
workbench-nuxt-workflow Ready Ready Preview, v0 Nov 17, 2026 11:01pm UTC
workbench-python-workflow Ready Ready Preview, v0 Nov 17, 2026 11:01pm UTC
workbench-sveltekit-workflow Ready Ready Preview, v0 Nov 17, 2026 11:01pm UTC
workbench-tanstack-start-workflow Ready Ready Preview, v0 Nov 17, 2026 11:01pm UTC
workbench-vite-workflow Ready Ready Preview, v0 Nov 17, 2026 11:01pm UTC
workflow-docs Ready Ready Preview, v0 Nov 17, 2026 11:01pm UTC
workflow-swc-playground Ready Ready Preview, v0 Nov 17, 2026 11:01pm UTC
workflow-tarballs Ready Ready Preview, v0 Nov 17, 2026 11:01pm UTC
workflow-web Ready Ready Preview, v0 Nov 17, 2026 11:01pm UTC

@changeset-bot

changeset-bot Bot commented Nov 17, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: d97cf19

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 Minor
@workflow/web Minor
@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
mitul-s marked this pull request as ready for review November 17, 2026 20:58
@mitul-s
mitul-s requested a review from a team as a code owner November 17, 2026 20:58
Signed-off-by: Mitul Shah <[email protected]>

Co-authored-by: vercel-v[bot] <353008837+vercel-v[bot]@users.noreply.github.com>
mitul-s and others added 4 commits November 17, 2026 16:24
Prefix and suffix slots keep the label 6px from the slot, slot icons are
14px, labels use 1.5x line height, and the focus ring is a box-shadow that
replaces the border. Disabled tertiary keeps its text colour. Spinner takes
per-size line counts, sizes and speeds, and a loading Button picks the
spinner for its size. LoadMoreButton is a full-width medium button.

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

Co-authored-by: vercel-v[bot] <353008837+vercel-v[bot]@users.noreply.github.com>
Signed-off-by: Mitul Shah <[email protected]>

Co-authored-by: vercel-v[bot] <353008837+vercel-v[bot]@users.noreply.github.com>
… web-shared/button-variants

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

# Conflicts:
#	.changeset/button-variants.md
#	packages/web-shared/src/components/ui/button.tsx
#	packages/web-shared/src/components/ui/load-more-button.tsx
#	packages/web-shared/src/components/ui/spinner.tsx
#	packages/web-shared/src/styles.css
@mitul-s mitul-s mentioned this pull request Nov 17, 2026
2 of 3 tasks
…tiny

The label sits in its own truncating span with 6px of padding, between a
20px prefix slot and a suffix slot, and the button keeps only the rest of
the padding. asChild renders the same structure inside the child element.
Button drops the tiny size, call sites that put an icon in the children use
prefix or suffix, and icon-only buttons use shape. LoadMoreButton keeps a
16px gap above it unless noGap is passed.

Signed-off-by: mitul-s <[email protected]>
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]>
Spinner takes only named sizes, sized with classes and drawn from one table
of line sizes, angles, delays and durations. LoadMoreButton was a secondary
Button with loading, so the Events list renders that directly.

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

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

# Conflicts:
#	packages/web-shared/src/components/index.ts
@mitul-s mitul-s changed the title [web-shared] Build LoadMoreButton, DecryptButton and spinners on Button [web-shared] Build the observability UI's loading buttons and spinners on Button Nov 17, 2026
@mitul-s
mitul-s enabled auto-merge (squash) November 17, 2026 22:56
@mitul-s
mitul-s merged commit 5edc5b2 into main Nov 17, 2026
73 checks passed
@mitul-s
mitul-s deleted the web-shared/button-variants branch November 17, 2026 23:11
@github-actions

Copy link
Copy Markdown
Contributor

No backport to stable for 5edc5b2 (AI decision).

This is a design-system refactor and feature enhancement of the observability UI, not a stability fix. It adds loading/prefix/suffix props to Button, replaces Spinner's pixel sizes with named sizes, and removes size="tiny" and LoadMoreButton, which are breaking public API changes carried by a minor changeset. It also builds on main-only export changes (#5542).

To override, re-run the Backport to stable workflow manually via workflow_dispatch and paste this commit SHA into the ref input:

5edc5b2b768272512a7a65a84979ce71bd29c55c

@github-actions github-actions Bot mentioned this pull request Nov 17, 2026

This branch was successfully deployed

1 active deployment
Preview – workflow-docs — d97cf19d 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.

2 participants