Skip to content

Commit 333e996

Browse files
committed
experimental user settings form section
1 parent b059bdf commit 333e996

File tree

1 file changed

+40
-16
lines changed

1 file changed

+40
-16
lines changed

gui/src/pages/config/UserSettingsForm.tsx

Lines changed: 40 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
import { CheckIcon, XMarkIcon } from "@heroicons/react/24/outline";
1+
import {
2+
CheckIcon,
3+
ChevronRightIcon,
4+
XMarkIcon,
5+
} from "@heroicons/react/24/outline";
26
import {
37
SharedConfigSchema,
48
modifyAnyConfigWithSharedConfig,
@@ -19,6 +23,7 @@ export function UserSettingsForm() {
1923
const dispatch = useAppDispatch();
2024
const ideMessenger = useContext(IdeMessengerContext);
2125
const config = useAppSelector((state) => state.config.config);
26+
const [showExperimental, setShowExperimental] = useState(false);
2227

2328
function handleUpdate(sharedConfig: SharedConfigSchema) {
2429
// Optimistic update
@@ -164,21 +169,6 @@ export function UserSettingsForm() {
164169
}
165170
text="Text-to-Speech Output"
166171
/>
167-
168-
<div className="flex flex-col gap-1">
169-
<ToggleSwitch
170-
isToggled={autoAcceptEditToolDiffs}
171-
onToggle={() =>
172-
handleUpdate({
173-
autoAcceptEditToolDiffs: !autoAcceptEditToolDiffs,
174-
})
175-
}
176-
text="Auto-Accept Agent Edits"
177-
onWarningText={
178-
"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"
179-
}
180-
/>
181-
</div>
182172
{/* <ToggleSwitch
183173
isToggled={useChromiumForDocsCrawling}
184174
onToggle={() =>
@@ -343,6 +333,40 @@ export function UserSettingsForm() {
343333
</span>
344334
</form>
345335
</div>
336+
337+
<div className="flex flex-col gap-2">
338+
<div
339+
className="flex cursor-pointer items-center gap-2 text-left text-sm font-semibold"
340+
onClick={() => setShowExperimental(!showExperimental)}
341+
>
342+
<ChevronRightIcon
343+
className={`h-4 w-4 transition-transform ${
344+
showExperimental ? "rotate-90" : ""
345+
}`}
346+
/>
347+
<span>Experimental Settings</span>
348+
</div>
349+
<div
350+
className={`duration-400 overflow-hidden transition-all ease-in-out ${
351+
showExperimental ? "max-h-40" : "max-h-0"
352+
}`}
353+
>
354+
<div className="flex flex-col gap-1 pl-6">
355+
<ToggleSwitch
356+
isToggled={autoAcceptEditToolDiffs}
357+
onToggle={() =>
358+
handleUpdate({
359+
autoAcceptEditToolDiffs: !autoAcceptEditToolDiffs,
360+
})
361+
}
362+
text="Auto-Accept Agent Edits"
363+
onWarningText={
364+
"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"
365+
}
366+
/>
367+
</div>
368+
</div>
369+
</div>
346370
</div>
347371
) : null}
348372
</div>

0 commit comments

Comments
 (0)