Repository navigation
[web-shared] Build the observability UI's loading buttons and spinners on Button - #5522
Conversation
Signed-off-by: mitul-s <[email protected]> Co-authored-by: vercel-v[bot] <353008837+vercel-v[bot]@users.noreply.github.com>
🦋 Changeset detectedLatest commit: d97cf19 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 |
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>
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
Signed-off-by: mitul-s <[email protected]>
… web-shared/button-variants Signed-off-by: mitul-s <[email protected]>
…iants Signed-off-by: mitul-s <[email protected]>
…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]>
### 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
Signed-off-by: mitul-s <[email protected]>
|
No backport to This is a design-system refactor and feature enhancement of the observability UI, not a stability fix. It adds To override, re-run the Backport to stable workflow manually via |
What
The observability UI's loading buttons and spinners now render through a single
Buttonand a singleSpinner. Their sizes, slots, focus ring and loading state match the design system's button pixel for pixel.LoadMoreButtonand thetinysize are gone.Why
LoadMoreButtonandDecryptButtoneach 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 oneButton, those details live in one place.Preview
Observability UI preview
Changes
ButtonasChildgets the same structure.loadingdisables the button, setsaria-busy, and swaps the prefix for a spinner sized to the button: 12px at small, 16px at medium, 20px at large.--ds-focus-ringin place of the border.tertiarykeeps its text colour, at 50% opacity.tinyis removed.Spinnertakes named sizes fromsmto4xl, defaulting tolg(20px). It's sized with classes and drawn from one table of line sizes, angles, delays and durations. It paints withcurrentColor, and its keyframes live instyles.css.LoadMoreButtonis removed. The Events list renders a secondaryButtonwithloadinginstead.DecryptButtonis a small secondaryButtonwith aLock/LockOpenprefix.prefix/suffix: Replay, Cancel, Newest, Previous/Next, Docs, Health Check, and the bulk actions.loading.shape="square".tinyare nowsmall.IconButtondropsmuted, which was the same as the default.styles.cssandruns-table.tsxdescribe this code on its own terms.Public API:
Button'ssize="tiny"is removed.Spinnerdrops pixel sizes and thecolorprop, and defaults to 20px.LoadMoreButtonandIconButtonwere already removed from the package's exports onmain(#5542).How did you test your changes?
aria-busy;type="button";<span>, because a<div>isn't valid inside a button.Button: the page doesn't set thess11/caltfont features, and--ds-focus-coloris a shade off.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.tscovers loading, idle andasChildrendering, and the spinner size for each button size.pnpm biome check: no errors on the changed files.PR Checklist - Required to merge
pnpm changesetwas run to create a changelog for this PRgit commit --signoffon your commits)@vercel/workflowin a comment once the PR is ready, and the above checklist is completeWritten by Claude Opus 5.5