Skip to content

Use vue-json-pretty for collapsible JSON views - #86

Merged
wparad merged 1 commit into
mainfrom
claude/json-rendering-collapsible-47i5ib
Aug 26, 2026
Merged

Use vue-json-pretty for collapsible JSON views#86
wparad merged 1 commit into
mainfrom
claude/json-rendering-collapsible-47i5ib

Conversation

@wparad

@wparad wparad commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Replaced the raw <pre>{{ JSON.stringify(..., null, 2) }}</pre> dumps (Thread/Signal in AdminView, and the signal-object modal in EmailSignalCard) with a new shared src/components/ui/JsonView.vue wrapper around vue-json-pretty, a maintained Vue 3 JSON tree component — instead of hand-rolling collapse/expand state.
  • JsonView exposes a collapsedKeys prop (defaults to ['body']) so any attribute by name starts collapsed: objects/arrays collapse via vue-json-pretty's pathCollapsible hook, and long string values (like email body) truncate behind a "click to expand" toggle via a custom renderNodeValue renderer.
  • Styled to match the app's Catppuccin Mocha theme (--ctp-* CSS variables) so it's visually consistent with the rest of the UI.
  • EmailSignalCard's signal-object modal now stores the parsed Signal object (for the tree view) and derives the stringified JSON via a computed for the existing "Copy" button.

Test plan

  • npx vue-tsc --noEmit
  • npx eslint on changed files (0 warnings)
  • npx vitest run — full suite (509 tests) passes
  • npm run build — production build succeeds, JsonView code-splits into its own chunk

Generated by Claude Code

Replace the raw <pre>JSON.stringify()</pre> dumps in AdminView and
EmailSignalCard's signal-object modal with a shared JsonView component
built on vue-json-pretty. Attributes named in collapsedKeys (defaults
to ["body"]) collapse automatically via pathCollapsible for
objects/arrays and a custom renderNodeValue truncation for long
strings, instead of hand-rolling tree collapse state.
@github-actions

Copy link
Copy Markdown

@wparad
wparad merged commit 0a28360 into main Aug 26, 2026
3 checks passed
@wparad
wparad deleted the claude/json-rendering-collapsible-47i5ib branch August 26, 2026 16:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants