Skip to content

refactor: code quality pass β€” split yard app.js toggle/message helpers#1

Draft
baagad-ai wants to merge 8 commits intomainfrom
chore/code-quality-striker
Draft

refactor: code quality pass β€” split yard app.js toggle/message helpers#1
baagad-ai wants to merge 8 commits intomainfrom
chore/code-quality-striker

Conversation

@baagad-ai
Copy link
Copy Markdown
Owner

@baagad-ai baagad-ai commented Mar 31, 2026

Code Quality Pass

Session: chore/code-quality-striker
Scope: structural refactor only β€” zero functional changes

Changes

  • split summary toggle click orchestration into small helpers in app.js
  • extracted TOC visibility toggling into a dedicated helper
  • extracted navigation message listener registration into a dedicated helper

Validation

  • node --check passed on all touched files
  • npm test is not configured in this repository root (/opt/homebrew/package.json is absent)
  • npm run build is not configured in this repository root (/opt/homebrew/package.json is absent)
  • ./bin/brew lgtm --online passed (brew typecheck, brew style --changed --fix, brew tests --changed --online)

Why

app.js was 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.

- 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.
@baagad-ai baagad-ai changed the title refactor: code quality pass β€” split app.js navigation helpers refactor: code quality pass β€” dedupe YARD toggle wiring Mar 31, 2026
- 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.
@baagad-ai baagad-ai changed the title refactor: code quality pass β€” dedupe YARD toggle wiring refactor: code quality pass β€” split YARD app helper boundaries Mar 31, 2026
- extracted summary toggle click flow into focused helpers

- extracted TOC visibility and message-listener registration helpers

No functional changes. Homebrew lgtm checks pass.
@baagad-ai baagad-ai changed the title refactor: code quality pass β€” split YARD app helper boundaries refactor: code quality pass β€” split yard app.js toggle/message helpers Mar 31, 2026
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.

1 participant