Skip to content

Refactor (5/N): drop dead duplicate functions from renderer.js#26

Merged
dnkats merged 1 commit into
mainfrom
refactor/consolidate-renderer
May 31, 2026
Merged

Refactor (5/N): drop dead duplicate functions from renderer.js#26
dnkats merged 1 commit into
mainfrom
refactor/consolidate-renderer

Conversation

@dnkats

@dnkats dnkats commented May 31, 2026

Copy link
Copy Markdown
Member

Cleanup follow-up to the JS split.

renderer.js is loaded before the js/ feature scripts, so its definitions of showElemCoPanel, hideElemCoPanel, generateElemCoInput, copyElemCoInput, and runJuliaCalculation were always overridden by the authoritative versions in js/elemco.js — i.e. dead code that never ran. (The runJuliaCalculation one was also just a no-op wrapper that delegated to window.runJuliaCalculation, which is itself the overridden global.)

Change

  • Removed those 5 dead function definitions.
  • Updated the comment to point at the js/ feature scripts.
  • Unchanged: the checkVersion IIFE and the DOMContentLoaded / window.load / resize / visibilitychange lifecycle listeners (these are the real, non-duplicated work renderer.js does).

No runtime behavior changes — the active versions of these functions were already the js/elemco.js ones. node --check renderer.js passes.

🤖 Generated with Claude Code

renderer.js loads before the js/ feature scripts, so its definitions of
showElemCoPanel, hideElemCoPanel, generateElemCoInput, copyElemCoInput
and runJuliaCalculation were always overridden by the authoritative
versions in js/elemco.js — they were dead code. Remove them (the
runJuliaCalculation stub was also a no-op wrapper) and update the comment
to point at the js/ feature scripts. The version-check IIFE and the
DOM/window lifecycle listeners are unchanged.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings May 31, 2026 16:03

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Removes dead duplicate global ElemCo/Julia helper functions from renderer.js that were always overridden by the later-loaded js/ feature scripts, keeping renderer.js focused on version display and lifecycle wiring.

Changes:

  • Deleted 5 duplicated global functions (showElemCoPanel, hideElemCoPanel, generateElemCoInput, copyElemCoInput, runJuliaCalculation) from renderer.js.
  • Updated the explanatory comment to point to the authoritative js/elemco.js / js/xtb.js feature scripts.

@dnkats dnkats merged commit a91045d into main May 31, 2026
1 check passed
@dnkats dnkats deleted the refactor/consolidate-renderer branch May 31, 2026 16:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants