winglang / wing

A programming language for the cloud ☁️ A unified programming model, combining infrastructure and runtime code into one language ⚡
https://winglang.io
Other
4.75k stars 186 forks source link

Improve node collapsing transitions #6640

Open polamoros opened 3 weeks ago

polamoros commented 3 weeks ago

Use Case

Map is recentered and the zoom is restarted when expanding/collapsing a node.

https://github.com/winglang/wing/assets/5547636/1e5c1b5b-a7e1-4ad3-ac60-15d360745104

https://github.com/winglang/wing/assets/5547636/471a3720-9061-471f-b879-a7daed6c3be3

Proposed Solution

Improve the collapsing/expanding transition by keeping the same zoom level and the node position.

Reuse previous node positions in elk.layout() https://github.com/winglang/wing/blob/main/apps/wing-console/console/ui/src/ui/elk-flow/graph-generator.tsx#L216

Implementation Notes

No response

Component

Wing Console

Community Notes

polamoros commented 2 weeks ago

feat-reuse-previous-node-positions