Closed Nancy-Salpepi closed 1 year ago
In published, when I follow the above steps, the vertexCutButton disappears.
Good catch @Nancy-Salpepi! Perhaps this is an unintended consequence of https://github.com/phetsims/circuit-construction-kit-common/issues/975.
@samreid I think the behavior in published is preferable (dismissing the selection of the vertex). Here, the vertex being selected seems unintentional -- a user likely clicked the vertex before dragging it. However, if dismissing the selection is not compatible with the changes made in https://github.com/phetsims/circuit-construction-kit-common/issues/975, we should enable the cut button.
@arouinfar @samreid and I would like to try solving this by attaching the cut button visibility to the connected state of the vertex, as well as its selected state.
@arouinfar ready for your review
@matthew-blackman @samreid everything seemed fine the first few times connected a selected vertex to another vertex. However I ran into an assertion that froze the sim when making this connection:
Maybe the difference is that this vertex had three connected components?
Also this bug appears on CT.
@samreid it looks like https://github.com/phetsims/circuit-construction-kit-common/commit/477fa0f2b76cd2b171eddafb414c2f590b8f7019 has fixed the issue. I implemented the same pattern used in the updateStroke callback on VertexNode and confirmed that the circuit @arouinfar showed above no longer throws an error.
The fix looks appropriate, CT is clear and I ran a memory test and didn't see trouble. @arouinfar can you please re-test? If it seems OK please mark as ready for cherry-pick.
Looks great, thanks @samreid @matthew-blackman.
For the QA team, please test by selecting a vertex, then connecting it to another vertex and see if the cut button becomes enabled. Please try connecting a vertex to a lone vertex, and, in a subsequent test, to an already connected vertex.
Looks good in rc.3! Closing.
Test device MacBook Air M1 chip
Operating System 13.2.1
Browser Chrome
Problem description For https://github.com/phetsims/qa/issues/908, If I click on the end of a circuit element so that the vertexCutButton appears and then attach it, the vertexCutButton still appears disabled. I need to click away and then click back on it for it to be enabled.
Steps to reproduce
Visuals
https://user-images.githubusercontent.com/87318828/221943327-988f3918-546b-422d-a7d8-ad6380c40ddb.mp4