triplex icon indicating copy to clipboard operation
triplex copied to clipboard

Tuple inputs should set default values for missing simple types that are required when changing any value of the tuple

Open itsdouges opened this issue 1 year ago • 6 comments

Right now you need to enter all values to have it flushed to the scene. Ideally we can do better than this.

itsdouges avatar Oct 30 '24 06:10 itsdouges

In the least it would be nice if all tuple values were 0 by default so entering partial values works as expected.

krispya avatar Nov 14 '24 23:11 krispya

It's difficult to know what a valid value is. For now the inputs will show invalid state when filling them in so you at least have a visual cue that more input is needed.

This will be released in the next version of Triplex for VS Code. It hasn't been implemented yet in Triplex Standalone.

itsdouges avatar Nov 15 '24 01:11 itsdouges

What is the difficulty? Is something too naive about setting all number values to 0?

krispya avatar Nov 15 '24 01:11 krispya

It's not difficult it's setting expectations correctly. Setting to 0 works for this pro, it won't work for others (like scale).

We could introduce special behaviour for some props but I'd be cautious of introducing conflicting UX.

itsdouges avatar Nov 15 '24 01:11 itsdouges

That's a good point. I think 0 is more correct than not and we can add exceptions for cases where it isn't. But even if it is not correct, having a user replace it with a real value is as much work as we have to do now but it saves time in all the cases where you don't have to.

krispya avatar Nov 15 '24 01:11 krispya

I'll release the current validation change and will put default values behind a feature gate to test.

itsdouges avatar Nov 15 '24 01:11 itsdouges

I'm going to pick this up today.

itsdouges avatar Aug 06 '25 00:08 itsdouges

It works!

Should have done this ages ago! https://x.com/dougesdev/status/1952887481373978744

itsdouges avatar Aug 06 '25 00:08 itsdouges