Problem
Agent type strings ("claude", "codex", "opencode") are hardcoded as raw string arrays in three separate locations:
AgentCreationSheet.swift:17 — ["claude", "codex", "opencode"]
PromptCreationSheet.swift:14 — ["", "claude", "codex", "opencode"]
AgentsHubView.swift:163 — ["", "claude", "codex", "opencode"]
Adding a new agent type requires finding and updating all three. The two variants (with/without empty string for "Any") add confusion.
Additionally, other stringly-typed patterns exist:
- PR review decisions in
PRRowView.swift:72-85 ("APPROVED", "CHANGES_REQUESTED", "REVIEW_REQUIRED")
- Diff status codes in
DiffCardView.swift:86-110 ("A", "D", "M", "??")
- Prompt scope wire values checked as
prompt.source == "global" in multiple places in AgentsHubView.swift
Suggested approach
- Create an
AgentTypeKind enum with allCases for pickers
- Create a
ReviewDecision enum for PR review decisions
- Create a
DiffStatusCode enum for diff statuses
- Make
SavedPrompt.source a typed enum instead of raw string
Files
apps/purepoint-macos/purepoint-macos/Views/Agents/AgentCreationSheet.swift
apps/purepoint-macos/purepoint-macos/Views/Agents/PromptCreationSheet.swift
apps/purepoint-macos/purepoint-macos/Views/Agents/AgentsHubView.swift
apps/purepoint-macos/purepoint-macos/Views/Detail/PRRowView.swift
apps/purepoint-macos/purepoint-macos/Views/Detail/DiffCardView.swift
Problem
Agent type strings (
"claude","codex","opencode") are hardcoded as raw string arrays in three separate locations:AgentCreationSheet.swift:17—["claude", "codex", "opencode"]PromptCreationSheet.swift:14—["", "claude", "codex", "opencode"]AgentsHubView.swift:163—["", "claude", "codex", "opencode"]Adding a new agent type requires finding and updating all three. The two variants (with/without empty string for "Any") add confusion.
Additionally, other stringly-typed patterns exist:
PRRowView.swift:72-85("APPROVED","CHANGES_REQUESTED","REVIEW_REQUIRED")DiffCardView.swift:86-110("A","D","M","??")prompt.source == "global"in multiple places inAgentsHubView.swiftSuggested approach
AgentTypeKindenum withallCasesfor pickersReviewDecisionenum for PR review decisionsDiffStatusCodeenum for diff statusesSavedPrompt.sourcea typed enum instead of raw stringFiles
apps/purepoint-macos/purepoint-macos/Views/Agents/AgentCreationSheet.swiftapps/purepoint-macos/purepoint-macos/Views/Agents/PromptCreationSheet.swiftapps/purepoint-macos/purepoint-macos/Views/Agents/AgentsHubView.swiftapps/purepoint-macos/purepoint-macos/Views/Detail/PRRowView.swiftapps/purepoint-macos/purepoint-macos/Views/Detail/DiffCardView.swift