parametrics: add display: 'segmented' enum hint + drop fence color

User pointed out two regressions in the auto-derived fence inspector:

- A `color` field rendered for fence — but the legacy `FencePanel`
  hid it (fence's color is a leftover schema field that isn't part of
  the inspector UX). Dropped from `fenceParametrics`.

- Style + base-style enums rendered as a dropdown, but the legacy
  used the inline segmented switcher (Slat/Rail/Privacy +
  Grounded/Floating). Added a `display?: 'select' | 'segmented'` hint
  to the enum field kind. ParametricInspector renders SegmentedControl
  when set; defaults to dropdown otherwise.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Wassim SAMAD
2026-05-18 10:21:56 -04:00
co-authored by Claude Opus 4.7
parent e7cb976b9b
commit 80199dc890
3 changed files with 31 additions and 4 deletions
+9 -1
View File
@@ -372,7 +372,15 @@ export type ParamField<N> =
customEditor?: ComponentType
}
| { key: keyof N; kind: 'boolean'; visibleIf?: (n: N) => boolean }
| { key: keyof N; kind: 'enum'; options: readonly string[]; visibleIf?: (n: N) => boolean }
| {
key: keyof N
kind: 'enum'
options: readonly string[]
/** Defaults to 'select' (dropdown). 'segmented' renders the inline
* tabbed switcher — better for short option lists (2-4 items). */
display?: 'select' | 'segmented'
visibleIf?: (n: N) => boolean
}
| { key: keyof N; kind: 'vec3'; visibleIf?: (n: N) => boolean }
| { key: keyof N; kind: 'color'; visibleIf?: (n: N) => boolean }
| { key: keyof N; kind: 'material'; visibleIf?: (n: N) => boolean }