mengw15 commented on code in PR #8516:
URL: https://github.com/apache/texera/pull/8516#discussion_r3993955421


##########
frontend/src/app/workspace/service/form-binding/form-binding.service.ts:
##########
@@ -179,17 +179,29 @@ export class FormBindingService {
   }
 
   /**
-   * Choose whether an operator's output is shown on the form after a run. 
This records the
-   * form's own selection only and never changes the canvas's view-result 
flags: the form
-   * offers exactly the operators the workflow already views, so their results 
are already
-   * materialised and nothing here needs to touch the graph. Read-only, one 
direction.
+   * Choose whether an intermediate operator's output is featured on the form 
after a run, on top of
+   * the final steps' results, which show by default. This records the form's 
own selection only and
+   * never changes the canvas's view-result flags: the picker offers 
view-result operators, whose
+   * results are already materialised, so nothing here needs to touch the 
graph. Read-only, one
+   * direction.
    */
   public toggleResultOperator(operatorID: string): void {
     const shown = this.getConfig().resultOperatorIds;
     const next = shown.includes(operatorID) ? shown.filter(id => id !== 
operatorID) : [...shown, operatorID];
     this.updateConfig({ resultOperatorIds: next });
   }
 
+  /**
+   * Turn a final step's result off, or back on. A final step shows by default 
(the engine always
+   * materialises it), so only the "off" is recorded: a step that becomes 
final later shows without
+   * being listed anywhere.
+   */
+  public toggleHiddenResult(operatorID: string): void {

Review Comment:
   The two lists are meant to govern disjoint sets (featured intermediates / 
muted finals), but nothing enforces that, and there is a reachable state where 
they fight: feature an intermediate step, then delete its downstream on the 
canvas so it becomes terminal — its id is still in `resultOperatorIds`, so 
`authorsDefault = (terminals − hidden) + chosen` puts it right back after this 
records the off, and its pill can never be turned off. Cheapest fix is 
cross-list hygiene at the sink — this method also drops the id from 
`resultOperatorIds` (or `authorsDefault` subtracts `hidden` from `chosen` too).
   
   Stepping back, the fight is possible only because two lists govern one 
display set from opposite directions. A single optional exhaustive list 
(`shownResultIds?`: undefined = the terminal default, a value = exactly what 
shows, `[]` = explicitly nothing — which today's shape cannot express) would 
make this class of conflict unrepresentable, at the cost of new terminals no 
longer auto-showing once an author has curated — arguably the more predictable 
behaviour for a curated page. Raising it now while #8517 still has the config 
shape in flight; the minimal cross-list fix above works if you'd rather keep 
the shape.



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