Skip to content

boundarySlice.ts has regrown to 1000 lines (5 concerns) — past the threshold that produced it from modelStore.ts split (#202) #424

Description

@mkofler96

What's wrong

web/src/store/boundarySlice.ts grew from 549 → 1000 lines (+82%) across the four most recent PRs (#417-mkofler96/KoFEM#420: explicit tie connections, surface-to-point couplings, shell/solid MPC validation, surface-load overlap fix). It now mixes five distinct concerns in one file:

  1. Tie-group state/actions
  2. Coupling-group state/actions, including reference-point node lifecycle
  3. Original BC/load group state/actions
  4. rebuildLoads / rebuildSurfaceLoads
  5. Viewport pick-session state (tie-side toggling, coupling draft)

Why it matters

boundarySlice.ts exists because issue #202 ("modelStore.ts is a 988-line monolith — split into focused state slices," closed) split it out as one of several focused slices. It has now grown back past that same ~1000-line threshold that made #202 worth fixing in the first place — the split bought headroom, not a permanent fix, and each new coupling feature has been landing in the same file.

Not a duplicate of the other outstanding "file has outgrown itself" issues: #401 is lib/shellize.ts, #371 is solver.worker.ts, #364 is BoundaryConditionLayer.tsx — none target boundarySlice.ts.

Suggested fix

Split along the same lines #202 used: tie-group and coupling-group state/actions are good candidates to move into their own slices (tieSlice.ts, couplingSlice.ts), leaving boundarySlice.ts with the original BC/load concerns plus the shared rebuild logic.

Found during a scheduled codebase health scan (fresh review of commits 57e0346..HEAD).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions