Skip to content

feat: add JSON results view mode#867

Merged
datlechin merged 3 commits intomainfrom
feat/json-results-view
Apr 25, 2026
Merged

feat: add JSON results view mode#867
datlechin merged 3 commits intomainfrom
feat/json-results-view

Conversation

@datlechin
Copy link
Copy Markdown
Member

Summary

Closes #856

Adds a first-class JSON view mode to the results area, following Apple's view mode pattern (like Finder's List/Icon/Column or Xcode's plist Source/Property List toggle).

  • Replaces showStructure: Bool with ResultsViewMode enum (.data, .structure, .json)
  • Table tabs: Data / Structure / JSON segmented picker in status bar
  • Query tabs: Data / JSON picker (no Structure for queries)
  • Reuses existing JSONViewerView (text + tree modes) and JsonRowConverter (type-aware serialization)
  • Shows selected rows only when a selection exists, all rows otherwise
  • Read-only with Copy JSON button
  • Per-tab state (switching tabs preserves view mode)

Test plan

  • Table tab: status bar shows [Data] [Structure] [JSON], click JSON to see formatted JSON
  • Query tab: run a query, status bar shows [Data] [JSON]
  • Select 2-3 rows in Data mode, switch to JSON, verify only selected rows shown
  • Deselect all, switch to JSON, verify all rows shown
  • Toggle Text/Tree modes in JSON viewer toolbar
  • Click Copy JSON, paste in editor, verify valid JSON with correct types
  • Empty query tab (no results): JSON shows "No Data" placeholder
  • Switch between tabs, verify JSON mode is per-tab
  • Structure view still works as before

@datlechin datlechin merged commit 8ce8737 into main Apr 25, 2026
2 checks passed
@datlechin datlechin deleted the feat/json-results-view branch April 25, 2026 09: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.

Option to view row data as JSON

1 participant