settings form updates
This commit is contained in:
parent
eb07a461f5
commit
21066956de
3 changed files with 20 additions and 25 deletions
|
|
@ -1,14 +1,12 @@
|
|||
import { ExclamationTriangleIcon } from "@heroicons/react/24/outline";
|
||||
import React from "react";
|
||||
import React, { ReactNode } from "react";
|
||||
import { vscButtonBackground } from "..";
|
||||
import { ToolTip } from "./Tooltip";
|
||||
|
||||
type ToggleSwitchProps = {
|
||||
isToggled: boolean;
|
||||
onToggle: () => void;
|
||||
text: string;
|
||||
size?: number;
|
||||
onWarningText?: string;
|
||||
showIfToggled?: ReactNode;
|
||||
};
|
||||
|
||||
const ToggleSwitch: React.FC<ToggleSwitchProps> = ({
|
||||
|
|
@ -16,25 +14,13 @@ const ToggleSwitch: React.FC<ToggleSwitchProps> = ({
|
|||
onToggle,
|
||||
text,
|
||||
size = 16,
|
||||
onWarningText,
|
||||
showIfToggled,
|
||||
}) => {
|
||||
return (
|
||||
<div className="flex cursor-pointer select-none items-center justify-between gap-3">
|
||||
<span className="truncate-right">{text}</span>
|
||||
<div className="flex flex-row items-center gap-1">
|
||||
{isToggled && !!onWarningText && (
|
||||
<>
|
||||
<ExclamationTriangleIcon
|
||||
data-tooltip-id={`${text}-warning-tooltip`}
|
||||
className="text-yellow-500"
|
||||
style={{
|
||||
height: size,
|
||||
width: size,
|
||||
}}
|
||||
/>
|
||||
<ToolTip id={`${text}-warning-tooltip`}>{onWarningText}</ToolTip>
|
||||
</>
|
||||
)}
|
||||
{isToggled && !!showIfToggled && showIfToggled}
|
||||
<div
|
||||
className={`border-vsc-input-border bg-vsc-input-background flex items-center rounded-full border border-solid`}
|
||||
onClick={onToggle}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
import {
|
||||
CheckIcon,
|
||||
ChevronRightIcon,
|
||||
ExclamationTriangleIcon,
|
||||
XMarkIcon,
|
||||
} from "@heroicons/react/24/outline";
|
||||
import {
|
||||
|
|
@ -12,6 +13,7 @@ import { Input } from "../../components";
|
|||
import NumberInput from "../../components/gui/NumberInput";
|
||||
import { Select } from "../../components/gui/Select";
|
||||
import ToggleSwitch from "../../components/gui/Switch";
|
||||
import { ToolTip } from "../../components/gui/Tooltip";
|
||||
import { useFontSize } from "../../components/ui/font";
|
||||
import { IdeMessengerContext } from "../../context/IdeMessenger";
|
||||
import { useAppDispatch, useAppSelector } from "../../redux/hooks";
|
||||
|
|
@ -360,8 +362,16 @@ export function UserSettingsForm() {
|
|||
})
|
||||
}
|
||||
text="Auto-Accept Agent Edits"
|
||||
onWarningText={
|
||||
"Be very careful with this setting. When turned on, Agent mode's edit tool can make changes to files with no manual review or guaranteed stopping point"
|
||||
showIfToggled={
|
||||
<>
|
||||
<ExclamationTriangleIcon
|
||||
data-tooltip-id={`auto-accept-diffs-warning-tooltip`}
|
||||
className="h-3 w-3 text-yellow-500"
|
||||
/>
|
||||
<ToolTip id={`auto-accept-diffs-warning-tooltip`}>
|
||||
{`Be very careful with this setting. When turned on, Agent mode's edit tool can make changes to files with no manual review or guaranteed stopping point`}
|
||||
</ToolTip>
|
||||
</>
|
||||
}
|
||||
/>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -39,10 +39,9 @@ export const editToolImpl: ClientToolImpl = async (
|
|||
respondImmediately: true,
|
||||
output: undefined, // TODO - feed edit results back to model (also in parallel listeners)
|
||||
};
|
||||
} else {
|
||||
return {
|
||||
respondImmediately: false,
|
||||
output: undefined, // No immediate output.
|
||||
};
|
||||
}
|
||||
return {
|
||||
respondImmediately: false,
|
||||
output: undefined, // No immediate output.
|
||||
};
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue