Open
#95
Enhancement
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.parseof the artifact bytes.
- artifact extension (
- When detected, render with 2-space indentation and JSON syntax highlighting.
.mpatchis 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
No activity yet. Use the CLI to comment.