Copilot commented on code in PR #8517:
URL: https://github.com/apache/texera/pull/8517#discussion_r3994502553


##########
frontend/src/app/common/formly/editable-label-wrapper/editable-label-wrapper.component.html:
##########
@@ -0,0 +1,73 @@
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements.  See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership.  The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License.  You may obtain a copy of the License at
+
+   http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied.  See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+
+<!-- Authoring: the label is the input, so what you type is what the reader 
reads. -->
+<div
+  class="lbl-row"
+  *ngIf="props.authoring">
+  <input
+    class="lbl-input"
+    [value]="props.authorName"
+    [placeholder]="props.schemaLabel"
+    (change)="onRename($event)"

Review Comment:
   `change` fires only when the editor commits/blurs the input, so while the 
author types, `authorName` and the visually hidden control label remain at the 
old value; closing or reloading while the box is still focused can also lose 
the rename. The handler already avoids rebuilding under focus, so update on 
each input event as the help and instruction editors do.
   
   This issue also appears on line 64 of the same file.



##########
frontend/src/app/workspace/component/workflow-form/workflow-form.component.ts:
##########
@@ -539,39 +620,95 @@ export class WorkflowFormComponent implements OnInit, 
OnDestroy {
     return ["TEXTAREA", "SELECT"].includes(active.tagName) || 
active.isContentEditable;
   }
 
+  /**
+   * The steps a result can come from. The engine compiles only the enabled 
operators, so a disabled
+   * step produces nothing however it is flagged: not offered in the picker, 
not shown as a result.
+   */
+  private enabledOperators(): OperatorPredicate[] {
+    return this.workflowActionService
+      .getTexeraGraph()
+      .getAllOperators()
+      .filter(op => !(op.isDisabled ?? false));
+  }
+
+  /**
+   * The picker's candidates: every final step (the engine always materialises 
it) and every
+   * intermediate step with view-result ("the eye") on the canvas. In edit 
mode a step already on the
+   * author's saved list is kept as well, eye or no eye, so the author can 
take a stale choice off the
+   * list; a reader is not offered it, since with no result materialised its 
pill could never turn on.
+   * Reuse the one terminal rule (terminalOperatorIds) rather than a second 
copy. Disabled steps are
+   * not offered at all, listed or not: they are left out of the run, so 
choosing one could never show
+   * anyone anything. The shown flag mirrors shownResultIds, so it reflects 
the viewer's own choice when
+   * they have made one and the author's default otherwise.
+   */
+  private rebuildResultChoices(): void {
+    const config = this.formBindingService.getConfig();
+    const viewed = 
this.workflowActionService.getTexeraGraph().getOperatorsToViewResult();
+    const listed = new Set(this.authoring && this.canEdit ? 
config.shownResultIds ?? [] : []);
+    const terminals = new Set(this.terminalOperatorIds());
+    const shown = new Set(this.shownResultIds);
+    this.resultChoices = this.enabledOperators()
+      .filter(op => terminals.has(op.operatorID) || viewed.has(op.operatorID) 
|| listed.has(op.operatorID))
+      .map(op => ({
+        operatorID: op.operatorID,
+        label: this.formBindingService.operatorLabel(op),

Review Comment:
   This snapshots the operator label, but the page never subscribes to 
`getOperatorDisplayNameChangedStream()`. Renaming a step in the now-live 
property panel emits only that stream (not the compilation or form-binding 
streams), so both its result pill and the new “From …” attribution remain stale 
until some unrelated rebuild. Subscribe to the display-name stream and 
refresh/defer the derived form state.
   
   This issue also appears in the following locations of the same file:
   - line 884
   - line 922



-- 
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