Summary
Choice fields (dropdown, radio, openchoice, multiselectdropdown) can only carry static options baked into the FormDefinition. Forms that need to offer people or other live registries — with search-as-you-type — currently have to fall back to free text.
Proposal: a declarative optionsSource on option-bearing fields, resolved at render time by a host-registered provider. eSheet ships no fetching/auth logic; the host app does.
The problem, concretely
The Chevron eCase case form (built on @esheet/* 0.0.5) needs:
The user list lives in the host application (and changes daily), so it cannot be serialized into the form definition. Today both fields ship as plain text — free-typed names, typos and all — which is exactly what the tracker items reject.
A registered custom field type (#85) is the current escape hatch, but it means rebuilding the dropdown UX, keyboard handling, validation and response shape per app instead of reusing eSheet's.
Proposed shape
- id: caseApprover
fieldType: dropdown
question: Case approver
required: true
optionsSource:
provider: users # host-registered name
params: { role: approver }
Host side (renderer or form store):
registerOptionsProvider('users', async (query, params) => FieldOption[]);
- Provider is called on open/typeahead with the current
query; results render as normal options.
- The response stays self-contained: the chosen option is stored as the usual
selected: { id, value }, so hydration/projection of old responses never needs the provider again.
- Static
options and optionsSource can coexist (static entries pinned, e.g. "Unassigned").
- A definition with an unregistered provider degrades gracefully (empty list + console warning), keeping definitions portable.
Non-goals
- eSheet performing HTTP itself, auth, caching policy — all host concerns inside the provider.
- Builder UI for browsing providers (v1 can be a plain provider-name input).
Related
Acceptance criteria
Summary
Choice fields (
dropdown,radio,openchoice,multiselectdropdown) can only carry staticoptionsbaked into the FormDefinition. Forms that need to offer people or other live registries — with search-as-you-type — currently have to fall back to free text.Proposal: a declarative
optionsSourceon option-bearing fields, resolved at render time by a host-registered provider. eSheet ships no fetching/auth logic; the host app does.The problem, concretely
The Chevron eCase case form (built on
@esheet/* 0.0.5) needs:The user list lives in the host application (and changes daily), so it cannot be serialized into the form definition. Today both fields ship as plain
text— free-typed names, typos and all — which is exactly what the tracker items reject.A registered custom field type (#85) is the current escape hatch, but it means rebuilding the dropdown UX, keyboard handling, validation and response shape per app instead of reusing eSheet's.
Proposed shape
Host side (renderer or form store):
query; results render as normal options.selected: { id, value }, so hydration/projection of old responses never needs the provider again.optionsandoptionsSourcecan coexist (static entries pinned, e.g. "Unassigned").Non-goals
Related
Acceptance criteria
optionsSource: { provider, params? }on option-bearing fields and still validate againstformDefinitionSchema.selectedresponses and survive rendering without the provider.