Closed Nancy-Salpepi closed 1 year ago
It will also stay highlighted if you select any of the radio buttons or meters.
Nice find @Nancy-Salpepi.
@samreid it seems like vertex.isSelectedProperty
is not being properly toggled. It looks rough, but I don't think it seriously impacts the usability of the sim. The selected highlight around the vertex will be dismissed if clicking in a blank area of the play area or if selecting a different element/vertex.
I'll tag this for the preview milestone to document as a known bug, but I think we can defer fixing it until production.
I've documented this as a known issue, so switching the milestone.
Should I rewrite the sim to have a single Property indicating what is selected, and it can be a Circuit Element OR Vertex? Perhaps selectionProperty
? Then we would uninstrument the vertex.isSelectedProperty
values and just use them as internal plumbing to get the same behavior? Would we ever want the user to be able to select more than one thing? (Like a drag selection)?
Should I rewrite the sim to have a single Property indicating what is selected, and it can be a Circuit Element OR Vertex?
I really like this idea. That way, the client only has to look at one property to know exactly what the user has selected.
Would we ever want the user to be able to select more than one thing? (Like a drag selection)?
No, I don't think so. If multiple elements are simultaneously selected, we would need to display multiple edit panels/trash buttons which would be really messy and confusing.
I implemented the proposal so there is one selectionProperty which can be CircuitElement | Vertex | null. It is easy to change the selection from studio using "get" --> "set". This also fixes the vertex highlighting bug. Ready for review.
Thanks @samreid. I really like selectionProperty
, and it seems powerful that users can pass in the phetioID
of the element they want to highlight. However, it doesn't seem like Studio does any error checking to make sure the phetioID
exists when using Set Value. Should it?
@matthew-blackman and I tested this in a built version. We tried selecting a battery that doesn't exist. It showed this alert dialog and did not crash the sim:
We cannot use a standard validator in this place for the rich studio error reporting since trying to deserialize the non-existent circuit element happens before validation. So I'm not sure what we can do without adding another complex validation layer or channel.
@arouinfar what do you recommend?
@matthew-blackman and I tested this in a built version. We tried selecting a battery that doesn't exist. It showed this alert dialog and did not crash the sim:
That seems good enough to me, closing.
Test device MacBook Air (m1 chip)
Operating System 12.0.1
Browser Chrome
Problem description For https://github.com/phetsims/qa/issues/772
If a connection between 2 elements is selected and then another element is removed from the carousel, the yellow highlight doesn't disappear--only the cut symbol does. The connection will stay highlighted until you select another element. In the published versions of CCK-DC and CCK-AC the yellow highlight disappears once an item is selected from the carousel.
Steps to reproduce
Visuals