From 867471c7d3bbf3d18362d7d73fa5ce10842e8fa9 Mon Sep 17 00:00:00 2001 From: Charles Bine Date: Wed, 24 Jun 2026 12:38:44 -0400 Subject: [PATCH 1/2] fix(#484): drop noisy "parse failed" note on JSON/YAML fragments MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit LLMs routinely emit JSON/YAML *fragments* in fenced blocks — a bare `"key": "value"` line, snippets with `...`, trailing commas — which legitimately fail JSON.parse. initTreeViews() stamped an unstyled `
parse failed
` below such blocks, producing bare white text under an otherwise-clean code box. The note was incidental, not designed: it was bolted onto the YAML lazy-load commit (29a31a6e), has no CSS, no behavior test, and originally even fired on *valid* YAML before the CDN script finished loading (later fixed). The block still renders as syntax-highlighted raw, so the note added only noise. Remove the note insertion; fall through silently to raw view. The per-block Raw/Tree toggle, YAML lazy-load, and the #484 default-view config are all unchanged. The `parse_failed_note` i18n key is intentionally retained (kept green by test_chinese_locale.py) to avoid touching all 13 locales. Verification: ./scripts/test.sh tests/test_issue484_json_tree_viewer.py tests/test_chinese_locale.py — 29 passed. --- static/ui.js | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/static/ui.js b/static/ui.js index 45252c98..7f0a191a 100644 --- a/static/ui.js +++ b/static/ui.js @@ -13636,15 +13636,12 @@ function initTreeViews(container){ // Mark as initialised only after we've committed to a render decision wrap.setAttribute('data-tree-init','1'); if(!parsed || typeof parsed!=='object'){ - if(parseFailed){ - const hint=wrap.querySelector('.tree-raw-view'); - if(hint&&!hint.querySelector('.tree-parse-note')){ - const note=document.createElement('div'); - note.className='tree-parse-note'; - note.textContent=t('parse_failed_note')||'parse failed'; - hint.parentNode.insertBefore(note,hint.nextSibling); - } - } + // No tree view for non-object values or unparseable content. LLMs often + // emit JSON fragments (a bare "key": "val" line, snippets with ..., etc.) + // that legitimately fail JSON.parse; surfacing a "parse failed" note for + // those was pure noise. The block still renders as syntax-highlighted raw, + // so just fall through silently. (parseFailed is retained for clarity.) + void parseFailed; return; // leave as raw view } const lineCount=rawText.split('\n').length; From 71a436c607ba59afcf187934dcc1276b0a2a2780 Mon Sep 17 00:00:00 2001 From: nesquena-hermes Date: Wed, 24 Jun 2026 22:24:38 +0000 Subject: [PATCH 2/2] Release WP (v0.51.635): drop noisy parse-failed note on JSON/YAML fragments (#4858, #484) --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index d6c7893b..c51e5bbf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,12 @@ ## [Unreleased] +## [v0.51.635] — 2026-06-24 — Release WP (no more "parse failed" note under JSON/YAML fragments) + +### Fixed + +- **JSON/YAML code blocks that aren't valid top-level documents no longer show a bare "parse failed" note.** The chat renderer's Tree-view affordance stamped an unstyled `parse failed` line below any fenced block it couldn't `JSON.parse` — but assistants routinely emit fragments (a bare `key: value` line, `…` snippets, trailing commas) that legitimately don't parse, so the note was pure noise under an otherwise-clean code box. Those blocks now fall through silently to the normal syntax-highlighted raw view; the per-block Raw/Tree toggle and the configurable default-view behavior are unchanged. Thanks @metaember. (#4858, #484) + ## [v0.51.634] — 2026-06-24 — Release WO (faster profile list — skill stats are cached with an mtime probe) ### Fixed