[feat] Add beautified JSON view mode with structured rendering for tr…#4189
Merged
ardaerzin merged 2 commits intorelease/v0.96.7from Apr 20, 2026
Merged
Conversation
…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
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
Railway Preview Environment
Updated at 2026-04-20T14:05:21.217Z |
…n-mode-display-behavior
bekossy
approved these changes
Apr 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
jsonfences, 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
Checklist
Contributor Resources