Skip to content

[feat] Add beautified JSON view mode with structured rendering for tr…#4189

Merged
ardaerzin merged 2 commits intorelease/v0.96.7from
feature/age-3738-fix-rendered-json-mode-display-behavior
Apr 20, 2026
Merged

[feat] Add beautified JSON view mode with structured rendering for tr…#4189
ardaerzin merged 2 commits intorelease/v0.96.7from
feature/age-3738-fix-rendered-json-mode-display-behavior

Conversation

@ardaerzin
Copy link
Copy Markdown
Contributor

Summary

Fix the trace drill-in viewer's JSON mode that was silently rendering chat bubbles instead of JSON. The mode now shows data in the JSON code editor after decoding LLM/instrumentation artifacts: unwraps nested stringified JSON, decodes escaped \n/\r\n, strips json fences, and tolerates JSON5 syntax.
Add a new Beautified JSON mode that preserves the previous chat-rendering behavior (chat bubbles, per-key fields, envelope unwrap, provider-metadata stripping). It's the default for viewModePreset="message".
Rename the mode from the old ambiguous "Rendered JSON" to Decoded JSON — "rendered" invited the misreading that caused the original regression.
Extract shared decoding helpers into decodedJsonHelpers.ts so TraceSpanDrillInView and AccordionTreePanel can't drift again; the duplicated pipeline was the root cause.
Add VIEW_MODES.md plus JSDoc on both mode unions as the authoritative reference for mode semantics, display targets, defaults, and change-safety rules.

Demo

Screenshot 2026-04-20 at 13 48 31 Screenshot 2026-04-20 at 13 48 36 Screenshot 2026-04-20 at 13 48 54

Checklist

  • I have included a video or screen recording for UI changes, or marked Demo as N/A
  • Relevant tests pass locally
  • Relevant linting and formatting pass locally
  • I have signed the CLA, or I will sign it when the bot prompts me

Contributor Resources

…ace spans

- Replace `rendered-json` mode with `beautified-json` and `decoded-json` modes
- Extract JSON parsing/decoding helpers to `decodedJsonHelpers.ts`
- Move beautified rendering logic to `BeautifiedJsonView.tsx` component
- Add `VIEW_MODES.md` documentation for all display modes
- Update mode selection logic to support `viewModePreset="message"` preference
- Normalize escaped line breaks and unwrap nested stringified JSON in
@linear
Copy link
Copy Markdown

linear bot commented Apr 20, 2026

@ardaerzin ardaerzin requested a review from bekossy April 20, 2026 11:49
@vercel
Copy link
Copy Markdown

vercel bot commented Apr 20, 2026

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

Project Deployment Actions Updated (UTC)
agenta-documentation Ready Ready Preview, Comment Apr 20, 2026 0:55am

Request Review

@ardaerzin ardaerzin marked this pull request as ready for review April 20, 2026 11:50
@dosubot dosubot bot added size:XXL This PR changes 1000+ lines, ignoring generated files. documentation Improvements or additions to documentation Feature Request New feature or request Frontend labels Apr 20, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 20, 2026

Railway Preview Environment

Status Destroyed (PR closed)

Updated at 2026-04-20T14:05:21.217Z

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Apr 20, 2026
@ardaerzin ardaerzin merged commit b4c6a04 into release/v0.96.7 Apr 20, 2026
25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation Feature Request New feature or request Frontend lgtm This PR has been approved by a maintainer size:XXL This PR changes 1000+ lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants