Open anotherglitchinthematrix opened 2 years ago
@anotherglitchinthematrix Sorry for the late response. I have avoided the issues during the spring as it would eat all of the available time for the project. Anyway, this is actually the intended behaviour. The alternative, to have the subgraph "stick" to the subgraph it last appeared in was the initial implementation and more inline with how other parts work like node title and type for instance. This resulted in many bug reports where users were surprised at where nodes ended up. Even though I like your suggestion it is not possible to modify this anymore as this would change many rendered diagrams out there.
@knsv No problem about the late response. Since the issue can be easily avoided by having a well organized flow. Do you think mentioning this behaviour in the documentation would be better?
Describe the bug Probably a neglectable inconvenience rather than a bug.
The nodes defined in another subgraph teleports to first referenced subgraph if they're referenced before their definition in the second subgraph, probably because now they're defined in the referenced subgraph before the second subgraph. But if the referencing comes before or after all of the definitions it's working as expected. See the "working example" to understand what I mean.
To Reproduce Steps to reproduce the behavior:
Expected behavior I'm not sure if this is the expected outcome, but I wasn't expecting the node to be teleported and it got me confused. It has a very easy workaround on well organized structure, if the definitions made before references, everything should be working as expected.
Screenshots
Code Sample Preview on mermaid live editor