Skip to content

Desktop: AppState.swift at 2700+ lines needs decomposition #5794

Closed

Description

@beastoin

Problem

AppState.swift is a 2700+ line god object that mixes:

  • UI state management (isTranscribing, hasCompletedOnboarding, selectedConversation)
  • Business logic (transcription pipeline, conversation finalization)
  • API calls (loadConversations, saveConversation)
  • Audio capture orchestration
  • Environment loading
  • Notification handling

Impact

  • Hard to test individual components
  • Easy to introduce state sync bugs
  • Difficult for new contributors to navigate
  • Changes in one area risk regressions in unrelated areas

Suggested Fix

Break into focused services:

  • TranscriptionOrchestrator — audio capture + transcription pipeline
  • ConversationManager — CRUD, sync, search
  • EnvironmentLoader — .env parsing and env var management
  • AppState — thin coordinator that wires services together

Context

Found during desktop friction exploration (PR #5790).

File: desktop/Desktop/Sources/AppState.swift

Activity

  1. added
    p3
    on Mar 18, 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

    desktopp3

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions