Skip to content
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 previous marks from caesar render for transcription task #2001

Merged
merged 5 commits into from
Jan 25, 2021

Conversation

srallen
Copy link
Contributor

@srallen srallen commented Jan 22, 2021

Please request review from @zooniverse/frontend team. If PR is related to design, please request review from @beckyrother in addition.

Package: lib-classifier

Toward #1978, fixes the previous marks render described in this comment: #1978 (comment)

You can test by running the dev classifier with https://localhost:8080/?project=11300&env=production

The previous transcription marks loaded from the caesar reductions are now viewable throughout the workflow tasks and this enables us to answer the question from the second step question task:

Screen Shot 2021-01-22 at 5 05 56 PM

The hide previous marks button is always available too:

Screen Shot 2021-01-22 at 5 06 14 PM

Compare this to another project with a drawing task (https://localhost:8080/?project=908&workflow=3370), the hide previous marks button is only available on the step with drawing tasks.

Review Checklist

General

  • Are the tests passing locally and on Travis?
  • Is the documentation up to date?

Components

Apps

  • Does it work in all major browsers: Firefox, Chrome, Edge, Safari?
  • Does it work on mobile?
  • Can you yarn panic && yarn bootstrap or docker-compose up --build and app works as expected?

Publishing

  • Is the changelog updated?
  • Are the dependencies updated for apps and libraries that are using the newly published library?

Post-merging

@srallen srallen added the bug Something isn't working label Jan 22, 2021
@srallen srallen added this to the IMLS text transcription milestone Jan 22, 2021
@srallen srallen mentioned this pull request Jan 22, 2021
8 tasks
@eatyourgreens eatyourgreens self-assigned this Jan 24, 2021
@eatyourgreens
Copy link
Contributor

eatyourgreens commented Jan 25, 2021

There's a minor styling bug introduced with this PR. On a drawing task with marks from a previous step, the previous marks show the hand cursor on hover. They can't be selected, so it's only the styling that's broken.
https://localhost:8080/?project=908&workflow=3370

Screenshot of a drawing task showing the hand cursor over a mark that can't be selected.

@eatyourgreens
Copy link
Contributor

The transcription project looks good to me. Transcribed lines are visible are visible as per the screenshot above. Should I expect any of the purple and blue lines to turn grey?

@eatyourgreens
Copy link
Contributor

Hide/Show previous marks is broken on a workflow with two drawing steps.

  1. Hide previous marks on the second step.
  2. Press Back.
  3. Previous marks are rendered again for the first step.
  4. Press Next.
  5. Previous marks are hidden again, and can be revealed with the Show Previous Marks button.

I can reproduce that behaviour on master, so it isn't a blocker here.

Copy link
Contributor

@eatyourgreens eatyourgreens left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code changes look good to me. There's a couple of places where I thought the tests were hard to understand. There's a styling bug introduced here for previous marks from drawing tasks. I'm not sure if you want to fix that here, or open a separate issue?

The styling bug shouldn't be a blocker for the transcription project beta test.

@github-actions github-actions bot added the approved This PR is approved for merging label Jan 25, 2021
…ubjectViewer/components/InteractionLayer/components/PreviousMarks/PreviousMarks.spec.js

Co-authored-by: Jim O'Donnell <[email protected]>
@srallen
Copy link
Contributor Author

srallen commented Jan 25, 2021

Should I expect any of the purple and blue lines to turn grey?

Not yet, the grey state is the retired state from Caesar. We need more classifications to get them to turn grey.

Comment on lines +20 to +21
{interactionTaskAnnotations.map((annotation) => {
const annotationValuesPerFrame = annotation.value.filter(value => value.frame === frame)
Copy link
Contributor

@goplayoutside3 goplayoutside3 Feb 15, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@eatyourgreens this is a long-ago PR, but I have a question particularly about this line introduced here, which is still used in production. annotationValuesPerFrame is intended to filter marks based on the frame passed to PreviousMarks component. However, Travis and I have found that's not always the case and are unsure how long the following bug has been around ~

On projects with multi-frame subjects and more than one workflow step, previous annotations do not filter correctly when switching between frames. For instance, How Did We Get Here is a transcription project with drawing as the first step and a yes/no as the second step. If I draw marks on all the frames in the first step, then go to the 2nd step, navigating between frames renders marks on only one frame. I think the expected behavior is that previous marks should always render on their respective frames. Any thoughts on how to fix this filter?

(More dicussion here).

Copy link
Contributor

@eatyourgreens eatyourgreens Feb 15, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can confirm the bug. Here, I've added two lines to frame 0 and one line to frame 1. classification.annotations only contains one line ID for task T0, not three.

Are annotations being lost on live projects that transcribe more than one page per subject?

Screenshot of the dev classifier for How Did We Get Here. The console is open to show that classification.annotations only contains one transcribed line.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When I go back to the drawing step, my drawn lines are there. They haven't been added to the classification. So my thought would be that the bug is in the code that adds mark IDs to the current classification.

Screenshot of the dev classifier for How Did We Get Here. There are two drawn lines on the page, but neither are stored in classification.annotations yet.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I then add a third mark to frame 0, classification.annotations updates to show the three lines from that frame, but loses the line from frame 1.

Screenshot of the dev classifier for How Did We Get Here. I have added a third line to the first frame of the active subject, and `classification.annotations` now shows the three mark IDs for those lines, but has lost the ID of the fourth line (on the second frame.)

Copy link
Contributor

@eatyourgreens eatyourgreens Feb 15, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Based on that, I would say that previousAnnotations is working as expected, but the classification isn't being updated correctly when you draw on more than one frame of a subject. classification.annotations only contains mark IDs for the active frame. I'd expect it to contain the mark IDs for all the transcription lines that I've made.

const markIDs = marks.map((mark) => mark.id)
annotation.update([...markIDs, mark.id])

Since this bug is in production, and there are projects with subjects that have more than one page, I would definitely double check that classifications are being recorded properly when a volunteer adds lines to more than one page.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've suggested a fix for the markIDs array in #5919.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here is the bug, by the way. marks here is filtered by frame before being added to the classification in InteractionLayer.

Copy link
Contributor

@eatyourgreens eatyourgreens Feb 15, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#5923 is a more robust fix, replacing the manual update with an autorun reaction that runs whenever the task’s marks change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved This PR is approved for merging bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants