yangzhang75 opened a new issue, #8760:
URL: https://github.com/apache/texera/issues/8760

   ### What happened?
   
   Two paths reach the canvas's code editor from the Form View, and neither can 
show it.
   
   - The step panel renders the operator's real property frame, and in edit 
mode (`panelLive`) that frame is interactive, so a Python UDF step shows the 
ordinary code-editor button. Pressing it calls 
`codeEditorService.vc.createComponent(...)` 
(`codearea-custom-template.component.ts:87`), and the only thing that ever sets 
`vc` is the canvas (`workspace.component.ts:188`, its `<ng-template 
#codeEditor>`). Before #8581 the Form View was a fresh page load, so `vc` was 
`undefined` and the click threw; since #8581 the canvas-to-form switch routes, 
so `vc` is the destroyed canvas's `ViewContainerRef` (its `ngOnDestroy` clears 
the container but keeps the reference) and Monaco is created into a detached 
view -- nothing visible.
   - An exposed code-editor property is not offered for exposure at all 
(`NON_FORM_FIELD_TYPES`, `custom-formly-type.ts:26`), and a workflow that 
carries one from before falls back to a plain editable control 
(`CANVAS_ONLY_FORMLY_TYPES`, `custom-formly-type.ts:35`).
   
   Expected, in two steps. Interim: the button is not shown, or is disabled 
with a reason, in the Form View until the form has an editor host, so a click 
neither throws nor does nothing silently. Proper: the form gets its own editor 
host -- owned above both views, or handed over with the session the way #8581 
hands the rest over, rather than by the canvas alone -- and supplies the 
operator id from the binding; the shared codearea component changes 
accordingly. Then the code editor can be offered for exposure and rendered in 
the form instead of a fallback.
   
   Part of #8439 (item 1) and the Form View feature #8011. Raised by @mengw15 
on #8436; the step-panel path was found while auditing #8581.
   
   ### How to reproduce?
   
   1. Open a workflow with a Python UDF operator on the canvas, then switch to 
the Form View with the Form View button (#8581 routes).
   2. Enter edit mode and open the UDF step's panel.
   3. Click the code editor button: nothing appears. (Opening the Form View 
from a direct URL instead: an exception in the console on the click.)
   
   ### Version/Branch
   
   1.4.0-incubating-SNAPSHOT (main)
   
   ### Commit Hash (Optional)
   
   506397a5c
   
   ### What browsers are you seeing the problem on?
   
   Chrome
   
   ### Relevant log output
   
   _No response_


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