Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Collapsing/expanding nodes #2544

Merged
merged 19 commits into from Feb 8, 2024
Merged

Collapsing/expanding nodes #2544

merged 19 commits into from Feb 8, 2024

Conversation

joeyballentine
Copy link
Member

@joeyballentine joeyballentine commented Feb 3, 2024

image

Closes #2529

@RunDevelopment
Copy link
Member

I think we should largely copy blender for this feature. They do it like this:

image
image

The main aspects I would copy from this are:

  1. The collapse/expand icons. I think their icons are a lot clearer.
  2. Their input/output handles are usable even when collapsed. This would make some of our nodes fully functional even when minimized.

What do you think?

@joeyballentine
Copy link
Member Author

How does 2. look when there's a shit ton of handles?

@RunDevelopment
Copy link
Member

It increases the size of the header. Quite clever.

image

@joeyballentine
Copy link
Member Author

To be completely honest, that sounds like wayyyyy too much work to do, especially now that i've already done it this way. And not to mention our nodes are a different shape than blender's, and they have more information on them. Unless you think we should get rid of the validation marker and the disable toggle when a node is collapsed and just have the header?

@RunDevelopment
Copy link
Member

To be completely honest, that sounds like wayyyyy too much work to do

It might not be. Since you brought up removing the footer, I tried doing that. (Didn't sound like such a bad idea.) Honestly, it looks pretty good with centered handles:

image

As for how this works with a lot of handles: it doesn't.

image

It can deal with up to 6 handles without overflowing, which should cover most nodes. And if it does overflow, it just looks a little bad, but it doesn't break anything.

The only thing I would still change is to show the status icon where there is currently empty space (where you have a placeholder icon button). But I would only show it when there is an error. No need to clutter the clean UI when we have nothing to report.

What do you think?


That aside, I found another minor issue: when I minimize a node with a multiline text box (e.g. text to image), the collapse toggle moves (since it is right aligned). Instead of making nodes keep the increased width, I would suggest moving the toggle to the left of the title. You can see what that looks like in the screenshots above.

@RunDevelopment
Copy link
Member

RunDevelopment commented Feb 6, 2024

I made a PR for my last comment: #2551

@RunDevelopment
Copy link
Member

@joeyballentine please don't merge after #2551. There are still 2 bugs:

  1. The color of minimized input handles isn't always the same as that of the real ones.
  2. Node documentation has the collapse toggle, but it does nothing.

@joeyballentine
Copy link
Member Author

Fixed the two bugs, should be good to go now

src/renderer/components/Handle.tsx Outdated Show resolved Hide resolved
src/renderer/components/node/CollapsedHandles.tsx Outdated Show resolved Hide resolved
src/renderer/components/node/Node.tsx Outdated Show resolved Hide resolved
src/renderer/components/node/Node.tsx Outdated Show resolved Hide resolved
src/renderer/components/NodeDocumentation/NodeExample.tsx Outdated Show resolved Hide resolved
@joeyballentine joeyballentine merged commit 76915b5 into main Feb 8, 2024
4 checks passed
@joeyballentine joeyballentine deleted the expand-collapse branch February 8, 2024 13:57
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.

Allow for collapsing of nodes on the schematic.
2 participants