import { Label } from '@/components/ui/label'; import { Checkbox } from '@/components/ui/checkbox'; import { FlaskConical, Settings2, TestTube, GitBranch, AlertCircle, Zap, ClipboardList, FileText, ScrollText, ShieldCheck, User, Sparkles, } from 'lucide-react'; import { cn } from '@/lib/utils'; import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue, } from '@/components/ui/select'; import type { AIProfile } from '@/store/app-store'; import type { AgentModel } from '@automaker/types'; type PlanningMode = 'skip' | 'lite' | 'spec' | 'full'; interface FeatureDefaultsSectionProps { showProfilesOnly: boolean; defaultSkipTests: boolean; enableDependencyBlocking: boolean; useWorktrees: boolean; defaultPlanningMode: PlanningMode; defaultRequirePlanApproval: boolean; defaultAIProfileId: string | null; aiProfiles: AIProfile[]; validationModel: AgentModel; onShowProfilesOnlyChange: (value: boolean) => void; onDefaultSkipTestsChange: (value: boolean) => void; onEnableDependencyBlockingChange: (value: boolean) => void; onUseWorktreesChange: (value: boolean) => void; onDefaultPlanningModeChange: (value: PlanningMode) => void; onDefaultRequirePlanApprovalChange: (value: boolean) => void; onDefaultAIProfileIdChange: (value: string | null) => void; onValidationModelChange: (value: AgentModel) => void; } export function FeatureDefaultsSection({ showProfilesOnly, defaultSkipTests, enableDependencyBlocking, useWorktrees, defaultPlanningMode, defaultRequirePlanApproval, defaultAIProfileId, aiProfiles, validationModel, onShowProfilesOnlyChange, onDefaultSkipTestsChange, onEnableDependencyBlockingChange, onUseWorktreesChange, onDefaultPlanningModeChange, onDefaultRequirePlanApprovalChange, onDefaultAIProfileIdChange, onValidationModelChange, }: FeatureDefaultsSectionProps) { // Find the selected profile name for display const selectedProfile = defaultAIProfileId ? aiProfiles.find((p) => p.id === defaultAIProfileId) : null; return (

Feature Defaults

Configure default settings for new features.

{/* Planning Mode Default */}
{defaultPlanningMode === 'skip' && } {defaultPlanningMode === 'lite' && } {defaultPlanningMode === 'spec' && } {defaultPlanningMode === 'full' && }

{defaultPlanningMode === 'skip' && 'Jump straight to implementation without upfront planning.'} {defaultPlanningMode === 'lite' && 'Create a quick planning outline with tasks before building.'} {defaultPlanningMode === 'spec' && 'Generate a specification with acceptance criteria for approval.'} {defaultPlanningMode === 'full' && 'Create comprehensive spec with phased implementation plan.'}

{/* Require Plan Approval Setting - only show when not skip */} {defaultPlanningMode !== 'skip' && ( <>
onDefaultRequirePlanApprovalChange(checked === true)} className="mt-1" data-testid="default-require-plan-approval-checkbox" />

When enabled, the agent will pause after generating a plan and wait for you to review, edit, and approve before starting implementation. You can also view the plan from the feature card.

)} {/* Separator */} {defaultPlanningMode === 'skip' &&
} {/* Default AI Profile */}

{selectedProfile ? `New features will use the "${selectedProfile.name}" profile (${selectedProfile.model}, ${selectedProfile.thinkingLevel} thinking).` : 'Pre-select an AI profile when creating new features. Choose "None" to pick manually each time.'}

{/* Separator */}
{/* Issue Validation Model */}

Model used for validating GitHub issues. Opus provides the most thorough analysis, while Haiku is faster and more cost-effective.

{/* Separator */}
{/* Profiles Only Setting */}
onShowProfilesOnlyChange(checked === true)} className="mt-1" data-testid="show-profiles-only-checkbox" />

When enabled, the Add Feature dialog will show only AI profiles and hide advanced model tweaking options. This creates a cleaner, less overwhelming UI.

{/* Separator */}
{/* Automated Testing Setting */}
onDefaultSkipTestsChange(checked !== true)} className="mt-1" data-testid="default-skip-tests-checkbox" />

When enabled, new features will use TDD with automated tests. When disabled, features will require manual verification.

{/* Separator */}
{/* Dependency Blocking Setting */}
onEnableDependencyBlockingChange(checked === true)} className="mt-1" data-testid="enable-dependency-blocking-checkbox" />

When enabled, features with incomplete dependencies will show blocked badges and warnings. Auto mode and backlog ordering always respect dependencies regardless of this setting.

{/* Separator */}
{/* Worktree Isolation Setting */}
onUseWorktreesChange(checked === true)} className="mt-1" data-testid="use-worktrees-checkbox" />

Creates isolated git branches for each feature. When disabled, agents work directly in the main project directory.

); }