Skip to content

refactor: split the two genuinely tangled god files (AppDelegate, CLI/programa) #187

Description

@arzafran

From the gpt-5.6-sol eval (P2, effort L, multi-session). Only two of the cited god files are genuinely tangled. Sources/AppDelegate.swift (~9.2k lines) mixes autosave (:2113), focus repair (:3537), window routing (:4847), and shortcut dispatch (:6500). CLI/programa.swift (~7k lines) has a 2.5k-line descriptor registry plus a SECOND exhaustive grammar switch (:1620, :5777) — the same missing-contract split that caused three CLI-dead-on-arrival bugs this cycle. (Note: GhosttyConfig.swift is already cohesive at 642 lines; TerminalAndGhosttyTests is just many classes in one file, organizational only.)

First step: extract state-owning SessionAutosaveCoordinator, MainWindowRegistry, ShortcutRouter; make each CLI descriptor own its typed grammar so help, validation, and execution share one source (kills the whole missing-contract bug class).

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions