Skip to content

feat(ui): share trace drawer as a closable SidePanel and polish Lens - #44473

Merged
yujonglee-berri merged 20 commits into
mainfrom
litellm_lens_side_panel
Oct 4, 2026
Merged

yujonglee-berri merged 20 commits into
mainfrom
litellm_lens_side_panel

Conversation

@devin-ai-integration

@devin-ai-integration devin-ai-integration Bot commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

TLDR

Problem this solves:

  • The trace run drawer implemented resize, dismissal, and width persistence inline, so no shared side panel existed for other views
  • The Lens Traces/Investigations mode switch floated beside the card instead of being joined to it
  • Clicking outside the trace drawer did nothing, and an empty runs table showed no setup guidance
  • The runs toolbar grew into separate search, agent, and status controls that each keystroke re-rendered and three URL params
  • In dev, a non-JSON proxy response surfaced as a cryptic JSON parse error

How it solves it:

  • Extracts the drawer into components/shared/SidePanel: outside press closes it, panel triggers keep it open, drag/arrow-key resize with clamped min width, width persisted to localStorage, exit animation preserved
  • RunDrawer now renders through SidePanel instead of owning the chrome
  • Centers the Lens mode switch in a notch joined to the content card and shows a running/queued activity dot on the Investigations tab
  • Moves "Set up tracing" into the empty runs state, offered both when the range is empty and when filters hide every run
  • Centers Lens loading and error states; dev rewrites forward JSON content-type requests to the proxy; the API client throws a clear ApiError naming the path and returned content type when JSON was expected
  • Swaps arbitrary Tailwind values for theme-scale type and shape tokens across trace views and aligns pane bars, enforced by a new local/no-arbitrary-design-value eslint rule plus a tailwind-utility helper rule
  • Marks Lens demo mode with a blue toggle and a blue frame border around the card and notch instead of the "You're viewing demo data" banner
  • Drops the timeline's header strip (live pulse, run/agent counts, agent legend, range span) that repeated the Live toggle, runs table, and range picker
  • Keeps the drawer's J/K/Escape shortcuts from firing while a menu or listbox is open inside the panel
  • Opens an investigation's details when its row is clicked instead of the edit dialog, which moves to an explicit pencil button
  • Keeps the previous trace visible (dimmed and inert) while the next one loads instead of flashing a loading skeleton
  • Virtualizes the runs table with @tanstack/react-virtual so only rows near the viewport render as more pages load
  • Drops the runs footer, whose count only tracked loaded pages and whose "Updated just now" never changed; the zoom clear button moves onto the timeline
  • Replaces the agent and status dropdowns and search field with one ProseMirror query box: free text plus key:value clauses (-key:value negation, key:*glob* wildcards) over name, agent, status, model, input, and trace_id, with field and value autocomplete and a 150ms debounced emit; the URL keeps only q

Intentional product change: the trace drawer now closes when you press outside it, "Set up tracing" appears inside the empty runs table instead of above it, the Lens mode switch is centered in a notch connected to the card below, demo mode is marked by a blue toggle and frame instead of a banner line, the timeline's header strip is removed, the agent/status dropdowns are replaced by a single query box, and the runs footer is removed

User Flow

Before: an admin reviewing runs in Lens could only dismiss the drawer through its own controls and got no setup guidance on an empty table

  1. They open https://litellm-domain/ui/lens/?tab=traces and click a run; the drawer opens on the right
  2. They click the runs list behind the drawer expecting it to dismiss; nothing happens until they press Escape or click the close control
  3. To find failed runs of one agent they open the agent dropdown, pick the agent, then open the status dropdown and pick error; the URL gains agent and status params
  4. They pick a time range with no runs; the table renders empty and the "Set up tracing" card sits elsewhere on the page
  5. Running the dev dashboard against a proxy that returns an HTML error page, the page fails on JSON.parse with a cryptic syntax error

After: the same review flow dismisses naturally, filters become one query, and an empty range shows the setup path in place

  1. They open https://litellm-domain/ui/lens/?tab=traces and click a run; the drawer opens on the right
  2. They click the runs list behind the drawer; it closes, and clicking another run swaps the panel to that run
  3. To find failed runs of one agent they type agent:research status:error in the query box (autocomplete offers fields and values); the URL keeps only q
  4. They pick a time range with no runs; the table itself shows "Set up tracing" with the setup card inline
  5. Running the dev dashboard, a non-JSON proxy response now throws an error naming the path and the content type returned

Pre-Submission checklist

  • Added and updated tests for the shared panel, drawer behavior, non-JSON API errors, eslint rules, run query parsing, suggestions, and Lens integrations
  • Kept changes scoped to the dashboard UI
  • Current-tip required CI and coverage pass
  • Greptile confidence is at least 4/5 before maintainer review

Link to Devin session: https://app.devin.ai/sessions/d46fbba3b52b4edb9a80edf15a0d27bc
Open in Devin Desktop: https://app.devin.ai/desktop/session/d46fbba3b52b4edb9a80edf15a0d27bc?variant=devin
Requested by: @yujonglee-berri

yujonglee-berri and others added 9 commits October 3, 2026 18:08
… outside press

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Larger Traces/Investigations switch, a subtle dot when an investigation is running or queued, and a bigger Lens title with a docs link.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The dev server answered GET /lens with the Lens page HTML because the UI route shadowed the proxy fallback rewrite. JSON API requests now go to the proxy before page routes, and a non-JSON success body raises a readable ApiError.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… bars

Add local/no-arbitrary-design-value, scoped to TraceView and Lens, banning
arbitrary font size, tracking, leading, radius, border and CSS property
values. Map the Figma-export values onto the theme scale and replace hex
colors with info/destructive tokens.

Add PaneBar, a fixed-height bordered row, and build the step tree and span
detail headers from it so their borders line up across the split.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".

  • Disable automatic comment, CI, and merge conflict monitoring

yujonglee-berri and others added 2 commits October 3, 2026 18:26
… a banner

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…o frame

The SVG corner strokes did not snap to the same device pixels as the tab and
card borders, leaving a visible offset at the join.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@greptile-apps

greptile-apps Bot commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

[Medium risk] Refactors trace UI components and adds new search and editor dependencies.

The PR appears safe to merge based on the reviewed changes and resolved prior findings.

Summary

The PR extracts a shared closable trace side panel, adds virtualized runs and a unified query box, and updates Lens navigation, empty states, and styling.

  • Changes since the previous review add keyboard activation for investigation rows and replace regex-based wildcard matching with a non-backtracking matcher.
  • No new actionable issue was established.

Reviews (3) · Last reviewed commit: "fix(ui): harden Lens investigation and r..."

Comment thread ui/litellm-dashboard/src/components/shared/SidePanel.tsx Outdated
Comment thread ui/litellm-dashboard/src/components/shared/SidePanel.tsx Outdated
Comment thread ui/litellm-dashboard/src/components/view_logs/TraceView/SpanTree.tsx Outdated
yujonglee-berri and others added 8 commits October 3, 2026 18:38
The status, run counts, truncated agent legend and range span all repeated the Live toggle, runs table and range picker

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…for timers and observers

SidePanel J/K/Esc now yields to menus and listboxes, not just dialogs.
The step tree shortcut footer wraps instead of clipping in narrow columns.
Replace hand-rolled timeout, keydown, media query and ResizeObserver effects
with usehooks-ts, and drop routine doc comments.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Agent and status dropdowns are gone. One query box (react-prosemirror) takes
free text plus key:value clauses (-key:value, key:*glob*) over name, agent,
status, model, input and trace_id, with field and value autocomplete. The
editor emits after a 150ms pause so typing no longer re-renders the runs view
per keystroke, and the URL keeps only q.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Switching to an unvisited trace remounted the panel and flashed a loading skeleton.
The drawer now keeps the previous trace visible, dimmed and inert, until the new one arrives.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The footer's run count only tracked how many pages had loaded and
"Updated just now" never changed, so it carried no signal. The zoom
clear button moves onto the timeline. Rows now render through
@tanstack/react-virtual so scrolling deep into a range stays cheap

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… useDeferredValue

Replaces keepPreviousData with the React pattern for showing stale content while fresh content loads.
Load failures go through an error boundary that retries the query on reset.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…t dialog

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@yujonglee-berri
yujonglee-berri enabled auto-merge (squash) October 4, 2026 01:59
@yujonglee-berri

Copy link
Copy Markdown
Contributor

@greptile-apps wdyt

Comment thread ui/litellm-dashboard/src/components/lens/runSearch/runQuery.ts Outdated
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

@greptileai review

@yujonglee-berri
yujonglee-berri merged commit 5ddcc45 into main Oct 4, 2026
105 checks passed
@yujonglee-berri
yujonglee-berri deleted the litellm_lens_side_panel branch October 4, 2026 02:20
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