Skip to content

Add task-aware field visibility and preview to HuggingFace property editor #5316

Closed

Description

@ELin2025

Task Summary

Feature Summary

The HuggingFace inference operator (#5041) is being landed as a sequence of focused PRs. The previous PR (#5314) registered custom formly field type components for the task selector, model browser, and audio upload — but they are not yet wired into the property editor. This issue activates those components and adds task-aware field visibility.

Concretely, landing this would enable:

  • Remapping modelId to the huggingface formly type, rendering the task dropdown and model browser in the property editor
  • Remapping imageInput to huggingface-image-upload and audioInput to huggingface-audio-upload
  • Hiding the raw task schema field (selection is handled by the HuggingFace component)
  • Showing/hiding promptColumn, imageInput, audioInput, systemPrompt, maxNewTokens, temperature, contextColumn, candidateLabels, sentencesColumn based on the selected task
  • Custom validators for conditionally-required fields (e.g., image upload required for image tasks unless an input column is selected)
  • A task preview card showing media type, input/output flow, and description per task

Proposed Solution or Design

Modify:

File Change
operator-property-edit-frame.component.ts Remap modelId, imageInput, audioInput to custom formly types; hide task field; add formly expression functions for field visibility based on task; add task preview metadata map and getter; add custom validators for conditionally-required fields
operator-property-edit-frame.component.html Add task preview card with ngSwitch for video/image/audio/text media types
operator-property-edit-frame.component.scss Styles for the task preview card layout
operator-property-edit-frame.component.spec.ts Tests for task preview resolution (text, image, audio, video, unknown, empty task)
mock-operator-metadata.data.ts Add mockHuggingFaceSchema with all HF fields for test harness
mock-workflow-data.ts Add mockHuggingFacePredicate operator predicate for tests

Design constraints:

  • Field visibility uses formly expressions.hide functions that read the current task from the form control or model — not static configuration.
  • Custom validators (e.g., requiredImageInput, requiredPromptColumn) must return true (valid) when the field is not applicable to the current task.
  • The task field is hidden with hide: true since the HuggingFace component manages task selection — the raw text input must not be visible.
  • Task preview metadata is a static map keyed by task string — unknown tasks get a generic fallback card.

References:

Impact / Priority

(P2) Medium — this is the PR that makes the HuggingFace operator's custom UI visible in the property editor. Does not affect existing operators.

Affected Area

Frontend (Angular) — workspace property editor component.

Task Type

  • Refactor / Cleanup
  • DevOps / Deployment / CI
  • Testing / QA
  • Documentation
  • Performance
  • Other

Activity

  1. added theissue type on Jun 2, 2026
  2. ELin2025 commented on Jun 2, 2026

    @ELin2025
    ContributorAuthor

    /take

  3. ELin2025 commented on Jun 2, 2026

    @ELin2025
    ContributorAuthor

    /parent-issue #5041

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions