Repository navigation
Patch 2 fix: #648 Replace inline and direct event listeners with 100% delegated data-action pattern - #657
Patch 2 fix: #648 Replace inline and direct event listeners with 100% delegated data-action pattern#657quantumchain-core wants to merge 35 commits into
Conversation
…ialization and unmatched script closing tag' Co-authored-by: Copilot Autofix powered by AI <[email protected]>
|
|
Overall Grade |
Security Reliability Complexity Hygiene |
Code Review Summary
| Analyzer | Status | Updated (UTC) | Details |
|---|---|---|---|
| JavaScript | Oct 10, 2026 8:01a.m. | Review ↗ | |
| Secrets | Oct 10, 2026 8:01a.m. | Review ↗ |
Important
AI Review is run only on demand for your team. We're only showing results of static analysis review right now. To trigger AI Review, comment @deepsourcebot review on this thread.
There was a problem hiding this comment.
🟡 Changes recommended
Direct per-element listeners remain, and the attribute migration breaks existing dev-tool color selectors.
2 open findings
What changed in this PR
Centralizes browser UI interactions through delegated data-action handlers.
Changes:
- Replaces inline event attributes across templates.
- Adds centralized click and hover delegation.
- Improves the email-copy control’s semantics.
| File | Description |
|---|---|
src/index.njk |
Delegates developer-duel launches. |
src/games.njk |
Delegates arcade game launches. |
src/assets/js/ui-bindings.js |
Implements centralized action dispatch. |
src/_includes/system-override.njk |
Converts override controls to data actions. |
src/_includes/system-log.njk |
Delegates console controls. |
src/_includes/skills-list.njk |
Marks skill hover actions for delegation. |
src/_includes/scripts.njk |
Loads the binding script last. |
src/_includes/matrix-overlay.njk |
Delegates matrix closing. |
src/_includes/game-stats.njk |
Delegates stats and theme controls. |
src/_includes/footer-details.njk |
Delegates footer actions. |
src/_includes/bio.njk |
Delegates email copying and game launch. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| // skipcq: JS-R1005 JS-0357 | ||
| /* global scrollToRandomUser, handleLevelClick, toggleTheme, closeMatrix, reopenConsole, minimizeConsole, maximizeConsole, closeConsole, triggerSecretUnlock, triggerForceSurge, addExperience, XP_SPACE_INVADERS_WIN, _XP_CODE_BREAKER_WIN, _XP_DEV_DUEL_PLAY, playSound, triggerMagicXP, toggleScreenshotMode, jumpToLevel, startSelfDestruct, CodeBreaker, handleFooterDotClick, SpaceInvaders, startDuelFromCard, createFloatingXP, copyToClipboard */ | ||
|
|
||
| // Fixes #627 + #648 - 100% delegated UI bindings |
| </button> | ||
| <button onclick="triggerForceSurge()" | ||
| class="relative overflow-hidden py-2 px-6 bg-blue-600/20 text-blue-300 border-2 border-blue-400 rounded-lg font-bold tracking-[0.2em] transition-all hover:bg-blue-500/40 hover:shadow-[0_0_30px_rgba(59,130,246,0.6)] animate-pulse uppercase"> | ||
| <button data-action="secret-unlock" data-code="badge_click" class="override-btn py-1.5 bg-purple-500/5 hover:bg-purple-500/20 text-purple-400 text-[8px] border border-purple-500/20 rounded transition-all">BADGE_XP</button> |


Fixes #648
Closes #648
Related to #627 and PR #649 (merged)
Context - What #648 Asked For
#648 = Replace all inline
onclick="",onmouseenter=""and direct per-elementaddEventListenerwith centralized delegated listeners usingdata-actionpattern.Diagram reference:
onclickhandlers with event listeners or delegated events #648What Was Already Fixed in PR #649 (Merged)
PR #649 created
src/assets/js/ui-bindings.jswith centralized delegated pattern: