Skip to content

[Feature]: Trace Viewer - allow expanding or copying full "Return value" in Call tab #40527

@ivelev96

Description

@ivelev96

🚀 Feature Request

Description

The trace viewer's Call tab truncates object return values to 1000 characters via JSON.stringify(value).slice(0, 1000) in packages/trace-viewer/src/ui/callTab.tsx. When a return value exceeds this limit, the rendered text is silently cut off with no indication that data is missing and no way to access the full value.

This was introduced as a side change in PR #22201 (0d31d69) - the commit that added the trace loading progress bar. The truncation was added to prevent the UI from choking on large serialized objects, which is reasonable, but there is currently no way to view the full value.

The relevant code:

  return { text: JSON.stringify(value).slice(0, 1000), type: 'object', name };

Suggestions

  1. Minimal: Add an ellipsis indicator (…) when a value is truncated, so users at least know data is missing (similar to how metadataView.tsx already does valueString.slice(0, 1000) + '\u2026').
  2. Better: Add a "Copy full value" button next to truncated return values — the full data is already in the trace, it just needs a UI affordance. This would be consistent with the existing copy buttons added in
    PR feat(trace-viewer): add parameters copy to clip #19662.
  3. Best: Make the value expandable/collapsible inline (similar to browser DevTools object inspection), or make the 1000-char limit configurable.

Workaround: Extract the trace.zip from the test results. Also response bodies are stored as JSON files under resources/ , and the complete return values are in the 0-trace.trace file (line-delimited JSON, look for "type": "after" events)

Example

The raw trace file (0-trace.trace) contains the full untruncated result (~1200 chars in my case), but the Call tab shows only the first 950 characters (maybe some hidden chars are present) with no visual indication that the value was truncated.

Motivation

When debugging API test failures, the return value in the Call tab is often the primary thing you inspect. Having it silently truncated makes the trace viewer less useful - you don't even know data is missing unless you compare against the raw trace file.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions