Skip to content

feat(web-shared): make the trace viewer span detail panel resizable#2773

Merged
mitul-s merged 7 commits into
mainfrom
ms/resizeable-panel
Jul 6, 2026
Merged

feat(web-shared): make the trace viewer span detail panel resizable#2773
mitul-s merged 7 commits into
mainfrom
ms/resizeable-panel

Conversation

@mitul-s

@mitul-s mitul-s commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

Summary

The span detail panel in the new trace viewer is now user-resizable: drag its left border to resize, double-click the border to reset to the default width. The width is clamped so the event list + timeline always stay usable, persists across sessions (localStorage), and survives closing/reopening the panel and switching tabs. When the viewer gets too narrow to honor both minimums, the panel compresses first and springs back to the preferred width when space returns.

Implementation

  • TraceDetailPanel (new): the detail aside extracted out of NewTraceViewerContent into its own component — content, prev/next/close header, J/K keyboard navigation, and the width model. It stays mounted (rendering null with no selection) so the width survives close/reopen by construction. This shrinks trace-viewer.tsx from 856 to 665 lines.
  • DraggableBorder (new): overlay drag handle straddling the panel border — pointer-capture dragging (mouse/touch/pen), rAF-throttled, hover/drag highlight, double-click reset, and WAI-ARIA window-splitter semantics (role="separator", arrow/Home/End keyboard resize with accurate aria-value*).
  • detail-panel-width.ts (new): pure width model — stored preference with absolute bounds at the storage layer, container-relative max applied at render time — with unit tests (16 cases).
  • useElementWidth (new): small shared ResizeObserver hook used by both the panel and SplitPane.
  • SplitPane: now re-clamps its list/timeline split live when its container resizes (previously only clamped during drag, which would break once the outer boundary can move); dead surface removed (unused Divider export, never-passed defaultStartWidth prop, unreachable headerless branch).
  • The skeleton's column template now derives from shared constants (pane-constants.ts, kept free of 'use client' so the skeleton's import chain stays server-component-safe) instead of a hardcoded duplicate.
  • Also includes a small EventList change: row dividers render per-row instead of via divide-y on the list.

No public API changes — NewTraceViewer's props are untouched and none of the new modules are exported from the package.

Testing

  • pnpm typecheck, pnpm vitest run (132 tests, 16 new), and pnpm build in packages/web-shared all pass.
  • Manual: drag both dividers independently; outer drag live-re-clamps the inner list width; window shrink compresses the panel toward its floor and re-grow restores the preferred width; width survives close/reopen, tab switches, and reloads; J/K navigation and windowed scrolling unaffected; keyboard resize on the separator.

Changeset included (minor, @workflow/web-shared).

🤖 Generated with Claude Code

mitul-s and others added 2 commits July 3, 2026 20:46
Inline single-use constants in DraggableBorder and make comments
self-contained.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@mitul-s mitul-s requested review from a team and ijjk as code owners July 4, 2026 01:09
@changeset-bot

changeset-bot Bot commented Jul 4, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 59717da

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

This PR includes changesets to release 16 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/core 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

@vercel

vercel Bot commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

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

Project Deployment Actions Updated (UTC)
example-nextjs-workflow-turbopack Ready Ready Preview, Comment Jul 4, 2026 8:02pm
example-nextjs-workflow-webpack Ready Ready Preview, Comment Jul 4, 2026 8:02pm
example-workflow Ready Ready Preview, Comment Jul 4, 2026 8:02pm
workbench-astro-workflow Ready Ready Preview, Comment Jul 4, 2026 8:02pm
workbench-express-workflow Ready Ready Preview, Comment Jul 4, 2026 8:02pm
workbench-fastify-workflow Ready Ready Preview, Comment Jul 4, 2026 8:02pm
workbench-hono-workflow Ready Ready Preview, Comment Jul 4, 2026 8:02pm
workbench-nitro-workflow Ready Ready Preview, Comment Jul 4, 2026 8:02pm
workbench-nuxt-workflow Ready Ready Preview, Comment Jul 4, 2026 8:02pm
workbench-sveltekit-workflow Ready Ready Preview, Comment Jul 4, 2026 8:02pm
workbench-tanstack-start-workflow Ready Ready Preview, Comment Jul 4, 2026 8:02pm
workbench-vite-workflow Ready Ready Preview, Comment Jul 4, 2026 8:02pm
workflow-docs Ready Ready Preview, Comment, Open in v0 Jul 4, 2026 8:02pm
workflow-swc-playground Ready Ready Preview, Comment Jul 4, 2026 8:02pm
workflow-tarballs Ready Ready Preview, Comment Jul 4, 2026 8:02pm
workflow-web Ready Ready Preview, Comment Jul 4, 2026 8:02pm

@mitul-s mitul-s enabled auto-merge (squash) July 4, 2026 01:17
@github-actions

github-actions Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

No backport to stable for 19577b8 (AI decision).

This commit builds a resizable detail panel entirely within packages/web-shared/src/components/new-trace-viewer/, a component directory that does not exist on stable (verified via git ls-tree origin/stable), so the feature has no home there and the cherry-pick of its new files would not apply. The only stable-present change is the removal of a one-line TODO in run-detail-view.tsx, which is meaningful only in the context of the main-only new trace viewer and isn't worth backporting on its own.

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

19577b8d058c24c763b91a2c5ec317e50222cf8c

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