import { Label } from '@/components/ui/label'; import { Checkbox } from '@/components/ui/checkbox'; import { FlaskConical, Settings2, TestTube, GitBranch, AlertCircle, Zap, ClipboardList, FileText, ScrollText, ShieldCheck, User, FastForward, } 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'; type PlanningMode = 'skip' | 'lite' | 'spec' | 'full'; interface FeatureDefaultsSectionProps { showProfilesOnly: boolean; defaultSkipTests: boolean; enableDependencyBlocking: boolean; skipVerificationInAutoMode: boolean; useWorktrees: boolean; defaultPlanningMode: PlanningMode; defaultRequirePlanApproval: boolean; defaultAIProfileId: string | null; aiProfiles: AIProfile[]; onShowProfilesOnlyChange: (value: boolean) => void; onDefaultSkipTestsChange: (value: boolean) => void; onEnableDependencyBlockingChange: (value: boolean) => void; onSkipVerificationInAutoModeChange: (value: boolean) => void; onUseWorktreesChange: (value: boolean) => void; onDefaultPlanningModeChange: (value: PlanningMode) => void; onDefaultRequirePlanApprovalChange: (value: boolean) => void; onDefaultAIProfileIdChange: (value: string | null) => void; } export function FeatureDefaultsSection({ showProfilesOnly, defaultSkipTests, enableDependencyBlocking, skipVerificationInAutoMode, useWorktrees, defaultPlanningMode, defaultRequirePlanApproval, defaultAIProfileId, aiProfiles, onShowProfilesOnlyChange, onDefaultSkipTestsChange, onEnableDependencyBlockingChange, onSkipVerificationInAutoModeChange, onUseWorktreesChange, onDefaultPlanningModeChange, onDefaultRequirePlanApprovalChange, onDefaultAIProfileIdChange, }: 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 */}
{/* 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 */}
{/* Skip Verification in Auto Mode Setting */}
onSkipVerificationInAutoModeChange(checked === true)} className="mt-1" data-testid="skip-verification-auto-mode-checkbox" />

When enabled, auto mode will grab features even if their dependencies are not verified, as long as they are not currently running. This allows faster pipeline execution without waiting for manual verification.

{/* 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.

); }