Skip to content

Extend per-occurrence affordances to list and internal modes #4476

@edloidas

Description

@edloidas

Extend per-occurrence affordances (processing, readOnly, inputRef, onFocus) to list and internal modes. Single mode is already wired in InputField; list mode passes through OccurrenceList.Root which currently drops the new props, and internal mode's SelfManagedComponentProps has no per-occurrence affordance surface at all.

Rationale

Without this, AI integrations can only lock/reveal/focus fields backed by a single-occurrence component. Multi-occurrence text fields (list mode) and self-managed types (TagInput, ComboBoxInput, PrincipalSelectorInput) silently no-op when targeted by occurrence ID.

Implementation Notes

List mode (mechanical):

  • Extend OccurrenceListRootProps with onFocus, plus per-index processing flag and inputRef callback (likely keyed by occurrence ID, mirroring how InputField already builds them).
  • Forward processing / readOnly / inputRef / onFocus into both single-path (isSingle) and multi-path (isFixed/isDraggable/default) renders.
  • InputField's list-mode branch builds the per-occurrence callbacks (same pattern as the existing single-mode branch) and passes them through.

Internal mode (needs semantic design):

  • SelfManagedComponentProps owns its multi-value UI, so per-occurrence affordances need a new shape — likely processingIds: Set<string>, inputRef: (occurrenceId) => callback, and occurrenceIds: string[].
  • Open question per component: does locking one occurrence inside TagInput's chip strip make sense, or should internal-mode collapse to whole-component lock (processing: boolean)? Decide before plumbing.
  • Three callers to update: TagInput, ComboBoxInput, PrincipalSelectorInput.

Suggested split: ship list-mode first as a self-contained change, then internal-mode as a follow-up once the per-component semantics are settled.

Part of #4470.

Drafted with AI assistance

Metadata

Metadata

Assignees

Labels

Enonic UINew UI/UX tasksImprovementSuggestion for improvement

Type

No fields configured for Task.

Projects

Status

Current Sprint

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions