enso-org / enso

Hybrid visual and textual functional programming.
https://enso.org
Apache License 2.0
7.33k stars 320 forks source link

Editing outside of the node appears to reshuffle all nodes and break the layout #9389

Closed hubertp closed 1 month ago

hubertp commented 5 months ago

While waiting on the execution to finish, I start editing some node. Clicking outside of the node appears to collapse all nodes and order them in a single line. Video demonstrates the problem.

Kazam_screencast_00039.webm

There are two problems here

hubertp commented 5 months ago

It appears that we end up with () being inserted for the value e.g.

    number6 =
        ()

by GUI? Language server?

hubertp commented 5 months ago

Steps to reproduce:

farmaazon commented 5 months ago

Reproduced; As currently numeric input accepts anything, we parse space and put it as "Block" node without lines, and probably then our "AST repairing system" inserts the parenthesis.

I think we should be careful in what is accepted in numeric input - the AST block should not be.

In this issue, undo is also broken sometimes.

kazcw commented 5 months ago

This should also be handled differently in Ast.syncToCode--it could reject attempts to sync a non-block into a block, because that isn't safe in general.

Frizi commented 4 months ago

We need to know what is the expected behavior here. Should the node be deleted, or should such edit be rejected?

farmaazon commented 1 month ago

Technically, it is fixed by #10457 - now there is no way to put just any code into widgets.

But the problem here may re-appear when implementing Code Input Widget - added a section there about repairing AST to not break graph.