diff --git a/web/src/modules/inferences/InferenceDetail.tsx b/web/src/modules/inferences/InferenceDetail.tsx index acdeba0a..34094fe9 100644 --- a/web/src/modules/inferences/InferenceDetail.tsx +++ b/web/src/modules/inferences/InferenceDetail.tsx @@ -6,6 +6,7 @@ import { ArrowLeft, TriangleAlert } from "lucide-react"; import { useModulePath } from "@/shell"; import { api } from "@swiss/lib/api"; import { isUninstalling } from "@swiss/lib/phase"; +import { pollOptions, usePollingPaused } from "@swiss/lib/polling"; import { useReleaseObjects } from "@swiss/components/ReleaseObjects"; import { ReleaseObjects } from "@swiss/components/ReleaseObjects"; import { Endpoint } from "@swiss/components/Endpoint"; @@ -36,13 +37,15 @@ export function InferenceDetail() { const [editingSLO, setEditingSLO] = useState(false); // Set by the deploy sheet after a first install with SLO on. const [sloSetup, setSloSetup] = useState(() => (location.state as { sloSetup?: boolean } | null)?.sloSetup === true); + const paused = usePollingPaused(); + const poll = !upgrading && !paused; // Query keys match swiss's pages, so the two views share one cache. // Polling pauses while the upgrade sheet covers the page. const status = useQuery({ queryKey: ["status", namespace, release], queryFn: () => api.status(namespace, release), - refetchInterval: upgrading ? false : 15_000, + ...pollOptions(poll, 15_000), enabled: !!namespace, }); // A release swiss did not deploy has no plan beside it: untracked, not an error. @@ -53,7 +56,7 @@ export function InferenceDetail() { enabled: !!namespace, }); const cluster = useQuery({ queryKey: ["cluster"], queryFn: api.cluster }); - const objects = useReleaseObjects(namespace, release, !upgrading); + const objects = useReleaseObjects(namespace, release, poll); const revisions = useQuery({ queryKey: ["revisions", namespace, release], queryFn: () => api.revisions(namespace, release), diff --git a/web/src/modules/inferences/InferenceList.tsx b/web/src/modules/inferences/InferenceList.tsx index 4e230e90..9c4906cc 100644 --- a/web/src/modules/inferences/InferenceList.tsx +++ b/web/src/modules/inferences/InferenceList.tsx @@ -16,6 +16,7 @@ import { Bot, Plus } from "lucide-react"; import { formatDateTime, useModulePath } from "@/shell"; import { api, type Deployment } from "@swiss/lib/api"; import { isUninstalling } from "@swiss/lib/phase"; +import { pollOptions, usePollingPaused } from "@swiss/lib/polling"; import { useT } from "@/modules/inferences/i18n"; import { detailPath, modelLine, rowState } from "@/modules/inferences/lib"; import { StatusDot } from "@/modules/inferences/components/StatusDot"; @@ -36,12 +37,13 @@ export function InferenceList() { const [pageSize, setPageSize] = useState(25); const [uninstalling, setUninstalling] = useState(null); const [upgrading, setUpgrading] = useState(null); + const paused = usePollingPaused(); // swiss's key prefix, so an uninstall from either side refreshes both. const list = useQuery({ queryKey: ["deployments", "inferences", page, pageSize], queryFn: () => api.deployments(page, pageSize), - refetchInterval: 15_000, + ...pollOptions(!upgrading && !paused, 15_000), placeholderData: (prev) => prev, }); const cluster = useQuery({ queryKey: ["cluster"], queryFn: api.cluster }); diff --git a/web/src/modules/inferences/components/DeployForm.test.tsx b/web/src/modules/inferences/components/DeployForm.test.tsx index 4c513bcf..809611f6 100644 --- a/web/src/modules/inferences/components/DeployForm.test.tsx +++ b/web/src/modules/inferences/components/DeployForm.test.tsx @@ -484,4 +484,12 @@ describe("PD role scheduling", () => { ); expect([en, zh].some((l) => noKeyHtml.includes(l.deploy.fields.pdGpuMissingLabelKey.replace("{role}", "prefill")))).toBe(true); }); + + it("freezes the form fieldset while prefilling", () => { + const frozen = renderToStaticMarkup(); + expect(frozen).toMatch(/^]*disabled=""[^>]*inert=""[^>]*aria-busy="true"/); + expect(frozen).toContain("pointer-events-none"); + const active = renderToStaticMarkup(); + expect(active).toMatch(/^]*disabled)/); + }); }); diff --git a/web/src/modules/inferences/components/DeployForm.tsx b/web/src/modules/inferences/components/DeployForm.tsx index 320dad39..07243a23 100644 --- a/web/src/modules/inferences/components/DeployForm.tsx +++ b/web/src/modules/inferences/components/DeployForm.tsx @@ -55,6 +55,7 @@ export interface DeployFormProps { form: Form; onChange: (patch: Partial
) => void; upgrade?: boolean; + disabled?: boolean; submitted: boolean; target: ReactNode; cluster?: ClusterInfo; @@ -74,6 +75,7 @@ export interface DeployFormProps { catalogRoute?: string; // The chart's values and swissd's layers for the Override YAML editor. helmValues?: HelmValuesSource; + onHelmValuesOpenChange?: (open: boolean) => void; // Every image the chart renders, from the compose dry run. Absent until that // returns; the engine row still shows from defaults.image. slots?: ImageSlot[]; @@ -99,7 +101,7 @@ export interface DeployFormProps { taints?: ClusterTaint[]; } -export function DeployForm({ form, onChange, upgrade, submitted, target, cluster, defaults, gpuOptions, gpuListed, gpuResources, capacity, expanded, onExpand, idPrefix, routeOptions, catalogRoute, helmValues, slots, slotsError, resources, pd, nodes, gpuSpecs, gpuVendor, recovery, inputs, droppedInputs, remember, onRemember, presets, taints }: DeployFormProps) { +export function DeployForm({ form, onChange, upgrade, disabled, submitted, target, cluster, defaults, gpuOptions, gpuListed, gpuResources, capacity, expanded, onExpand, idPrefix, routeOptions, catalogRoute, helmValues, onHelmValuesOpenChange, slots, slotsError, resources, pd, nodes, gpuSpecs, gpuVendor, recovery, inputs, droppedInputs, remember, onRemember, presets, taints }: DeployFormProps) { const t = useT(); const checked = useDebounced(form.inputs, CHECK_MS); const on = effective(form); @@ -129,7 +131,12 @@ export function DeployForm({ form, onChange, upgrade, submitted, target, cluster ); return ( -
+
{section( "basic", <> @@ -329,10 +336,10 @@ export function DeployForm({ form, onChange, upgrade, submitted, target, cluster {sw("skipSchemaValidation", f("skipSchemaValidation"))} - onChange({ edits })} source={helmValues} /> + onChange({ edits })} source={helmValues} onOpenChange={onHelmValuesOpenChange} /> , )} -
+ ); } diff --git a/web/src/modules/inferences/components/DeploySheet.tsx b/web/src/modules/inferences/components/DeploySheet.tsx index 4d618444..59fb816b 100644 --- a/web/src/modules/inferences/components/DeploySheet.tsx +++ b/web/src/modules/inferences/components/DeploySheet.tsx @@ -1,6 +1,6 @@ import { useEffect, useMemo, useState } from "react"; import { useNavigate } from "react-router"; -import { useMutation, useQueries, useQuery, useQueryClient } from "@tanstack/react-query"; +import { keepPreviousData, useMutation, useQueries, useQuery, useQueryClient } from "@tanstack/react-query"; import { Alert, AlertDescription, @@ -42,14 +42,15 @@ import { messageOf, useToast } from "@swiss/components/ui/toast"; import { useDebounced } from "@swiss/lib/useDebounced"; import { cacheCard } from "@swiss/lib/cache"; import { installMethod, llmsvcBlock } from "@swiss/lib/applyWith"; +import { usePausePolling } from "@swiss/lib/polling"; import { useT } from "@/modules/inferences/i18n"; import { detailPath, sloEnabled } from "@/modules/inferences/lib"; import { SECTIONS, chartChoice, clusterTaints, defaultServiceId, pipelineState, serviceIdError, whatMoves, type Section } from "@/modules/inferences/deploy-lib"; import { DeployForm } from "@/modules/inferences/components/DeployForm"; -import { OverrideYamlButton, type HelmValuesSource } from "@/modules/inferences/components/OverrideYaml"; +import { OverrideYamlButton, helmValuesQueryOptions, type HelmValuesSource } from "@/modules/inferences/components/OverrideYaml"; import { ExperimentalBadge } from "@/modules/inferences/components/InstallMethodLabel"; import { AdaptivePlanChangedError, composeAdaptivePlan, withAdaptiveConcurrency } from "../adaptive-concurrency"; -import { composeRecoveryPlan, composeRecoveryValuesRequest, RecoveryPlanChangedError } from "../recovery-compose"; +import { composeRecoveryPlan, RecoveryPlanChangedError } from "../recovery-compose"; import { RecoveryFields } from "./RecoveryFields"; import { mergeValues, planValues, recoveryError, recoveryInputError, recoverySettings, withRecovery } from "../recovery"; import { readRouteOptions } from "@/modules/inferences/api"; @@ -68,6 +69,7 @@ export function DeploySheet({ target, onClose }: { target: DeployTarget | null; } function DeploySheetBody({ target, onClose }: { target: DeployTarget; onClose: () => void }) { + usePausePolling(); const t = useT(); const p = useModulePath(); const navigate = useNavigate(); @@ -101,7 +103,7 @@ function DeploySheetBody({ target, onClose }: { target: DeployTarget; onClose: ( const catalogName = moveTo || ownCatalog; const indexes = useQueries({ - queries: catalogs.map((c) => ({ queryKey: ["catalog", c.name], queryFn: () => api.catalog(c.name), enabled: upgrade || c.name === ownCatalog })), + queries: catalogs.map((c) => ({ queryKey: ["catalog", c.name], queryFn: () => api.catalog(c.name), enabled: upgrade || c.name === ownCatalog, retry: false })), }); const modelIn = (name?: string): CatalogModel | undefined => indexes[catalogs.findIndex((c) => c.name === name)]?.data?.models.find((m) => m.name === modelName); @@ -124,6 +126,7 @@ function DeploySheetBody({ target, onClose }: { target: DeployTarget; onClose: ( queryKey: ["model", catalogName, modelName, keptVariant, version], queryFn: () => api.model(modelName!, { catalog: catalogName, variant: keptVariant || undefined, version: version || undefined }), enabled: !!modelName && !!catalogName, + placeholderData: keepPreviousData, }); const v = entry.data?.variant; const chartRange = !!v && isChartRange(v.chart.version); @@ -169,11 +172,15 @@ function DeploySheetBody({ target, onClose }: { target: DeployTarget; onClose: ( setUpgradeSeed(seeded); setForm(seeded); }, [upgrade, seedPlan, v, profile.isPending, gpuSpecs, upgradeSeed]); - const catalogRoute = upgrade && upgradeSeed ? upgradeSeed.route || upgradeSeed.serviceId || target.release : undefined; + const catalogRoute = useMemo(() => { + if (!upgrade || !seedPlan) return undefined; + const base = upgradeSeed ?? formFromPlan(seedPlan); + return base.route || base.serviceId || target.release; + }, [upgrade, seedPlan, upgradeSeed, target]); const routeOptions = useQuery({ queryKey: ["route-options", catalogRoute ?? ""], queryFn: ({ signal }) => readRouteOptions(catalogRoute, signal), - enabled: !upgrade || !!upgradeSeed, + enabled: !upgrade || !!seedPlan, staleTime: 30_000, retry: false, }); @@ -182,6 +189,7 @@ function DeploySheetBody({ target, onClose }: { target: DeployTarget; onClose: ( const dirty = useDirty({ form, version, variant, moveTo, chartVersion, recovery }, { form: initial, version: upgrade ? "" : (target.version ?? ""), variant: upgrade ? "" : (target.variant ?? ""), moveTo: "", chartVersion: "", recovery: initialRecovery }); const [step, setStep] = useState<"form" | "review">("form"); + const [yamlOpen, setYamlOpen] = useState(false); const [submitted, setSubmitted] = useState(false); const [expanded, setExpanded] = useState(OPEN); const [plan, setPlan] = useState(null); @@ -194,7 +202,7 @@ function DeploySheetBody({ target, onClose }: { target: DeployTarget; onClose: ( // The form shows only once the entry and profile have loaded, so the first // seed lands before any plan; a later one is another variant or version, and // a plan composed from the old switches goes with it. - const seedReady = !upgrade && !!entry.data && !profile.isPending; + const seedReady = !upgrade && !!entry.data && !entry.isPlaceholderData && !profile.isPending; const siteDefaults = useMemo(() => siteSwitchDefaults(profile.data), [profile.data]); const variantValues = entry.data?.variant.values; useEffect(() => { @@ -232,14 +240,15 @@ function DeploySheetBody({ target, onClose }: { target: DeployTarget; onClose: ( profile.data?.profile, ); // An upgrade waits for the profile too: it decides Monitor (planRequest). - const loading = cluster.isPending || (upgrade && current.isPending) || profile.isPending || entry.isPending; + const baseLoading = cluster.isPending || (upgrade && current.isPending) || profile.isPending || entry.isPending; const error = cluster.error ?? current.error ?? entry.error; const nextSeed = useMemo(() => (seedReady ? switchDefaults(siteDefaults, variantValues) : null), [seedReady, siteDefaults, variantValues]); const formSeeded = upgrade ? !!upgradeSeed : !!seed && !!nextSeed && JSON.stringify(seed) === JSON.stringify(nextSeed); + const loading = baseLoading || (!error && !formSeeded); // Chart discovery (images and per-role chart defaults) runs once on open after // the form is seeded, on target changes, and on manual refresh. // Override YAML runs its own standalone dry-run when opened so form edits stay quiet. - const canDiscover = !loading && !error && formSeeded && (!upgrade || !!recorded) && cluster.data?.allowDeploy !== false; + const canDiscover = !loading && !error && !entry.isPlaceholderData && (!upgrade || !!recorded) && cluster.data?.allowDeploy !== false; const compositionError = (error: unknown) => { if (error instanceof RecoveryPlanChangedError) return new Error(t("deploy.recovery.errors.changedPlan")); if (error instanceof AdaptivePlanChangedError) return new Error(t("deploy.fields.adaptiveChanged")); @@ -251,38 +260,21 @@ function DeploySheetBody({ target, onClose }: { target: DeployTarget; onClose: ( canDiscover, gpuSpecs, ); - const valuesKey = JSON.stringify( - canDiscover - ? withAdaptiveConcurrency(withRecovery(requestFor({ ...form, edits: "" }), recovery), form, routeOptions.data) - : null, - ); - const valuesM = useMutation({ - mutationFn: async (_key: string) => { - try { - const next = await composeRecoveryValuesRequest( - requestFor({ ...form, edits: "" }), - recovery, - (r) => composeAdaptivePlan(r, form, routeOptions.data, deployApi.plan, catalogName), - catalogName, - ); - return await deployApi.helmValues(next); - } catch (error) { - throw compositionError(error); - } - }, - }); - const valuesFresh = valuesM.variables === valuesKey; + // Freeze the form and actions while prefill (initial seed, target variant + // fetch, or chart dry-run discovery for resources/PD/images) is in flight. + const prefilling = loading || entry.isFetching || preview.fetching; + const valuesRequest = canDiscover + ? withAdaptiveConcurrency(withRecovery(requestFor({ ...form, edits: "" }), recovery), form, routeOptions.data) + : undefined; + const helmValues = useQuery(helmValuesQueryOptions(valuesRequest, yamlOpen && step === "form" && canDiscover)); const valuesSource: HelmValuesSource = { - data: valuesFresh && !valuesM.isError ? valuesM.data : undefined, - loading: valuesM.isPending, - error: valuesFresh && valuesM.error ? (valuesM.error instanceof Error ? valuesM.error : new Error(String(valuesM.error))) : null, + data: helmValues.data, + loading: helmValues.isFetching, + error: helmValues.error instanceof Error ? helmValues.error : helmValues.error ? new Error(String(helmValues.error)) : null, load: async () => { - if (!canDiscover) return undefined; - try { - return await valuesM.mutateAsync(valuesKey); - } catch { - return undefined; - } + if (!valuesRequest) return undefined; + const res = await helmValues.refetch({ cancelRefetch: false }); + return res.error ? undefined : res.data; }, }; const compose = useMutation({ @@ -495,11 +487,11 @@ function DeploySheetBody({ target, onClose }: { target: DeployTarget; onClose: ( variant="outline" size="sm" className="shrink-0" - disabled={preview.fetching} + disabled={prefilling} onClick={() => void preview.reload()} title={t("deploy.refreshPreviewHint")} > - + {t("common:actions.refresh")} )} @@ -509,14 +501,14 @@ function DeploySheetBody({ target, onClose }: { target: DeployTarget; onClose: ( {step === "form" && !loading && !error && (
{SECTIONS.map((s) => ( - ))}
)} - + {readOnly && ( @@ -542,6 +534,7 @@ function DeploySheetBody({ target, onClose }: { target: DeployTarget; onClose: ( form={form} onChange={change} upgrade={upgrade} + disabled={prefilling} submitted={submitted} recovery={ setRecoveryPatch((previous) => ({ ...previous, ...patch }))} />} target={targetFields} @@ -568,6 +561,7 @@ function DeploySheetBody({ target, onClose }: { target: DeployTarget; onClose: ( catalogRoute={catalogRoute} idPrefix={ID_PREFIX} helmValues={readOnly ? undefined : valuesSource} + onHelmValuesOpenChange={setYamlOpen} inputs={inputs} droppedInputs={droppedInputs} remember={canRemember ? remember : undefined} @@ -603,8 +597,8 @@ function DeploySheetBody({ target, onClose }: { target: DeployTarget; onClose: ( {step === "form" ? ( <> - change({ edits })} source={readOnly ? undefined : valuesSource} disabled={!!readOnly || loading} /> - diff --git a/web/src/modules/inferences/components/OverrideYaml.test.tsx b/web/src/modules/inferences/components/OverrideYaml.test.tsx index f9418d84..87a9e00a 100644 --- a/web/src/modules/inferences/components/OverrideYaml.test.tsx +++ b/web/src/modules/inferences/components/OverrideYaml.test.tsx @@ -1,9 +1,16 @@ -import { describe, expect, it } from "vitest"; +import { afterEach, describe, expect, it, vi } from "vitest"; import { renderToStaticMarkup } from "react-dom/server"; -import { OverrideYaml } from "./OverrideYaml"; +import { QueryClient, QueryObserver, environmentManager } from "@tanstack/react-query"; +import { deployApi, type PlanRequest } from "@swiss/lib/api"; +import { OverrideYaml, helmValuesQueryOptions } from "./OverrideYaml"; import en from "@/modules/inferences/locales/en-US.json"; import zh from "@/modules/inferences/locales/zh-CN.json"; +afterEach(() => { + vi.restoreAllMocks(); + environmentManager.setIsServer(() => typeof window === "undefined"); +}); + const render = (value: string) => renderToStaticMarkup( {}} />); describe("Override YAML in the form", () => { @@ -38,3 +45,61 @@ describe("key search", () => { expect(html).not.toContain('role="listbox"'); }); }); + +describe("Override YAML dry-run query", () => { + it("stays idle while closed, calls /api/v2/compose dry-run once across concurrent/reopen loads, and never calls /api/plans", async () => { + environmentManager.setIsServer(() => false); + const helm = { defaults: "replicaCount: 1\n", overrides: "{}\n" }; + const helmSpy = vi.spyOn(deployApi, "helmValues").mockResolvedValue(helm); + const planSpy = vi.spyOn(deployApi, "plan"); + const client = new QueryClient({ defaultOptions: { queries: { retry: false } } }); + const req1: PlanRequest = { model: "m", catalog: "c", overrides: { replicaCount: 2 } }; + const req2: PlanRequest = { model: "m", catalog: "c", overrides: { replicaCount: 4 } }; + + const observerA = new QueryObserver(client, helmValuesQueryOptions(req1, false)); + const observerB = new QueryObserver(client, helmValuesQueryOptions(req1, false)); + const unsubA = observerA.subscribe(() => {}); + const unsubB = observerB.subscribe(() => {}); + + // Closed dialog + form edits while closed stay quiet. + await Promise.resolve(); + observerA.setOptions(helmValuesQueryOptions(req2, false)); + observerB.setOptions(helmValuesQueryOptions(req2, false)); + await Promise.resolve(); + expect(helmSpy).not.toHaveBeenCalled(); + + // Opening with two concurrent observers (e.g. StrictMode) triggers a single dry-run call. + observerA.setOptions(helmValuesQueryOptions(req1, true)); + observerB.setOptions(helmValuesQueryOptions(req1, true)); + await vi.waitFor(() => expect(observerA.getCurrentResult().data).toEqual(helm)); + expect(observerB.getCurrentResult().data).toEqual(helm); + expect(helmSpy).toHaveBeenCalledTimes(1); + expect(helmSpy).toHaveBeenCalledWith(req1); + expect(planSpy).not.toHaveBeenCalled(); + + // Close and reopen without changing the request: uses cache, 0 extra calls. + observerA.setOptions(helmValuesQueryOptions(req1, false)); + await Promise.resolve(); + observerA.setOptions(helmValuesQueryOptions(req1, true)); + await Promise.resolve(); + expect(helmSpy).toHaveBeenCalledTimes(1); + + // Concurrent manual reloads dedupe to one new dry-run call; form change while open fetches once. + const [r1, r2] = await Promise.all([ + observerA.refetch({ cancelRefetch: false }), + observerB.refetch({ cancelRefetch: false }), + ]); + expect(r1.data).toEqual(helm); + expect(r2.data).toEqual(helm); + expect(helmSpy).toHaveBeenCalledTimes(2); + + observerA.setOptions(helmValuesQueryOptions(req2, true)); + observerB.setOptions(helmValuesQueryOptions(req2, true)); + await vi.waitFor(() => expect(helmSpy).toHaveBeenCalledTimes(3)); + expect(helmSpy).toHaveBeenLastCalledWith(req2); + expect(planSpy).not.toHaveBeenCalled(); + + unsubA(); + unsubB(); + }); +}); diff --git a/web/src/modules/inferences/components/OverrideYaml.tsx b/web/src/modules/inferences/components/OverrideYaml.tsx index f55a4287..a19c76f9 100644 --- a/web/src/modules/inferences/components/OverrideYaml.tsx +++ b/web/src/modules/inferences/components/OverrideYaml.tsx @@ -20,7 +20,7 @@ import { TabsTrigger, } from "@modelsphere/ui"; import { Lock, Pencil, TriangleAlert } from "lucide-react"; -import type { HelmValues } from "@swiss/lib/api"; +import { deployApi, type HelmValues, type PlanRequest } from "@swiss/lib/api"; import { useT } from "@/modules/inferences/i18n"; import { KeySearch } from "./KeySearch"; import { YamlTextarea, type YamlTextareaHandle } from "./YamlTextarea"; @@ -28,6 +28,28 @@ import { computedYaml, keyLines, mergeValues, overrideEdit, overridePaths, parse const message = (error: unknown) => (error instanceof Error ? error.message : String(error)); +export function helmValuesQueryOptions(request: PlanRequest | undefined, opened: boolean) { + const valuesKey = JSON.stringify(request ?? null); + return { + queryKey: ["helm-values", valuesKey] as const, + queryFn: (): Promise => deployApi.helmValues(request!), + enabled: opened && !!request, + retry: false as const, + staleTime: Infinity, + // Dropped when the sheet closes: they last one install or upgrade. + gcTime: 0, + }; +} + +function useDialogOpen(onOpenChange?: (open: boolean) => void) { + const [open, setOpen] = useState(false); + const set = (next: boolean) => { + setOpen(next); + onOpenChange?.(next); + }; + return [open, () => set(true), () => set(false)] as const; +} + // The Advanced section's Override YAML: a summary in the form, its editor in a dialog. // The chart's values and swissd's layers for the form as it stands, without // the overrides. The deploy sheet caches them per request; load reads them @@ -39,17 +61,16 @@ export interface HelmValuesSource { load: () => Promise; } -export function OverrideYaml({ value, onChange, source }: { +export function OverrideYaml({ value, onChange, source, onOpenChange }: { value: string; onChange: (edits: string) => void; source?: HelmValuesSource; + onOpenChange?: (open: boolean) => void; }) { const t = useT(); const f = (k: string) => t(`deploy.fields.${k}`); - const [open, setOpen] = useState(false); + const [open, edit, close] = useDialogOpen(onOpenChange); const paths = overridePaths(value); - const close = () => setOpen(false); - const edit = () => setOpen(true); return ( <> void; source?: HelmValuesSource; disabled?: boolean; + onOpenChange?: (open: boolean) => void; }) { const t = useT(); - const [open, setOpen] = useState(false); + const [open, edit, close] = useDialogOpen(onOpenChange); const paths = overridePaths(value); - const close = () => setOpen(false); return ( <> -