Refactor/cohesion pass #1
Reference in New Issue
Block a user
Delete Branch "refactor/cohesion-pass"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Phase 5 (behavior-preserving): decompose the ~1000-line onMount into focused modules coordinated by a plain (non-reactive) controller object: - pixi/types.ts LineObject / NodeObject / BackgroundLayers - pixi/controller.ts shared mutable pan/zoom state + Pixi refs (NOT $state, which would break PixiJS object identity) - pixi/background.ts gradient/nebula/stars/dust/vignette + ambient loops - pixi/lines.ts plasma-beam connections - pixi/nodes.ts origin + regular nodes; collapses the duplicated pointer handlers into one attachNodeInteraction helper - pixi/interaction.ts pan/zoom/parallax + keyboard nav (return cleanups) - pixi/animation.ts sequenced entrance animation onMount is now a thin orchestrator. SkillTree.svelte: 1177 -> 274 lines (2453 at the start of the refactor). Listener passivity, the hasMoved click guard, eventMode-until-animated ordering, and the R-reset parallax rebaseline are all preserved. svelte-check: 0 errors/0 warnings. lint/test/build clean. Verified onMount runs with no runtime exceptions (background + stats panel render). NOTE: pan/zoom/ node-click/keyboard need a manual real-browser check (headless can't paint nodes). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>