studio icon indicating copy to clipboard operation
studio copied to clipboard

Propagate settings field error status through tree

Open rgov opened this issue 2 years ago • 8 comments

Foxglove Studio 1.13.2

If one of my settings fields has an error, but the tree is collapsed, I won't know about it.

It would be nice if the parents showed the error icon and clicking on it revealed the erroring field.

rgov avatar Jun 09 '22 18:06 rgov

@foxymiles @2metres sending your way for UX ideas and implementation.

defunctzombie avatar Jun 12 '22 21:06 defunctzombie

I'm inclined to say that it should be up to the panel author to tag the parent node as an error since otherwise we're going to have to do a performance killing tree traversal on every render on the settings UI side.

We could expand the API to allow the panel author to indicate the path of the node with the error though so that clicking it shows the right thing for the user.

foxymiles avatar Jun 13 '22 11:06 foxymiles

I believe our latest thinking is that this would pose a performance problem. Is that right @foxymiles?

jtbandes avatar Sep 08 '22 17:09 jtbandes

Right. I can't think of a general solution to this problem that doesn't require recursing through all descendants on each render. There might be a pure CSS solution using has().

foxymiles avatar Sep 08 '22 17:09 foxymiles

Did we have other ideas for how to address the UX issue of not being able to find errors?

jtbandes avatar Sep 08 '22 17:09 jtbandes

At the moment there's nothing stopping panel authors from handling this themselves explicitly. If we want to solve it in a general way I'd be tempted to try some CSS based has() solutions.

foxymiles avatar Sep 08 '22 17:09 foxymiles

performance killing tree traversal on every render on the settings UI side

Only on every update to the settings state not every render?

defunctzombie avatar Sep 19 '22 04:09 defunctzombie

Only on every update to the settings state not every render?

You mean every render of the parent panel? There are many cases where settings gets updated very rapidly like panning the camera in 3d panel or scrubbing a number value or the color picker or even typing quickly in a settings field.

I still think trying something with the has: selector is worthwhile.

foxymiles avatar Sep 19 '22 10:09 foxymiles