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


##########
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:
   Agreed. 431acf784 switches the name box to the input event, so authorName, 
the hidden label and the saved name follow each keystroke and nothing is lost 
when the page is left with the box focused (the handler already avoids 
rebuilding under focus). The wrapper's DOM spec now dispatches input; on change 
alone it goes red.



##########
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:
   Right, nothing else emits for a rename. Two parts: the picker's pill labels 
are refreshed from getOperatorDisplayNameChangedStream in #8516 (c66787a73, 
with the graph-shape streams); here, 431acf784 subscribes to the same stream 
and rebuilds the cards through rebuildFormOrDefer, held while the reader is 
typing like the compilation path, so the From attribution follows a rename at 
once. Spec: a display-name change rebuilds the inputs; deleting the 
subscription turns it red.



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