fix(vscode): escaped quotes in messaging template literal killed all webview handlers#374
Merged
Merged
Conversation
…webview handlers The webview's inline <script> bodies are built as backtick template literals in html.ts. The dep-toggle querySelector used `\"`, which the template literal collapses to a bare `"`, emitting `data-depissue="" + depIssue + ""` — adjacent string literals, a hard SyntaxError. That parse error killed the ENTIRE messaging IIFE, so every webview click handler (track select, focus toggle, and the new #216 graph zoom/pan/export controls) was silently dead. Shipped in #257 (0.9.0); surfaced now via the new graph controls. Fix: single-quote the selector string so no escaping is needed. Add a regression guard that extracts every inline <script> and new Function()-parses it — the old tests asserted on the HTML string but never executed the JS. Verified the guard fails on the buggy line and passes on the fix; reproduced dead/working controls in a real browser harness. 681 tests pass. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
evemcgivern
added a commit
that referenced
this pull request
Jun 18, 2026
0.13.0 already shipped (2026-06-16), so bump to 0.14.0 — republishing 0.13.0 would no-op on the Marketplace (--skip-duplicate). Prepend the 0.14.0 Status entry: proactive auto-slot suggestions (#241) + offline heuristic (#373) + the critical webview-handler fix (#374). CLI floor unchanged (2026.06.15). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
The webview's inline
<script>bodies inhtml.tsare backtick template literals. The dep-togglequerySelectorused\", which the template literal collapses to a bare", emittingdata-depissue="" + depIssue + ""— adjacent string literals, a hardSyntaxError. That parse error killed the entire messaging IIFE, so every webview click handler (track select, focus toggle, and the new #216 graph zoom/pan/export controls) was silently dead.Shipped in #257 (0.9.0); surfaced now because the brand-new graph controls were the first thing clicked.
Fix
<script>andnew Function()-parses it — the prior tests only asserted on the HTML string, never executing the JS, which is exactly how a syntax error shipped.Verification
buildHtmloutput.npm test: 681 pass.🤖 Generated with Claude Code