Skip to content

Finish the command-palette extraction: 3,900 lines and 30 @State properties never left ContentView #88

Description

@arzafran

ContentView+CommandPalette.swift's header says the real split was deferred because "@State cannot be split across files". That is only true for stored properties. Extension methods in the same module can mutate @State freely, so the deferral premise was wrong, and the follow-up never happened. Today ~3,900 lines of palette orchestration (overlay, ~75 command registrations, rename/description flows, usage history) and ~30 palette-only @State properties still live on ContentView; only ~950 lines of pure helpers were extracted.

Fix: introduce CommandPaletteController: ObservableObject owning the palette state as @published, move the orchestration methods onto it. ContentView holds one @StateObject instead of 30 @State vars. This alone cuts ContentView.swift (13,605 lines) by roughly a third.

Free rider: the 987-line fuzzy search engine (ContentView.swift:7734-8721) has zero coupling to the file and moves out mechanically.


From the 2026-07-09 nuclear review (10 module reviewers + Codex cross-model pass, disprove-first). Line refs are against the reductive-audit branch (PR #81).

Metadata

Metadata

Assignees

No one assigned

    Labels

    nuclear-reviewFrom the 2026-07-09 whole-codebase nuclear reviewtech-debtKnown latent issue / maintenance debt

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions