zooniverse / front-end-monorepo

A rebuild of the front-end for zooniverse.org
https://www.zooniverse.org
Apache License 2.0
104 stars 30 forks source link

Freehand Line: Edit/Correction feature acts strangely if interrupted #3558

Closed shaunanoordin closed 2 years ago

shaunanoordin commented 2 years ago

UI/UX Bug on Experimental Feature

Follows #3446, specifically issue 2 in this review

Context: in PR 3446, we modified the (experimental) Freehand Drawing Line tool, allowing users to edit a selected segment of the freehand line (FHL).

Problem: the correction feature acts very strangely if interrupted.

Details:

Status

Low to medium priority, because while this definitely a problem that borks UI/UX and the data submitted, (1) the FHL still works if the user follows exact procedures, and (2) the FHL is still an experimental tool.

Low urgency since no active project (i.e. Correct-A-Cell) is using FHL's edit/correction feature at the moment.

Automatically assigned to Jim as a follow up to 3446, but please un-assign if you have other things on your place 👌

eatyourgreens commented 2 years ago

Here’s a video from #3446, in Chrome 104, where I clicked off the line during drawing then selected it again and continued drawing without problems.

https://user-images.githubusercontent.com/59547/184857368-4bb18f05-43c0-4aac-89aa-9bfdcfee7b51.mov

eatyourgreens commented 2 years ago

Here's another screen recording, also in Chrome 104, where I interrupt drawing by selecting a different mark, then return to the original line without problems.

https://user-images.githubusercontent.com/59547/185590597-702bf922-0485-4b5d-82ae-21dd5701a6bb.mov

eatyourgreens commented 2 years ago

Last example, also in Chrome 104. Here I start drawing a freehand line, change tools and make some different marks, then return to finish the freehand line.

https://user-images.githubusercontent.com/59547/185592831-2cb85987-fd4e-46f5-a89d-d0afbccfc33c.mov

eatyourgreens commented 2 years ago

I think this issue was fixed by https://github.com/zooniverse/front-end-monorepo/pull/3446/commits/dc3489fdf7fb37da4ee125c26d956f33445c7f11 (part of #3446.)

shaunanoordin commented 2 years ago

Some documentation following out discussion earlier:

(Note 1) An interrupted FHL mark can still be submitted, causing very wonky data to be submitted. For example,

Screenshot 2022-08-19 at 13 44 10 Screenshot 2022-08-19 at 13 45 01
shaunanoordin commented 2 years ago

(Note 2) Here's a video of the special case, where continuously clicking on an FHL mark (that's in already edit mode) causes the mark to "shrink" (permanently lose segments)

https://user-images.githubusercontent.com/13952701/185624452-39611519-383f-446e-80f7-afe71998c63c.mov

As discussed, this is a result of the Edit FHL feature not having a proper "undo" stack. Marking the Start and End points immediately remove the segment from the data array, so continuous clicks (marking new End points) causes portions of the array to be permanently removed. (If we had the undo stack, we'd revert to the original array before removing the newly marked/updated segment)