feat: add autoAcceptedPlan to options

This commit is contained in:
Li Xin
2025-04-24 17:24:58 +08:00
parent cd6afcdd98
commit 1755128209
4 changed files with 29 additions and 1 deletions

View File

@@ -17,11 +17,14 @@ import {
FormMessage,
} from "~/components/ui/form";
import { Input } from "~/components/ui/input";
import { Label } from "~/components/ui/label";
import { Switch } from "~/components/ui/switch";
import type { SettingsState } from "~/core/store";
import type { Tab } from "./types";
const generalFormSchema = z.object({
autoAcceptedPlan: z.boolean(),
maxPlanIterations: z.number().min(1, {
message: "Max plan iterations must be at least 1.",
}),
@@ -68,6 +71,26 @@ export const GeneralTab: Tab = ({
<main>
<Form {...form}>
<form className="space-y-8">
<FormField
control={form.control}
name="autoAcceptedPlan"
render={({ field }) => (
<FormItem>
<FormControl>
<div className="flex items-center gap-2">
<Switch
id="autoAcceptedPlan"
checked={field.value}
onCheckedChange={field.onChange}
/>
<Label className="text-sm" htmlFor="autoAcceptedPlan">
Auto accept plan
</Label>
</div>
</FormControl>
</FormItem>
)}
/>
<FormField
control={form.control}
name="maxPlanIterations"