ui-playground icon indicating copy to clipboard operation
ui-playground copied to clipboard

[🚀settings]: ability to hide settings tab when no active settings inside

Open ala-n opened this issue 10 months ago • 3 comments

When multiple snippets used inside one UIP instance, there is a valid possibility of hiding all the settings. It is requested to allow users to get rid of empty settings container visually.

Suggesting to set up a marker on the inactive settings container to hide it.

ala-n avatar Apr 16 '24 12:04 ala-n

@yadamskaya, @ala-n While working on implementation I ran into the following problem. There's already existing marker inactive, which indicates if all current setting items are inactive or not. Instead of implementing something on top, we can already use it to know when to hide the panel. But, it's being set with delay, since the listener is debounced by 100ms, which doesn't look good on changes. https://github.com/exadel-inc/ui-playground/blob/main/src/plugins/settings/settings.tsx#L109 What should we do about this? Is this debounce necessary? Maybe we can bypass the issue with animations?

fshovchko avatar Apr 18 '24 23:04 fshovchko

Oh, To be honest, I don't remember why we added a long delay for the marker attribute ) (Mb @yadamskaya remembers something regarding that point) Probably we can reduce it for formal 10s, replace with microtask or even get rid of it at all.

ala-n avatar Apr 19 '24 14:04 ala-n

@fshovchko @ala-n Yes, its true, marker inactive existis and indicates if all current setting items are inactive or not. We can use it for our purpose to know when to hide the settings panel.

I guess we can get rid of existing debounce, as I remember it was added before inavtive marker was implemented and I don't think there's any reason to use it. I don't remember why we needed it either :)

yadamskaya avatar Apr 22 '24 15:04 yadamskaya

:tada: This issue has been resolved in version 2.1.0-beta.5 :tada:

The release is available on:

Your semantic-release bot :package::rocket:

yadamskaya avatar May 13 '24 14:05 yadamskaya