Copilot commented on code in PR #8839:
URL: https://github.com/apache/texera/pull/8839#discussion_r4208269259
##########
frontend/src/app/workspace/component/hugging-face/hugging-face.component.ts:
##########
@@ -200,6 +203,25 @@ export class HuggingFaceComponent extends
FieldType<FieldTypeConfig> implements
);
}
+ /**
+ * The task can change under this widget: a co-editor's edit, or the Form
View's, lands on the
+ * operator and from there on this field's model (the panel hands formly a
fresh model object; the
+ * form card is rebuilt). The selector shows this widget's own state, and on
the panel the schema's
+ * `task` field is hidden, so there is no control to listen to: the model is
checked on every
+ * change detection instead, and the selector follows it as a local pick is
followed -- show the
+ * task, load its models -- rather than keeping what it showed when it was
built.
+ */
+ ngDoCheck(): void {
+ const tag = this.model?.task;
+ if (!this.initialized || typeof tag !== "string" || !tag || tag ===
this.selectedTaskTag) {
+ return;
+ }
+ this.selectedTaskTag = tag;
+ this.searchText = "";
+ this.filteredModels = null;
+ this.loadAllModels();
Review Comment:
When an external task change arrives while a server-side search is in
flight, this clears the search text/results but leaves `searchLoading` true.
The new stale-result guard returns before clearing that flag, so `isSearching`
can remain true indefinitely and an empty current task is rendered as `No
models found for ""` even though no search is active. Reset `searchLoading`
together with the other search state here.
--
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]