The GitHub Actions job "Required Checks" on 
texera.git/gh-readonly-queue/main/pr-8946-27bc3b7703c7e044c03a8d76edeb708146441fce
 has succeeded.
Run started by GitHub user aglinxinyuan (triggered by aglinxinyuan).

Head commit for run:
2faa5c507461a1dfb589cac0699602b4a82479c8 / Matthew B. <[email protected]>
refactor(frontend): extract HuggingFace field bindings into a helper (#8946)

### What changes were proposed in this PR?
- Extracted the ~185-line HuggingFace-specific field block out of
`operator-property-edit-frame.component.ts` into a pure helper
`applyHuggingFaceFieldBindings(field)` in
`workspace/util/hugging-face-field-bindings.ts`, beside the existing
`custom-formly-type.ts` that owns the sibling "which widget a field
renders as" concern.
- The component now calls the helper under a single `operatorType ===
"HuggingFace"` guard; the helper reproduces both original guards (`key
=== "task"` hide, then the string-key gate), so the task lists, `hide`
expressions, required-validators, and `validation.show` flags are
byte-identical to before.
- Added `hugging-face-field-bindings.spec.ts` with direct unit tests for
the hide/validator logic per task (image/audio inputs and their columns,
prompt column, text-generation-only controls, context, candidate labels,
sentences), coverage that was impossible while the logic was inline.
### Any related issues, documentation, discussions?
Closes: #8944
### How was this PR tested?
- Run `cd frontend && npx ng test
--include='**/hugging-face-field-bindings.spec.ts'`, expect 15 tests to
pass.
- Run `cd frontend && npx ng test
--include='**/operator-property-edit-frame.component.spec.ts'`, expect
the existing suite to pass unchanged (262 pass, 1 pre-existing skip).
- In the workflow editor, add a HuggingFace operator and change its
Task: confirm the image upload / input image column appear only for
image tasks, the audio upload / input audio column only for audio tasks,
the prompt column hides for image-only and audio tasks,
systemPrompt/maxNewTokens/temperature show only for text-generation, and
the required-field validators still block running when a needed input is
empty.
### Was this PR authored or co-authored using generative AI tooling?
Co-authored with Claude Opus 4.8 in compliance with ASF

Report URL: https://github.com/apache/texera/actions/runs/38188984113

With regards,
GitHub Actions via GitBox

Reply via email to