phetsims / expression-exchange

"Expression Exchange" is an educational simulation in HTML5, by PhET Interactive Simulations.
GNU General Public License v3.0
2 stars 2 forks source link

When rapidly assembling expressions, coins/variables can become misaligned. #64

Closed EthanWJohnson closed 7 years ago

EthanWJohnson commented 7 years ago

After disassembling a very large expression on the explore screen, there will typically be a number of coins in very close proximity to each other. Rapidly assembling new an expression with them by dragging the coins around quickly will cause several of the coins/variables to be misaligned in the expression, which can only be cleared by disassembling the expression again.

Picture of misalignment; image

.gif of how to misalign; misalign

I'm unsure what mechanism precisely is causing this; my intuition is multiple groups adding to a single expression causes it, but I can't be sure.

Seen on: Windows 10 Chrome

Related to https://github.com/phetsims/tasks/issues/807

Debug Info:

Name: ‪Expression Exchange‬ URL: http://www.colorado.edu/physics/phet/dev/html/expression-exchange/1.0.0-dev.21/expression-exchange_en.html? Version: 1.0.0-dev.21 2017-03-22 20:43:18 UTC Features missing: touch User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.110 Safari/537.36 Language: en-US Window: 1366x648 Pixel Ratio: 1/1 WebGL: WebGL 1.0 (OpenGL ES 2.0 Chromium) GLSL: WebGL GLSL ES 1.0 (OpenGL ES GLSL ES 1.0 Chromium) Vendor: WebKit (WebKit WebGL) Vertex: attribs: 16 varying: 30 uniform: 4096 Texture: size: 16384 imageUnits: 16 (vertex: 16, combined: 32) Max viewport: 16384x16384 OES_texture_float: true Dependencies JSON: {"assert":{"sha":"a707328c","branch":"master"},"axon":{"sha":"f7720d0e","branch":"master"},"babel":{"sha":"27a73346","branch":"master"},"brand":{"sha":"0be722ee","branch":"master"},"chipper":{"sha":"cee4e64f","branch":"master"},"dot":{"sha":"569939e1","branch":"master"},"expression-exchange":{"sha":"9652db1d","branch":"master"},"joist":{"sha":"7540ec3c","branch":"master"},"kite":{"sha":"81166ce9","branch":"master"},"phet-core":{"sha":"c5c6c2a8","branch":"master"},"phetcommon":{"sha":"c7cb85b6","branch":"master"},"query-string-machine":{"sha":"d8a4ff18","branch":"master"},"scenery":{"sha":"02fb8a32","branch":"master"},"scenery-phet":{"sha":"f4fee1ab","branch":"master"},"sherpa":{"sha":"3255de0f","branch":"master"},"sun":{"sha":"d98d635a","branch":"master"},"tandem":{"sha":"a668abd5","branch":"master"},"vegas":{"sha":"1e2b1b0c","branch":"master"},"vibe":{"sha":"549baf54","branch":"master"}}

jbphet commented 7 years ago

This should now be fixed, unassigning, will have it re-tested on next dev or rc release.

phet-steele commented 7 years ago

@EthanWJohnson please check 1.1.0-dev.3 for this issue.

EthanWJohnson commented 7 years ago

Tested several times; this is still occuring in 1.1.0-dev.3, though it much harder to do.

image

image

EthanWJohnson commented 7 years ago

Would also like to note that when misalignment happens I am now getting the following error; image

jbphet commented 7 years ago

Unable to duplicate, possibly because of other changes made recently. Back to @EthanWJohnson and @phet-steele for more precise instruction on how to duplicate.

phet-steele commented 7 years ago

@jbphet, after watching that gif ~1 million times, this is what is occurring:

  1. Assemble an expression, the longer the better.

  2. Put one lone term below the expression and another lone term beside the other lone term, like so:

    screen shot 2017-06-22 at 1 04 09 pm
  3. This next step is done quickly, hence the name of this issue. Pick up the expression and release it above the rightmost lone term. Do not cover the term. Before the expression has a chance to animate and combine with the lone term, take the second lone term and form an expression with it and the other lone term. This will form two expressions that share a term.

ee17

EthanWJohnson commented 7 years ago

I had suspected it was related to merging (like our dear friend https://github.com/phetsims/expression-exchange/issues/113) but I hadn't been able to isolate it directly.

jbphet commented 7 years ago

Nice work @phet-steele - this made it much easier to address. I've added code to prevent coin terms that are about to be engulfed by an expression from being able to join with another free coin term. Please retest.

phet-steele commented 7 years ago

@jbphet I've had no luck reproducing anything pertaining to this issue in dev.4