Refactor (5/N): drop dead duplicate functions from renderer.js#26
Merged
Conversation
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>
There was a problem hiding this comment.
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) fromrenderer.js. - Updated the explanatory comment to point to the authoritative
js/elemco.js/js/xtb.jsfeature scripts.
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.
Cleanup follow-up to the JS split.
renderer.jsis loaded before thejs/feature scripts, so its definitions ofshowElemCoPanel,hideElemCoPanel,generateElemCoInput,copyElemCoInput, andrunJuliaCalculationwere always overridden by the authoritative versions injs/elemco.js— i.e. dead code that never ran. (TherunJuliaCalculationone was also just a no-op wrapper that delegated towindow.runJuliaCalculation, which is itself the overridden global.)Change
js/feature scripts.checkVersionIIFE and theDOMContentLoaded/window.load/resize/visibilitychangelifecycle listeners (these are the real, non-duplicated workrenderer.jsdoes).No runtime behavior changes — the active versions of these functions were already the
js/elemco.jsones.node --check renderer.jspasses.🤖 Generated with Claude Code