Skip to content

refactor: Split stores/network.js into composables (1635 lines) #121

Closed as not planned

Description

@vybe

Problem

src/frontend/src/stores/network.js is 1635 lines — the largest Pinia store. It mixes WebSocket management, graph layout calculation, node/edge data management, and timeline state.

Proposed Solution

Split into focused composables/stores:

  1. stores/network.js — Core state: agents, connections, selection (~300 lines)
  2. composables/useNetworkWebSocket.js — WebSocket connection, event handling, reconnection (~300 lines)
  3. composables/useGraphLayout.js — D3/force layout, node positioning, zoom (~400 lines)
  4. composables/useTimelineData.js — Timeline mode data, filtering, sorting (~300 lines)

Acceptance Criteria

  • stores/network.js < 400 lines
  • Each composable < 400 lines
  • Dashboard graph rendering unchanged
  • Timeline mode unchanged
  • WebSocket reconnection unchanged

Source

Refactor audit 2026-03-13

Activity

  1. added
    priority-p1
    type-refactor
    on Mar 14, 2026
  2. vybe commented on Mar 30, 2026

    @vybe
    ContributorAuthor

    Actualization (2026-03-30)

    File is now 1,703 lines (was 1,635 at filing). Still growing. Needs composable extraction.

  3. oleksandr-korin commented on May 29, 2026

    @oleksandr-korin
    Contributor

    Closing as superseded — file-split refactor tickets created en masse on 2026-03-14 from a one-shot complexity scan. The /code-health weekly automation now scores hotspots dynamically and creates better-targeted issues from current churn × complexity, so static "split N-line file" tickets are no longer the right unit of work. The underlying complexity signal will resurface organically if/when it matters. Reference: backlog lean review on 2026-05-28.

  4. added
    complexity-low
    theme-devex
    on Jun 3, 2026
  5. added a commit that references this issue on Jul 26, 2026
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

    complexity-lowpriority-p1theme-devextype-refactor

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions