mirror of
https://github.com/AutoMaker-Org/automaker.git
synced 2026-02-02 08:33:36 +00:00
feat(worktree): add AI commit message generation feature
- Implemented a new endpoint to generate commit messages based on git diffs. - Updated worktree routes to include the AI commit message generation functionality. - Enhanced the UI to support automatic generation of commit messages when the commit dialog opens, based on user settings. - Added settings for enabling/disabling AI-generated commit messages and configuring the model used for generation.
This commit is contained in:
@@ -10,6 +10,7 @@ import {
|
||||
ScrollText,
|
||||
ShieldCheck,
|
||||
FastForward,
|
||||
Sparkles,
|
||||
} from 'lucide-react';
|
||||
import { cn } from '@/lib/utils';
|
||||
import {
|
||||
@@ -28,11 +29,13 @@ interface FeatureDefaultsSectionProps {
|
||||
skipVerificationInAutoMode: boolean;
|
||||
defaultPlanningMode: PlanningMode;
|
||||
defaultRequirePlanApproval: boolean;
|
||||
enableAiCommitMessages: boolean;
|
||||
onDefaultSkipTestsChange: (value: boolean) => void;
|
||||
onEnableDependencyBlockingChange: (value: boolean) => void;
|
||||
onSkipVerificationInAutoModeChange: (value: boolean) => void;
|
||||
onDefaultPlanningModeChange: (value: PlanningMode) => void;
|
||||
onDefaultRequirePlanApprovalChange: (value: boolean) => void;
|
||||
onEnableAiCommitMessagesChange: (value: boolean) => void;
|
||||
}
|
||||
|
||||
export function FeatureDefaultsSection({
|
||||
@@ -41,11 +44,13 @@ export function FeatureDefaultsSection({
|
||||
skipVerificationInAutoMode,
|
||||
defaultPlanningMode,
|
||||
defaultRequirePlanApproval,
|
||||
enableAiCommitMessages,
|
||||
onDefaultSkipTestsChange,
|
||||
onEnableDependencyBlockingChange,
|
||||
onSkipVerificationInAutoModeChange,
|
||||
onDefaultPlanningModeChange,
|
||||
onDefaultRequirePlanApprovalChange,
|
||||
onEnableAiCommitMessagesChange,
|
||||
}: FeatureDefaultsSectionProps) {
|
||||
return (
|
||||
<div
|
||||
@@ -251,6 +256,34 @@ export function FeatureDefaultsSection({
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* Separator */}
|
||||
<div className="border-t border-border/30" />
|
||||
|
||||
{/* AI Commit Messages Setting */}
|
||||
<div className="group flex items-start space-x-3 p-3 rounded-xl hover:bg-accent/30 transition-colors duration-200 -mx-3">
|
||||
<Checkbox
|
||||
id="enable-ai-commit-messages"
|
||||
checked={enableAiCommitMessages}
|
||||
onCheckedChange={(checked) => onEnableAiCommitMessagesChange(checked === true)}
|
||||
className="mt-1"
|
||||
data-testid="enable-ai-commit-messages-checkbox"
|
||||
/>
|
||||
<div className="space-y-1.5">
|
||||
<Label
|
||||
htmlFor="enable-ai-commit-messages"
|
||||
className="text-foreground cursor-pointer font-medium flex items-center gap-2"
|
||||
>
|
||||
<Sparkles className="w-4 h-4 text-brand-500" />
|
||||
Generate AI commit messages
|
||||
</Label>
|
||||
<p className="text-xs text-muted-foreground/80 leading-relaxed">
|
||||
When enabled, opening the commit dialog will automatically generate a commit message
|
||||
using AI based on your staged or unstaged changes. You can configure the model used in
|
||||
Model Defaults.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
||||
@@ -28,6 +28,11 @@ const QUICK_TASKS: PhaseConfig[] = [
|
||||
label: 'Image Descriptions',
|
||||
description: 'Analyzes and describes context images',
|
||||
},
|
||||
{
|
||||
key: 'commitMessageModel',
|
||||
label: 'Commit Messages',
|
||||
description: 'Generates git commit messages from diffs',
|
||||
},
|
||||
];
|
||||
|
||||
const VALIDATION_TASKS: PhaseConfig[] = [
|
||||
|
||||
Reference in New Issue
Block a user