Repository navigation
fix(web-client): remove TypeScript cast leak that broke UI runtime - #685
Merged
Merged
Conversation
`void (el as HTMLElement).offsetWidth` was inside an inline-JS string-literal that's served verbatim to the browser, never compiled through tsc. The `as HTMLElement` cast leaked through and produced `Uncaught SyntaxError: Unexpected identifier 'as'` at runtime, breaking the entire web UI. At runtime querySelectorAll returns HTMLElement-typed nodes implicitly, so the cast is unnecessary — just drop it. Per feedback_inline_js_escaping.md: inline-JS in web-client.ts template strings is NOT TypeScript, validate as plain JS. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
liususan091219
pushed a commit
to liususan091219/sutando-fork
that referenced
this pull request
May 28, 2026
`void (el as HTMLElement).offsetWidth` was inside an inline-JS string-literal that's served verbatim to the browser, never compiled through tsc. The `as HTMLElement` cast leaked through and produced `Uncaught SyntaxError: Unexpected identifier 'as'` at runtime, breaking the entire web UI. At runtime querySelectorAll returns HTMLElement-typed nodes implicitly, so the cast is unnecessary — just drop it. Per feedback_inline_js_escaping.md: inline-JS in web-client.ts template strings is NOT TypeScript, validate as plain JS. Co-authored-by: Claude Opus 4.7 (1M context) <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.
Summary
void (el as HTMLElement).offsetWidthfrom PR feat(task-expand): 1s yellow flash on expand:N target (visible feedback) #684 sat inside an inline-JS template-string. Theas HTMLElementcast leaked unchanged to the browser, causingUncaught SyntaxError: Unexpected identifier 'as'and breaking the whole web UI.Self-verification
launchctl kickstart -k gui/$(id -u)/com.sutando.web-client(PID 73145)document.querySelectorAll('.task-item').length === 30,typeof renderTasks === 'function', console clean.Test plan
Unexpected identifier 'as'— should be gone🤖 Generated with Claude Code