Ma77Ball opened a new pull request, #8946: URL: https://github.com/apache/texera/pull/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 🤖 Generated with [Claude Code](https://claude.com/claude-code) -- 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]
