@devries-cameron20 / t3code Mirror · read-only / commits / a37e0f3dba
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

Mirrored from https://github.com/Camo67/t3code.git

Synced Nov 23, 06:45 UTC

perf(web): the provider settings form compiles without manual memoization (#20618)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>

Julius Marminge committed Oct 16, 2026 at 22:00 UTC a37e0f3dba1bad00bdb8c11ad4f4ba4ff750ffab
1 file changed +13 -14
apps/web/src/components/settings/ProviderSettingsForm.tsx
+13 -14
@@ -1,6 +1,6 @@
1 "use client";
2
3 -import { useEffect, useMemo, useRef, useState, type ReactNode } from "react";
3 +import { useEffect, useRef, useState, type ReactNode } from "react";
4 import * as Option from "effect/Option";
5 import * as Schema from "effect/Schema";
6 import {
@@ -154,19 +154,21 @@ function commandArgumentsEqual(left: ReadonlyArray<string>, right: ReadonlyArray
154 return left.length === right.length && left.every((argument, index) => argument === right[index]);
155 }
156
157 +function configuredCommandArgs(value: ProviderSettingsFormProps["value"]) {
158 + const configured =
159 + value !== null && typeof value === "object"
160 + ? (value as Record<string, unknown>).commandArgs
161 + : undefined;
162 + return Array.isArray(configured)
163 + ? configured.filter((argument): argument is string => typeof argument === "string")
164 + : [];
165 +}
166 +
167 function ProviderCommandArguments({
168 value,
169 onChange,
170 }: Pick<ProviderSettingsFormProps, "value" | "onChange">) {
161 - const args = useMemo(() => {
162 - const configured =
163 - value !== null && typeof value === "object"
164 - ? (value as Record<string, unknown>).commandArgs
165 - : undefined;
166 - return Array.isArray(configured)
167 - ? configured.filter((argument): argument is string => typeof argument === "string")
168 - : [];
169 - }, [value]);
171 + const args = configuredCommandArgs(value);
172 const [rows, setRows] = useState(() => args.map(makeCommandArgumentDraftRow));
173 const rowsRef = useRef(rows);
174 const previousArgsRef = useRef(args);
@@ -551,10 +553,7 @@ export function ProviderSettingsForm({
553 variant,
554 onChange,
555 }: ProviderSettingsFormProps) {
554 - const fields = useMemo(
555 - () => deriveProviderSettingsFields(definition, value),
556 - [definition, value],
557 - );
556 + const fields = deriveProviderSettingsFields(definition, value);
557 const isLocalAcp =
558 definition.driverKind === "acpRegistry" &&
559 readProviderConfigString(value, "source") === "local";