Fix correctness, security, and architecture issues#7
Open
phjlljp wants to merge 1 commit into
Open
Conversation
… review CSS fixes: - Fix chat animation: set .chat-message and .chat-typing to display:none by default so JS can reveal them sequentially (was display:flex, breaking the entire chat animation engine) - Fix dvh/vh fallback order: 100vh first, 100dvh second (was reversed, making dvh dead code) JS fixes (main.js): - Replace innerHTML with textContent in quiz and bug-challenge feedback to close XSS vectors - Add CSS.escape() to quiz and DnD selector interpolation to prevent crashes on special characters in data attributes - Fix chat showNext() reentrancy with busy guard - Fix chat showAll() overlapping intervals by storing and clearing ref - Fix chat reset() to clear intervals and busy state - Guard typing avatar lookup against null .chat-typing element - Wrap flow animation JSON.parse in try/catch for error isolation - Scope flow animatePacket lookups to container (was global) - Scope flow highlight fallback to container (was global) - Center flow packet on actors (subtract 8px offset) - Scope layer toggle lookup to .layer-demo container (was global) - Add toggle-off behavior to architecture diagram clicks - Fix DnD: clear previous zone when re-placing a chip - Fix DnD: highlight unanswered zones on check - Fix progress bar: show 100% when all content fits viewport Build script (build.sh): - Add file existence validation before assembly - Add module directory check - Set LC_ALL=C for deterministic glob ordering - Use set -euo pipefail Documentation: - Fix interactive-elements.md: correct architecture diagram template (remove nonexistent showArchDesc onclick), add container ID to DnD check/reset calls, add 'this' arg to showLayer calls - Add security guidance to SKILL.md: sensitive file exclusion list, secret redaction rule, prompt injection defense, HTML encoding rules - Fix README.md: correct output format description (directory, not single file), list all reference files in skill structure Co-Authored-By: Claude Opus 4.6 (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
Comprehensive fixes for bugs, security issues, and documentation inaccuracies identified via multi-reviewer code audit.
CSS (3 fixes):
.chat-messageand.chat-typingnow default todisplay: noneso JS can reveal messages sequentially (wasdisplay: flex, making the entire chat animation non-functional)dvh/vhfallback order on.module—100vhfirst,100dvhsecond (was reversed, making the modern unit dead code)JavaScript — Security (4 fixes):
innerHTMLwithtextContentin quiz feedback and bug-challenge feedback to close XSS vectorsCSS.escape()to quiz and drag-and-drop selector interpolation to prevent crashes on special charactersJSON.parsein try/catch so one malformeddata-stepsattribute doesn't break all subsequent interactive elementsJavaScript — Correctness (9 fixes):
showNext()reentrancy with busy guard (rapid clicks no longer skip messages)showAll()overlapping intervals (multiple clicks no longer spawn duplicate timers).chat-typingelementanimatePacketlookups to container (was document-global, broke with multiple flow animations)showLayerlookup to.layer-democontainer (was global)Build script:
LC_ALL=Cfor deterministic glob ordering across localesset -euo pipefailDocumentation:
interactive-elements.md: architecture diagram (remove nonexistentshowArchDesconclick), drag-and-drop (add container ID to check/reset calls), layer toggle (addthisarg toshowLayer)SKILL.md: sensitive file exclusion list, secret redaction, prompt injection defense, HTML encoding rules for code snippets and data attributesREADME.md: correct output format (directory, not single file), list all 10 reference filesTest plan
build.shfrom an empty modules directory — verify it errors cleanlybuild.shnormally — verifyindex.htmlassembles correctlynode --check references/main.jspasses (confirmed pre-commit)data-stepsJSON — verify graceful degradation🤖 Generated with Claude Code