Skip to content

Tabletop v2: decompose oversized Svelte components (>150-line rule) #93

Description

@jordanwallwork

Found during the two-axis review of #88 (Standards axis, hard violation).

AGENTS.md → "Svelte Development Guide > Component Philosophy" states: "Single Responsibility: One thing per component. Decompose if exceeding 150 lines." Five new components exceed it:

  • ZoneRenderer.svelte — 646
  • TabletopV2.svelte — 522
  • ComponentSidebar.svelte — 320
  • PileRenderer.svelte — 263
  • ShuffleAnimation.svelte — 162

ZoneRenderer.svelte is the worst case and breaches a second documented rule — "A third mode/variant prop means refactor into base + sub-components" / "Prefer Snippets over Conditionals." It renders all four zone types through if-cascades in one file ({#if spread}, {#if grid}, group via class:group, freeform background/nesting, plus a per-type edit toolbar). This is the exact "base + per-type sub-components" case the rule names — e.g. split into ZoneSpread/ZoneGrid/ZoneGroup behind a base renderer.

Fix: decompose each of the above; prioritise ZoneRenderer.svelte's per-type split.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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