Skip to content

[WIP] make nodes collapsable#6

Open
m0veax wants to merge 8 commits into
platform-system-interface:mainfrom
m0veax:feature/collapsable
Open

[WIP] make nodes collapsable#6
m0veax wants to merge 8 commits into
platform-system-interface:mainfrom
m0veax:feature/collapsable

Conversation

@m0veax

@m0veax m0veax commented Jan 25, 2024

Copy link
Copy Markdown
Contributor

Idea:

A node has a link or button to hide child nodes. The button changes from "[-]" to "[+]" to inform the user

@m0veax

m0veax commented Jan 25, 2024

Copy link
Copy Markdown
Contributor Author

Using this Feature

https://reactflow.dev/examples/nodes/hidden

@orangecms orangecms left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion:

We have the tree in the state and derive the layout from it.
When collapsing a node, it would be nice to redistribute the nodes accordingly.
So let's hoist the collapsed state from being local here to bring global, and treat a collapsed node just like a leaf. The current transform helpers may need some splitting in order to accomodatr for that. WDYT?

@m0veax

m0veax commented Jan 29, 2024

Copy link
Copy Markdown
Contributor Author

So, I thought about the whole case and my next steps would be:

  • Add redux
  • move the tree into the state management
  • make collapse / decollapse state events
  • rerender the tree if changes occur

What do you think about hiding the nodes starting on the 3rd level by default?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants