Repository navigation
Web UI: pretty-print and highlight the value of a selected JSON cell - #118640
Conversation
Clicking a cell of a `JSON` column in `play.html` now shows the value pretty-printed with two-space indentation, one member per line, with keys, strings, numbers and the literals `true`, `false`, `null` highlighted. The compact one-line form is restored when the selection leaves the cell, and stays the value used for copying and filtering. The pretty form is built lazily for the selected cell only (`_expandJSON`), from the compact text the cell already holds, which is the same on the page's default `JSONCompactStrings` format (the value arrives as JSON text) and on the `JSON` format (a parsed object). The expanded overlay of a selected cell is color-inverted, so the pretty-printed block inverts itself back and takes its palette from new `--json-*` variables defined per theme. Co-Authored-By: Claude Fable 5.1 <[email protected]>
|
Workflow [PR], commit [afb2e86] Summary: ✅
AI ReviewSummaryThis PR adds lazy pretty-printing and syntax highlighting for selected Final Verdict
LLVM Coverage ReportMeasured on commit afb2e86.
Changed lines: Uncovered code analysis did not run: No coverable C/C++ source files changed (contrib/ is excluded from coverage). Newly covered: +154 lines in 55 files (-133 lines lost coverage) · Details |
A result header can carry the same output name more than once, and both the row lookup and the per-column type flags are keyed by that name, so a `JSON` namesake of a non-`JSON` column tagged the latter's cells with `_jsonText`; selecting one of them then sent plain text through `JSON.parse` in `_expandJSON`, which threw. Withhold the tag for a duplicated name, the way sort and filter are already withheld from it (`duplicateColumnNames`), so the compact form simply stays. The test pins the guarded line. Co-Authored-By: Claude Fable 5.1 <[email protected]>
…ry lexeme `prettyPrintJSON` rendered the value after a round trip through `JSON.parse`, so the selected view could show a different document than the compact cell: numbers became IEEE-754 doubles (`9007199254740993` shown as `9007199254740992`, `1e309` as the non-JSON `Infinity`), strings were re-escaped, a repeated key was dropped and integer-like keys moved first. It now walks the original text with a small recursive-descent parser that copies every scalar lexeme verbatim and only changes the whitespace; text that is not JSON throws a `SyntaxError`, as before. The new integration test `test_play_json_pretty_print` executes the real `prettyPrintJSON` from the served page in Node.js (the same setup as `test_play_result_shaping`) and checks the layout, the verbatim value, the highlighting spans and the rejection of invalid text; against the previous implementation 7 of its checks fail. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Build profile diff (arm_release)Comparing ✅ No significant changes. Binary sizes
The official master build is compiled with Compile time of recompiled translation units6 translation units recompiled, 4 s compile time in total, 6 of them have a recent master baseline. |
|
🕵 @groeneai, investigate the failure: https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?PR=118640&sha=45040ff94059e5e8e1517a06d189c2878bb81235&name_0=PR&name_1=Stress%20test%20%28arm_release%29 (segmentation fault in |
|
Investigated. This is STID 2650-47a4, fixed by my #119387 (merged 2026-10-01). The run tested The crashed query is the remote side of an internal Measured with that table and #122589 is a different crash: |
In the Web UI (
play.html), clicking a cell of aJSONcolumn now shows the value pretty-printed with two-space indentation, one member per line, with keys, strings, numbers and the literalstrue,false,nullhighlighted. The compact one-line form is restored when the selection leaves the cell, and stays the value used for copying and filtering.The pretty form is built lazily for the selected cell only, from the compact text the cell already holds, which is the same on the page's default
JSONCompactStringsformat (the value arrives as JSON text) and on theJSONformat (a parsed object). The expanded overlay of a selected cell is color-inverted, so the pretty-printed block inverts itself back and takes its palette from new--json-*variables defined per theme, modelled on theclickhouse-clientcolors.Light theme:
Dark theme:
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Web UI: clicking a cell of a
JSONcolumn pretty-prints the value with two-space indentation and syntax highlighting.Workflow [PR]
Sync PR [sync-upstream/pr/118640]
Version info
26.10.1.1413-master(included in26.10and later)