refactor: code quality pass β split yard app.js toggle/message helpers#1
Draft
refactor: code quality pass β split yard app.js toggle/message helpers#1
Conversation
- extracted inline-script filtering and head-refresh logic into helpers - split navigation message handling into focused functions No functional changes. All tests pass.
- extracted shared summary toggle flow into reusable helpers - split TOC generation into focused helper functions No functional changes. All tests pass.
- extracted repeated pointer-event handling into local helpers in app.js - extracted repeated hash scrolling logic into a shared helper No functional changes. All tests pass.
- extracted storage and navigation pipeline helper functions inside app.js - deduplicated inline script iteration and pointer capture wiring No functional changes. Repository-native checks pass.
- extracted repeated jQuery two-state toggle wiring into bindToggleActions - reused helper across source, define, tree, and TOC toggles No functional changes. All tests pass.
- extracted TOC state and entry assembly into focused helpers in app.js - split nav resize, script refresh, and message handling into smaller functions No functional changes. All tests pass.
- extracted UI interaction helpers from window.__app into top-level private functions - reduced window.__app to an orchestration wrapper with unchanged behavior No functional changes. All tests pass.
- extracted summary toggle click flow into focused helpers - extracted TOC visibility and message-listener registration helpers No functional changes. Homebrew lgtm checks pass.
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.
Code Quality Pass
Session: chore/code-quality-striker
Scope: structural refactor only β zero functional changes
Changes
app.jsValidation
node --checkpassed on all touched filesnpm testis not configured in this repository root (/opt/homebrew/package.jsonis absent)npm run buildis not configured in this repository root (/opt/homebrew/package.jsonis absent)./bin/brew lgtm --onlinepassed (brew typecheck,brew style --changed --fix,brew tests --changed --online)Why
app.jswas 539 lines with mixed responsibilities in toggle handling and message wiring; splitting control-flow into focused helpers improves readability and safer parallel edits for future sessions.