1.6 KiB
1.6 KiB
093 — Log-line JSON viewer should default to collapsed, not expanded
Summary
When a log line's text parses as a JSON object, the frontend renders it via a collapsible tree view — but every node starts expanded, so a line with a large JSON payload dumps its entire structure into the timeline by default instead of showing a collapsed summary the user opts into expanding.
Where
webapp/src/components/LogPreview.tsx:97-107—JsonValueViewrecursively renders JSON values, delegating objects/arrays toJsonNode.webapp/src/components/LogPreview.tsx:109-156—JsonNoderenders a collapsible subtree with a ▾/▸ disclosure toggle. Default state is set at line 116:useState(true), i.e. expanded. Each nested object/array has its own independentexpandedstate.webapp/src/components/LogPreview.tsx:160-164—LogMessageis the per-row entry point: parses the line viatryParseJsonObject(:82-94) and renders throughJsonValueViewwhen it succeeds.- Empty objects/arrays already short-circuit to plain
{}/[]with no toggle (:118-125) — unaffected by this change.
Scope
- Flip the default in
JsonNode(LogPreview.tsx:116) fromuseState(true)touseState(false)so JSON subtrees render collapsed until the user clicks to expand. - Since expand state is per-node (not shared across the tree), this
changes every node in a JSON log line's tree independently — confirm
that's the intended look (top-level object collapsed with
{...}rather than only nested children collapsing) rather than needing a "expand root, collapse children" split default.