Skip to content

feat: beautified JSON display in Details sidebar with syntax highlighting#539

Merged
datlechin merged 3 commits intomainfrom
feat/beautified-json-details-view
Mar 31, 2026
Merged

feat: beautified JSON display in Details sidebar with syntax highlighting#539
datlechin merged 3 commits intomainfrom
feat/beautified-json-details-view

Conversation

@datlechin
Copy link
Copy Markdown
Collaborator

Summary

  • Auto-pretty-print and syntax-highlight JSON values in the Cell Inspector (Details sidebar) — both read-only and editable modes
  • Content-based JSON detection for TEXT/LONGTEXT/VARCHAR columns storing JSON (not just native JSON/JSONB column types)
  • Extract JSONSyntaxTextView into a reusable component shared between the JSON editor popover and the sidebar
  • Double-clicking a text cell containing JSON now opens the JSON editor popover (same as native JSON columns)

Details

Sidebar rendering (before → after):

Mode Before After
Read-only Raw compact string in plain Text Auto-pretty-printed + syntax highlighted (blue keys, red strings, purple numbers, orange booleans/null)
Editable Plain TextField, manual "Pretty Print" button Auto-pretty-printed + syntax highlighted editor, compacts on save
Menu actions "Pretty Print" (manual) "Compact" + "Copy Formatted"
Context menu "Copy Value" only "Copy Value" + "Copy Formatted"

Content-based JSON detection:

  • New String.looksLikeJson property: only parses values starting with { or [ to avoid false positives with bare primitives
  • Applied in: sidebar (both modes), data grid double-click, inline edit blocking

Test plan

  • Open a table with a native JSON/JSONB column → verify sidebar shows pretty-printed, syntax-highlighted JSON
  • Open a table with a TEXT/LONGTEXT column containing JSON → verify same beautified display
  • Edit a JSON value in the sidebar → verify it compacts on save
  • Double-click a TEXT cell containing JSON → verify JSON editor popover opens
  • Verify non-JSON text values in TEXT columns are unaffected (plain text editor)
  • Test with large JSON (>10K chars) → verify highlighting caps at 10K
  • Test "Copy Formatted" and "Compact" menu actions
  • Verify read-only connections show beautified JSON without edit capability

@datlechin datlechin merged commit c34f2a4 into main Mar 31, 2026
2 checks passed
@datlechin datlechin deleted the feat/beautified-json-details-view branch March 31, 2026 13:04
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.

1 participant