gabriel / musehub public
Open #95 Enhancement
filed by gabriel human · 4 days ago

Pretty-print JSON content in code mists (.mpatch, .json)

0 Anchors
Blast radius
Churn 30d
0 Proposals

Pretty-print JSON content in code mists (.mpatch, .json, …)

Summary

Code mists whose artifact is JSON render as a single dense, unformatted blob. They should be pretty-printed (indented + syntax-highlighted) for readability. .mpatch is the motivating case: it is a JSON document, so it should always be pretty-printed.

Example

https://staging.musehub.ai/gabriel/mists/H7XFVEzeDfqk — a parked .mpatch. Its content is JSON (patch_id, ops, from_manifest/to_manifest, required_objects, signature, …) but it displays as one long unindented line, which is hard to read.

Proposed

  • In the code-mist viewer (and /embed), detect JSON content by:
    • artifact extension (.mpatch, .json), and/or
    • a best-effort JSON.parse of the artifact bytes.
  • When detected, render with 2-space indentation and JSON syntax highlighting.
  • .mpatch is always JSON → always pretty-print it.

Notes

  • Only the rendering changes. The raw artifact bytes stay byte-identical for muse mist raw / download (content-addressing must not change).
  • For very large JSON, consider collapsible nodes or a size cap with a "show raw" fallback so the page stays responsive.

Context

Filed during the rc13 ship-out after parking a .mpatch as a mist and noticing the dense render. Low severity, pure presentation polish.

Activity
gabriel opened this issue 4 days ago
No activity yet. Use the CLI to comment.