Skip to content

Add formatted JSONL viewer to diagnostics#170

Merged
rajbos merged 4 commits intomainfrom
copilot/update-jsonl-file-viewer
Feb 3, 2026
Merged

Add formatted JSONL viewer to diagnostics#170
rajbos merged 4 commits intomainfrom
copilot/update-jsonl-file-viewer

Conversation

Copy link
Contributor

Copilot AI commented Feb 2, 2026

JSONL session files are newline-delimited JSON objects without array brackets or commas, making them difficult to read and inspect.

Changes

  • Diagnostics UI: Added "Actions" column to session files table with "📄 View" link
  • Extension method: showFormattedJsonlFile() reads JSONL, parses to JSON array, opens in untitled editor with syntax highlighting
  • Message handler: openFormattedJsonlFile command bridges webview to extension

Implementation Details

Transforms this:

{"kind":0,"mode":{"id":"ask"},"model":"gpt-4"}
{"kind":1,"mode":{"id":"agent"}}
{"kind":2,"k":["requests"],"v":[{"requestId":"req1"}]}

Into formatted JSON array in untitled document:

[
  {
    "kind": 0,
    "mode": {
      "id": "ask"
    },
    "model": "gpt-4"
  },
  ...
]
  • Non-destructive: original files never modified
  • Type safe: uses unknown[] instead of any[]
  • Error resilient: malformed lines skipped with line number warnings
  • Auto-refresh: closes stale untitled documents before recreating

Files modified: src/extension.ts (+70 lines), src/webview/diagnostics/main.ts (+17 lines)

Original prompt

The jsonl files are very hard to read, as they are a streaming list of json objects, without the normal array brackets or commas at the end of the line.

I want to update the file viewer for this from the diagnostics view, without overwriting the file. Add the brackets and comma's, and then format the view.

Current contents:

{ object with fields } 
{ object with fields } 
{ object with fields } 
{ object with fields } 
{etc}

💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 2 commits February 2, 2026 18:49
Co-authored-by: rajbos <6085745+rajbos@users.noreply.github.com>
Co-authored-by: rajbos <6085745+rajbos@users.noreply.github.com>
Copilot AI changed the title [WIP] Update file viewer for better jsonl readability Add formatted JSONL viewer to diagnostics Feb 2, 2026
Copilot AI requested a review from rajbos February 2, 2026 18:56
@rajbos rajbos marked this pull request as ready for review February 2, 2026 20:10
@rajbos rajbos enabled auto-merge February 2, 2026 20:10
@rajbos rajbos merged commit 0c5b339 into main Feb 3, 2026
12 checks passed
@rajbos rajbos deleted the copilot/update-jsonl-file-viewer branch February 3, 2026 11:16
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

Comments