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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nested controllers without a folder #139

Open
Peque opened this issue May 29, 2024 · 2 comments
Open

Nested controllers without a folder #139

Peque opened this issue May 29, 2024 · 2 comments

Comments

@Peque
Copy link
Contributor

Peque commented May 29, 2024

Not sure if there is a way to do this currently. Otherwise, this would be a feature request. 馃槉

Use case

Some controllers that are related together are hidden until another controller enables them.

For example, there is a "DSM" option, initially disabled, so the next controller bellow happens to be a folder:

Screenshot from 2024-05-29 21-46-56

Now, when the user clicks on the controller to enable it, some other controllers appear that are directly related to "DSM", and only exist when "DSM" is enabled:

Screenshot from 2024-05-29 21-47-06

While the direct association between "DSM" and the three "Adjust" controllers may be intuitive when clicking to enable "DSM", this may not be so intuitive without that interaction (imagine DSM was already enabled and the user just saw a list of consecutive controllers that maybe are not even related).

Proposed approach

It would be great to be able to define the "Adjust" controllers as nested like:

nested

Note that they would be nested without having a collapsible folder with a title. To make them hide, the user would need to click on DSM to disable it completely.

@georgealways
Copy link
Owner

That's a somewhat common pattern, but there's no support for this out of the box. My suggestion would be to keep the "nested" controllers in an array and do something like this:

bool.onChange( v => {
  // enable( v ) would work too
  controllers.forEach( c => c.show( v ) );
} );

You could also use a folder and hide the title with css.

@Peque
Copy link
Contributor Author

Peque commented May 30, 2024

Thanks @georgealways !

Yeah, hidding/showing them by just iterating through the controllers and calling .show() on each one is not an issue, the goal would be to display the nested vertical line separator on them:

334946362-c50311a2-6204-4dce-b49b-347844d0b67e

I'll try the CSS-title-hide workaround to see if I can make it work, thanks! 馃槉

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

No branches or pull requests

2 participants