feat(logs): trace span tree rewrite with resizable split, provider icons, and execution improvements#4292
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
PR SummaryMedium Risk Overview Adds a Retry action for failed workflow executions (context menu + sidebar), including input reconstruction via Includes smaller polish/fixes: parallelized environment variable decryption, Turnstile site-key initialization cleanup, resource table scrollbar/column sizing, credentials manager save feedback + conflict-row editability adjustments, and SAP S4HANA branding/color updates; also adds Reviewed by Cursor Bugbot for commit c19b4e8. Configure here. |
Greptile SummaryThis PR is a substantial rewrite of the trace span pipeline and log details UI: it splits the old monolithic Confidence Score: 5/5Safe to merge — no P0/P1 issues found; all previously-flagged bugs have been addressed in follow-up commits. All six issues identified in prior review threads (cost aggregation, streaming extension dead code, iteration name false-positives, workflowInput field, fire-and-forget cost race, and synthetic root cost) are confirmed fixed. The two new findings are both P2: a silent no-op in the stream-trigger pattern if res.body is null, and an eslint-suppressed empty dependency array in retryLog. Neither is reachable in normal operation. apps/sim/hooks/queries/logs.ts — stream-trigger null-body guard in useRetryExecution Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[BlockLog array] --> B[buildRootSpansFromLogs\ncreateSpanFromLog per log]
B --> C{isConditionBlock?}
C -- No --> D[enrichWithProviderMetadata\ntokens / cost / model]
C -- Yes --> E[createBaseSpan only]
D --> F{hasTimeSegments?}
F -- Yes --> G[buildChildrenFromTimeSegments\nmodel + tool child spans\nfinal-segment extension]
F -- No --> H[buildChildrenFromToolCalls\ntool children from output.toolCalls]
G --> I[TraceSpan with children]
H --> I
E --> I
I --> J[groupIterationBlocks\nrecursive iteration grouping\nparentIterations chain]
J --> K{result.metadata?}
K -- Yes --> L[wrapInWorkflowRoot\nworkflowSpan with cost aggregate]
K -- No --> M[flat span list]
L --> N[TraceView\ntree pane + detail pane\nresizable split]
M --> N
style G fill:#6366F1,color:#fff
style J fill:#8B5CF6,color:#fff
style L fill:#10B981,color:#fff
Reviews (9): Last reviewed commit: "fix(queries): forward AbortSignal in mot..." | Re-trigger Greptile |
|
@greptile |
|
@cursor review |
|
@greptile |
|
@cursor review |
|
@greptile |
|
@cursor review |
f27fa02 to
2303a71
Compare
|
@greptile |
|
@cursor review |
|
@greptile |
Chevron at depth 0 and the timeline bars now sit on the same 14px left/right grid as the trace view's header strip and the rest of the log details panel, removing the stagger where bars extended further left than chevrons and the chevron appeared cramped against the panel edge. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Overview tab's scroll container (SModalTabsContent) was wrapped around a non-overflow inner div that held the scrollAreaRef, so the scroll-reset on log change targeted a non-scrolling element. Collapse the wrapper into the Tabs.Content element itself and move the ref there. Add min-h-0 to the Trace detail pane wrapper so its scrolling child can shrink inside the horizontal-flex row.
Tailwind's `.flex` utility overrides the UA `[hidden]` rule, so applying `flex` to SModalTabsContent caused the inactive Overview panel to still participate in the Tabs flex column and push the Trace view down. Keep SModalTabsContent as a plain overflow container (no `flex` class) with the scroll ref on it, and restore the inner flex-col wrapper for the Overview content so it still stacks with gap spacing.
- Tree pane now has top padding so the first row has breathing room under the header strip instead of sitting flush against the border. - DetailCodeSection dropped its wrapper `overflow-hidden`. Per CSS, a flex item with `overflow: hidden` resolves `min-height: auto` to `0`, so when Input and Output were both expanded the flex algorithm shrank each section below its content, cutting off rows. Without the clip, sections size to content and the surrounding pane's `overflow-y-auto` takes over. - Selected span row now scrolls into view on selection change, so arrow-key navigation always keeps the active row visible in the tree pane.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
…, cleanup - Resizable tree/detail split in trace view (default 360px, drag to resize) - Resizable right panel in preview snapshot (280–600px) - Fix Gantt bar invisibility for late-run spans (clamp offsetPct to 100-MIN_BAR_PCT) - Propagate model+provider to child model spans in span-factory for correct icons - Fix icon contrast on light provider backgrounds (luminance-based color class) - Replace custom status badges with emcn Badge component - Lighten jump-to-error button to ghost variant - Remove double X button in modal snapshot (showBlockCloseButton prop) - Fix emcn subpath imports → barrel in trace-view, log-details, execution-snapshot - Fix hover: → hover-hover: on resize handles - Add body style cleanup on resize unmount - Fix React Query key factory naming (stats/stat convention) - Remove unnecessary useCallback/useMemo in preview and execution-snapshot
- logs: only scroll-into-view on keyboard nav, not on click selection - resource: stable scrollbar gutter, wider first column - credentials: toast success/error feedback, remove useMemo for personalEnvData, allow editing conflict rows, fix disabled state visibility, use --text-error token - integrations: use --text-error token for error state - input: increase right padding (px-2 → pl-2 pr-3)
…kens, simplify state
…stuck button Sequential per-variable, per-workspace DB round-trips in syncPersonalEnvCredentialsForUser caused O(W×K) latency (800–1600ms for 10 workspaces). Replaced with parallel workspace processing and batched upserts. Also parallelized secret decryption in the GET handler. On the client, removed the changeToken bug that left the Save button permanently disabled after a failed save, split the shared hasSavedRef into two independent flags to eliminate ordering races, and moved ref updates to after mutation success so optimistic state can never get stuck.
…TabChange callback
…nup effects, memos, callbacks, React Query mutations
…on rowProps - resource-content.tsx: revert render-time setActiveWorkflow call to useEffect; the store action is async and performs network ops, calling it during render violates React purity - logs-list.tsx: restore useMemo on rowProps to prevent virtualized list rows from re-rendering on every parent render
All queryFn callbacks must forward signal for request cancellation per project React Query standards.
9dc4f34 to
e978cb5
Compare
Summary
Type of Change
Testing
Tested manually with runs containing agents, loops, parallels, nested workflows, and error paths.
Checklist