Skip to content

[Feat]: [Refactoring Phase 2] Testability & Quality Improvements #1961

@IsmaelMartinez

Description

@IsmaelMartinez

Describe the feature

Improve code testability and add automated test coverage. This phase begins after Phase 1 completion.

Motivation

Labels: refactoring, phase-2, blocked

Parent Epic: #1959
Blocked By: #1960 (Phase 1)
Detailed Plan: incremental-refactoring-plan.md#phase-2

Tasks

  • Singleton Refactoring

    • Export classes instead of instances
    • Enable fresh instances for testing
    • Modules: connectionManager, screenSharingService
  • IPC Registration Pattern

    • Move IPC registration out of constructors
    • Add explicit initialize() methods
    • Module: menus/tray.js and others with constructor IPC
  • Automated Testing

    • Add 20+ tests using existing Playwright setup
    • E2E tests for critical paths (startup, notifications, screen sharing)
    • Unit tests for extracted modules
  • Documentation Automation

    • Auto-generate IPC API docs from code
    • Generate module dependency diagrams
    • Keep documentation in sync with code

Success Criteria

  • ✅ Zero singleton exports (all classes)
  • ✅ IPC registration in initialize() not constructors
  • ✅ 20+ automated tests passing
  • ✅ Test coverage >40%
  • ✅ IPC docs auto-generated

Status

⏸️ Blocked - Waiting for Phase 1 completion

After Phase 1, we'll evaluate whether to continue with Phase 2 or shift to feature implementation based on:

  • User priorities
  • Value delivered from Phase 1
  • Available time and energy

Notes

This phase is optional.

Alternatives

No response

Additional context

No response

Metadata

Metadata

Labels

blockedThis issue depends on external projectsenhancementNew feature or requestrefactoring

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions