Skip to content

Commit 5cf17f1

Browse files
committed
deslop dispatcher: extract enumOpts, trim nestClass comment
- MultiSelectField branch: extract `itemSchema?.enum` to a local so Array.isArray narrows it; drops a redundant `as unknown[]` cast - nestClass: trim 3-line comment to 2 lines focused on the WHY of the spacing values
1 parent 1987d18 commit 5cf17f1

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

web/tools/file-explorer/cms-form.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -120,9 +120,8 @@ export type FormValue =
120120
// ─── helpers ──────────────────────────────────────────────────────────────────
121121

122122
function nestClass(_depth: number): string {
123-
// Nested fields always get an indent + left rule so hierarchy is obvious.
124-
// ml-3 lands the rule roughly under the parent's chevron; pl-4 then
125-
// puts child content under the parent label text. 3+ levels still fit.
123+
// ml-3 lands the rule under the parent's chevron; pl-4 aligns child
124+
// content under the parent label text.
126125
return "ml-3 border-l border-border/60 pl-4";
127126
}
128127

@@ -2680,13 +2679,14 @@ function FormField({
26802679
/>
26812680
);
26822681
}
2683-
if (schemaFormat === "multi-select" && Array.isArray(itemSchema?.enum)) {
2682+
const enumOpts = itemSchema?.enum;
2683+
if (schemaFormat === "multi-select" && Array.isArray(enumOpts)) {
26842684
return (
26852685
<MultiSelectField
26862686
label={label || name}
26872687
description={description}
26882688
value={(effectiveValue as FormValue[]).map(String)}
2689-
options={(itemSchema?.enum as unknown[]).map(String)}
2689+
options={enumOpts.map(String)}
26902690
onChange={(v) => (onChange as (v: FormValue[]) => void)(v)}
26912691
/>
26922692
);

0 commit comments

Comments
 (0)