Files
automaker/apps/ui/src/components/views/board-view/dialogs/worktree-settings-popover.tsx
webdevcody 5ec5fe82e6 refactor: Enhance project management features and UI components
- Updated create-pr.ts to improve commit error handling and logging.
- Enhanced project-switcher.tsx with new folder opening functionality and state management for project setup.
- Expanded icon-picker.tsx to include a comprehensive list of icons organized by category.
- Replaced dialog components with popover components for auto mode and plan settings, improving UI responsiveness.
- Refactored board-view components to streamline feature management and enhance user experience.
- Removed outdated dialog components and replaced them with popover alternatives for better accessibility.

These changes aim to improve the overall usability and functionality of the project management interface.
2026-01-13 22:35:45 -05:00

62 lines
2.3 KiB
TypeScript

import { Popover, PopoverContent, PopoverTrigger } from '@/components/ui/popover';
import { Label } from '@/components/ui/label';
import { Switch } from '@/components/ui/switch';
import { GitBranch, Settings2 } from 'lucide-react';
interface WorktreeSettingsPopoverProps {
addFeatureUseSelectedWorktreeBranch: boolean;
onAddFeatureUseSelectedWorktreeBranchChange: (value: boolean) => void;
}
export function WorktreeSettingsPopover({
addFeatureUseSelectedWorktreeBranch,
onAddFeatureUseSelectedWorktreeBranchChange,
}: WorktreeSettingsPopoverProps) {
return (
<Popover>
<PopoverTrigger asChild>
<button
className="p-1 rounded hover:bg-accent/50 transition-colors"
title="Worktree Settings"
data-testid="worktree-settings-button"
>
<Settings2 className="w-4 h-4 text-muted-foreground" />
</button>
</PopoverTrigger>
<PopoverContent className="w-72" align="end" sideOffset={8}>
<div className="space-y-3">
<div>
<h4 className="font-medium text-sm mb-1">Worktree Settings</h4>
<p className="text-xs text-muted-foreground">
Configure how worktrees affect feature creation.
</p>
</div>
<div className="flex items-center justify-between gap-3 p-2 rounded-md bg-secondary/50">
<div className="flex items-center gap-2 flex-1 min-w-0">
<GitBranch className="w-4 h-4 text-brand-500 shrink-0" />
<Label
htmlFor="worktree-branch-toggle"
className="text-xs font-medium cursor-pointer"
>
Default to worktree mode
</Label>
</div>
<Switch
id="worktree-branch-toggle"
checked={addFeatureUseSelectedWorktreeBranch}
onCheckedChange={onAddFeatureUseSelectedWorktreeBranchChange}
data-testid="worktree-branch-toggle"
/>
</div>
<p className="text-[10px] text-muted-foreground leading-relaxed">
New features will automatically use isolated worktrees, keeping changes separate from
your main branch until you're ready to merge.
</p>
</div>
</PopoverContent>
</Popover>
);
}