Problem
AgentsHubView.swift is 785 lines containing:
- The main
AgentsHubView struct (~630 lines)
AgentsHubTab enum
CommandHintBar, PromptListRow, AgentListRow, SwarmListRow, SwarmDiagramView
The main struct has deeply nested computed properties:
promptsContent alone is ~127 lines of nested view code with an inline prompt editor
- Three nearly identical list panels (
promptListPanel, agentListPanel, swarmListPanel) that could be a generic ListPanel<Item, Row>
- Three list row types with identical selection card styling that should be a shared
ViewModifier
Suggested approach
- Extract
promptsContent → PromptEditorView (own file)
- Extract
agentsContent → AgentDetailView (own file)
- Extract
swarmsContent → SwarmDetailView (own file)
- Create a generic
ListPanel<Item, Row> to replace the three identical list panel implementations (~60 lines saved)
- Create a
SelectableCardStyle ViewModifier for the repeated selection styling pattern:
.padding(12)
.frame(maxWidth: .infinity, alignment: .leading)
.background(isSelected ? Color.accentColor.opacity(0.12) : Color.primary.opacity(0.03))
.clipShape(RoundedRectangle(cornerRadius: 10))
Files
apps/purepoint-macos/purepoint-macos/Views/Agents/AgentsHubView.swift
Problem
AgentsHubView.swiftis 785 lines containing:AgentsHubViewstruct (~630 lines)AgentsHubTabenumCommandHintBar,PromptListRow,AgentListRow,SwarmListRow,SwarmDiagramViewThe main struct has deeply nested computed properties:
promptsContentalone is ~127 lines of nested view code with an inline prompt editorpromptListPanel,agentListPanel,swarmListPanel) that could be a genericListPanel<Item, Row>ViewModifierSuggested approach
promptsContent→PromptEditorView(own file)agentsContent→AgentDetailView(own file)swarmsContent→SwarmDetailView(own file)ListPanel<Item, Row>to replace the three identical list panel implementations (~60 lines saved)SelectableCardStyleViewModifier for the repeated selection styling pattern:Files
apps/purepoint-macos/purepoint-macos/Views/Agents/AgentsHubView.swift