ELin2025 opened a new pull request, #5568:
URL: https://github.com/apache/texera/pull/5568

   ### What changes were proposed in this PR?
   
   Wire up the HuggingFace operator's property editor so that selecting a task 
dynamically controls which fields are visible and shows a media preview card. 
This is the PR that makes the formly components from PRs 6a/6b user-visible by 
mapping operator fields to custom field types in `jsonSchemaMapIntercept`.
   
   Changes to `operator-property-edit-frame.component.ts`:
   - Map `modelId` → `huggingface` formly type, `imageInput` → 
`huggingface-image-upload`, `audioInput` → `huggingface-audio-upload`
   - Hide the `task` field (it is controlled by the HuggingFaceComponent's task 
dropdown instead)
   - ~13 field visibility rules via formly expressions that show/hide fields 
based on the selected task (e.g., `imageInput` only for image tasks, 
`contextColumn` only for question-answering, 
`systemPrompt`/`maxNewTokens`/`temperature` only for text-generation)
   - 3 custom validators: `requiredImageInput`, `requiredAudioInput`, 
`requiredPromptColumn` — each checks whether the direct input or the 
corresponding column selector is filled
   - Task preview cards with sample media for 22 task types across 4 kinds 
(image, video, audio, text), plus a fallback for unknown tasks
   
   Changes to test infrastructure:
   - `mockHuggingFaceSchema` in `mock-operator-metadata.data.ts` (added to 
`mockOperatorSchemaList`)
   - `mockHuggingFacePredicate` in `mock-workflow-data.ts`
   - 7 new spec tests covering task preview for known tasks (text, image, 
audio, video), unknown tasks (fallback), empty task, and non-HF operators
   
   ### Any related issues, documentation, discussions?
   
   - Tracking issue: #5316
   - Closes: #5316
   - Stacked on: #5567
   - Parent issue: #5041
   - 
   ### How was this PR tested?
   
   7 new spec tests added in `operator-property-edit-frame.component.spec.ts`:
   1. Non-HF operators return null task preview
   2. HF operator with `text-generation` returns text-kind preview with correct 
title
   3. Unknown task returns fallback text preview with formatted title
   4. `image-classification` returns image-kind preview
   5. `text-to-speech` returns audio-kind preview
   6. `text-to-video` returns video-kind preview
   7. Empty task returns null preview
   
   Run with `ng test`.
   
   ### Was this PR authored or co-authored using generative AI tooling?
   
   Co-authored with Claude Opus 4.7


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to