phetsims / circuit-construction-kit-common

"Circuit Construction Kit: Basics" is an educational simulation in HTML5, by PhET Interactive Simulations.
GNU General Public License v3.0
10 stars 10 forks source link

Highlight behavior is different than in published #975

Closed Nancy-Salpepi closed 1 year ago

Nancy-Salpepi commented 1 year ago

Test device MacBook Air M1 chip

Operating System 13.1

Browser Safari

Problem description For https://github.com/phetsims/qa/issues/900, in the published versions on CCK, as soon as I grab an item out of the carousel or a meter, the highlight around an object in the play area disappears. In 1.3.0-dev.20, the highlight goes away when I let go of the item I grabbed out of the carousel and the highlight doesn't disappear at all when I add a meter to the play area.

Steps to reproduce

  1. Add an element to the play area and click on it
  2. Grab another element from the carousel --highlight remains until you let go of that object
  3. Click on an object in the play area
  4. Add a meter to the play area --highlight remains

Visuals

https://user-images.githubusercontent.com/87318828/220205014-a6159fe4-d011-47e6-b24b-4efa0c39b338.mp4

matthew-blackman commented 1 year ago

@arouinfar mentioned that this is worth some further investigation. She mentioned that this issue is not itself very serious, but may be a byproduct of a deeper issue and warrants looking into.

samreid commented 1 year ago

I'll investigate

samreid commented 1 year ago

In the commit, I clear the highlighted selection when the user drags out a circuit element or sensor. @Nancy-Salpepi can you please review?

Nancy-Salpepi commented 1 year ago

The highlighted selection is now cleared when an element or sensor is dragged out.

In published the highlight is also cleared when:

samreid commented 1 year ago

We reviewed the behavior with @arouinfar. We would like to make it so that dragging a selected CircuitElement | Vertex keeps it selected. Otherwise, it should deselect on mousedown/touchdown.

We also saw that the production version isn't behaving nicely because dragging a selected circuit element then releasing it deselects it.

@arouinfar also commented this is not essential if it is too complex. (we could just deselect everything when anything moves).

matthew-blackman commented 1 year ago

The latest commit appears to give all desired behaviors discussed in the comment above. I have done about 20 minutes of testing across various combinations of selected/deselected objects and wires and found no issues. @arouinfar this is ready for your review.

arouinfar commented 1 year ago

Thanks @samreid @matthew-blackman! The highlighting behavior feels nice in master. @samreid are we good to close?

samreid commented 1 year ago

Yes, thanks, closing.