-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Problem
Four creation sheets share an identical structural pattern with ~40 lines of boilerplate each:
AgentCreationSheet.swiftPromptCreationSheet.swiftSwarmCreationSheet.swiftScheduleCreationSheet.swift
The header is character-for-character identical across all four (only the title string differs):
HStack {
Text("New X").font(.system(size: 14, weight: .semibold))
Spacer()
}
.padding(.horizontal, 20)
.padding(.vertical, 12)The footer is structurally identical (Cancel + Create buttons with keyboard shortcuts, same padding), differing only in the Create action body and the .disabled() condition.
The body layout is identical: VStack(spacing: 0) { header; Divider; form; Divider; footer }
Suggested approach
Extract a generic CreationSheet<Content> wrapper:
struct CreationSheet<FormContent: View>: View {
let title: String
let isValid: Bool
let onCreate: () -> Void
@ViewBuilder let form: () -> FormContent
}Estimated ~160 lines of boilerplate eliminated.
Files
apps/purepoint-macos/purepoint-macos/Views/Agents/AgentCreationSheet.swiftapps/purepoint-macos/purepoint-macos/Views/Agents/PromptCreationSheet.swiftapps/purepoint-macos/purepoint-macos/Views/Agents/SwarmCreationSheet.swiftapps/purepoint-macos/purepoint-macos/Views/Schedule/ScheduleCreationSheet.swift
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request