-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix for PR 5754 #5913
Fix for PR 5754 #5913
Conversation
@goplayoutside3 - just tested out your PR and the bug I outlined is still there. Please see the attached video about how previous marks on different frames don't get pulled in the way I assume they should. PrevMarks.Bug.mp4 |
Ah okay I see what's happening. The video is related to your question about
InteractionLayerContainer gets its Because InteractionLayerContainer is observing the store, it re-renders whenever
PreviousMarks gets its You can inspect Line 49 in 6b421ed
does not actually have access to frame on each Mark without more explicit handling of store snapshots. See the use of resolveIdentifier in DrawingAnnotation:front-end-monorepo/packages/lib-classifier/src/plugins/tasks/drawing/models/DrawingAnnotation.js Line 17 in 6b421ed
and my logging of the annotation snapshot in my latest commit.
To summarize, the reason InteractionLayerContainer and PreviousMarks grab annotation marks from the store in two different ways is because PreviousMarks is limited to only rendering marks created or edited by a volunteer and also needs to grab annotations from other steps. InteractionLayerContainer only cares about the active step. I can't spend more time on this today, but will update if I think of a way to address this problem later this week. |
const annotationMarks = annotation.toSnapshot()[0].value | ||
console.log(annotationMarks) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This shows correctly stored marks
while jumping between workflow steps. The issue is that PreviousMarks isn't actually filtering per frame
yet.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here, you should use getSnapshot(annotation)
to debug the annotation. That's how I figured out that the annotation value didn't include all of the drawn marks.
annotation.toSnapshot()
dereferences a drawing task's marks so that they can be saved to Panoptes. It doesn't give the same value as annotation.value
(but #5923 should fix that by making sure that annotation.value
always reflects the current value of task.marks
.)
@kieftrav noting here that the bug in your video exists on production too. It can be replicated in the How Did We Get Here project that has multi-frame transcription subjects and two steps in the workflow. |
I've asked Jim for input here, too. |
After creating a new mark, add the new mark to the previous annotation value and store this as a new annotation. Should fix a bug raised in this comment: zooniverse#5913 (comment)
@goplayoutside3 - I've incorporated Jim's one-liner into my PR. I don't think all of the other changes here make sense - they're focused on changing the Because we resolved the issue with losing track of marks in the PreviousMarks component (i.e. Jim's fix) the current PR works as expected as far as I can tell. |
After creating a new mark, add the new mark to the previous annotation value and store this as a new annotation. Should fix a bug raised in this comment: zooniverse#5913 (comment)
After creating a new mark, add the new mark to the previous annotation value and store this as a new annotation. Should fix a bug raised in this comment: zooniverse#5913 (comment)
9f77c51
to
c93f21f
Compare
See context for these changes in PR #5754's discussion, and particularly my comment here.