Skip to content

Refactor snapshot handler into capture/wait/session helpers #158

Closed

Description

@thymikee

Problem

src/daemon/handlers/snapshot.ts is currently ~600 LOC and mixes snapshot capture/scope logic with wait parsing/execution and session/sessionless cleanup concerns.

Goal

Split snapshot handler into focused helpers while keeping command behavior unchanged.

Proposed split

  • src/daemon/handlers/snapshot-capture.ts
    • snapshot capture + scope resolution
  • src/daemon/handlers/snapshot-wait.ts
    • wait arg parsing + wait execution helpers
  • src/daemon/handlers/snapshot-session.ts
    • session/sessionless device resolution and cleanup utilities
  • Keep src/daemon/handlers/snapshot.ts as command orchestrator.

Acceptance criteria

  • Snapshot and wait command outputs remain backward-compatible.
  • parseWaitArgs behavior remains stable.
  • New implementation files target <=300 LOC where practical.
  • Existing snapshot-related tests remain green.

Validation

  • pnpm typecheck
  • pnpm test:unit
  • pnpm test:smoke

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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions