PepeElToro41 / ui-labs

UI Labs is a storybook plugin for Roblox
https://pepeeltoro41.github.io/ui-labs/
68 stars 9 forks source link

Add toolbar button for automatically clearing the output #46

Closed Nidoxs closed 2 months ago

Nidoxs commented 2 months ago

I think it would be really useful to have a toggleable option to clear the Studio output when a story is reloaded. I usually have the output open somewhere on my screen to monitor issues that may arise in my story code while iterating on them.

It can be a pain to have to constantly clear the output to ensure I'm seeing the latest errors as well as checking to see I'm not half way scrolled up the output window (subsequently missing the latest errors).

This issue proposes the addition of a new button in the appearing toolbar on the left: Y6Ada5T

The icon could be a broom / brush or a bin etc.

There could be a keybind for this!

When toggled, it'll clear the Studio output whenever any story you're viewing is updated using the ClearOutput method of the LogService. Otherwise, when not active the output's contents will be retained.

Nidoxs commented 2 months ago

I was adding this same feature for Hoarcekat some time ago (not merged in at the moment): image

PepeElToro41 commented 2 months ago

I mean, it could be useful sometimes, but Im not sure if adding a button for it is really worth it.

For context, new version is getting a new toolbar with quite more buttons, and it's already getting a little messy. Adding this button would make it worse

image

PepeElToro41 commented 2 months ago

New version is getting a dropdown, so I can suggest moving it there instead.

also, how would this be handled when you have multiple stories?. Maybe this function can be disabled when you have multiple stories mounted, or just let it clear it anyway

image

Nidoxs commented 2 months ago

New version is getting a dropdown, so I can suggest moving it there instead.

also, how would this be handled when you have multiple stories?. Maybe this function can be disabled when you have multiple stories mounted, or just let it clear it anyway

image

This is awesome! Yeah I agree that the toolbar there is getting filled, so this dropdown would be great to house more specific things that don't necessarily need to go in the toolbar.

When it comes to the behaviour when using multi-mount, I think it should only clear the output when the story you've got selected currently changes. It could also clear the output when any of the currently visible stories is changed, but it could be confusing if you forget you've got that enabled.

Perhaps there could be two settings, one to enable the behaviour and another to specify what happens in multi-mount mode (clear output for selected story vs any of the open stories).

PepeElToro41 commented 2 months ago

Added the option in the dropdown https://github.com/PepeElToro41/ui-labs/commit/a009a4b090129fcb10309261c14cf8660592cdda