Repository navigation
Conversation
Automated AI review
Verified: The Verified: Checked in Node and in Qt's QML engine (run with
The PR includes the launch-editor change from #13044Commit The same commit keeps the Impact: Merging this PR would land the #13037 change under a menu-fix title, without closing #13037, and would make #13044 redundant. Other open PRs also change Suggested change: Drop commit NotesOptional test improvement: Related PRs: #13255 (opened by the reporter of #13250) makes the same string-aware comma change. Its output matched this PR's on every generated and random input in Node. #6525 rewrites the same Review informationTest scope: Pinned head
AI process: Opus 5.5 Medium coordination and synthesis, Opus 5.5 Xhigh technical review and final fact check, GPT 6 Sol Xhigh search for related issues, Opus 5.5 Medium editorial check. Opt out: To stop receiving these reviews, reply to this comment saying so. |
|
Heads-up: this and #13255 fix the same issue (#13250) with the same approach — a string-aware single-pass replacement for the trailing-comma regex. We diff-tested this PR's head against #13255's on the edge corpus (labels and actions with So whichever lands first, the other is redundant — no competition intended; we filed #13250 and sent #13255, and we're equally happy to see this one merge instead. One coordination note: both PRs compose with #6525 (inline comments) only if comment stripping runs before the comma scan — whoever rebases last should keep that order. Nice work — the equivalence held on every input we threw at it. Cross-check run with Proof. |
|
The Also, #13968 fixes the same commas-in-strings bug and also handles array roots and inline comments, and #13681 overlaps too. It's worth checking with the maintainers which one they want, so three parsers don't land. |
…strings (omacom#13250) The `stripJsonc` utility in `MenuModel.js` attempts to allow trailing commas by removing any comma followed immediately by `}` or `]` (with optional whitespace). Because its regex was not string-aware, it also matched the sequence `, ]` inside string values, such as menu labels, corrupting them. This rewrites the trailing-comma removal step as a simple string-aware character loop. Line comments are still stripped by regex beforehand. Closes omacom#13250
bcd1ee3 to
3d4b930
Compare
[Medium impact] The PR appears safe to merge. SummaryThe menu parser now preserves commas inside quoted labels and commands while still removing trailing commas outside strings.
Reviews (2) · Last reviewed commit: "Exercise a single escaped quote in the c..." · Reviewed by Greptile |
Carry the four omacom#13250 regression assertions from omacom#13968: preserve commas in labels and actions while checking escaped quotes, escaped backslashes and actual trailing commas. They catch a return to the string-blind regex without pulling the separate comment-parser changes into this fix. Co-Authored-By: Leonid Bugaev <leonsbox@gmail.com> Co-Authored-By: GPT-6 High <noreply@openai.com> Co-Authored-By: Opus 5.5 High <noreply@anthropic.com> Co-Authored-By: muse-wonder via pi, thinking high <noreply@users.noreply.github.com>
Paired escaped quotes toggle string state twice, so a scanner that ignores backslashes can still preserve the following comma. A single escaped quote makes that mistake strip the comma and fail the assertion. Co-Authored-By: GPT-6 High <noreply@openai.com> Co-Authored-By: Opus 5.5 High <noreply@anthropic.com> Co-Authored-By: muse-wonder via pi, thinking high <noreply@users.noreply.github.com>
|
Added four regression assertions from @buger's #13968 in The cropped captures show the real menu opened through The full Checked by GPT-6 High in Codex, with reviews by Opus 5.5 High and muse-wonder via pi, thinking high. Both reviewers found the final head clean; review independence is not guaranteed. #13968 and #16195 also fix this comma bug while changing other behavior. #6525 and #13803 overlap the scanner but retain the string-blind comma regex; any conflict resolution involving them needs to preserve these regression cases. The other parser changes were kept out of this PR. Waiting for maintainer review. |


Closes #13250
Description
The
stripJsoncutility inMenuModel.jscleans trailing commas to permit JSONC format, but its naive regex (/,(\s*[}\]])/g) would also silently strip commas inside string values (like menu labels) if they happened to be followed by]or}.This PR replaces the regex replacement for trailing commas with a fast, string-aware single-pass loop, correctly preserving any
,found inside quotes.