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

2313 - Abandon subject without losing transcription #4217

Merged

Conversation

WillNigel23
Copy link
Collaborator

@WillNigel23 WillNigel23 commented Jul 10, 2024

Discussions so far with @benwbrum

I'm playing around the functionality. Correct me in if I am wrong here, but I think these should be the cases:

  1. I want to go back and make some changes
    a. We click on cancel button. This should not assign a category, BUT I would assume this should also NOT create the subject, otherwise why cancel in the first place.

  2. I want to save my changes
    a. We click on save or continue button. THIS should assign categories and redirect back to same page (in case we want to edit some texts, add new subjects, etc).
    b. Regardless if they assign the category here, the subject SHOULD persist.

  3. I want to save and continue to next page
    a. It creates and assigns subject and redirects to next page

I believe this should be the case, as was described by the user on the ticket

I just spelled it wrong or left out a punctuation so I don't actually want to be creating a new subject...

Clicking cancel should NOT persist the subject at hand.

That being said, I first went ahead and implement what was instructed in ticket where:

  1. Clicking cancel will take me back to editing page and will not save assigned categories (but subjects will persist)
  2. Clicking continue should redirect to the next appropriate page.

I took out the third button named next This is because past ticket made the continue dependent on the workflow. i.e. If save was clicked it should remain in same page, if done was clicked it will go to next page. So I believe only 2 buttons are relevant here (cancel and continue).

Tagging @saracarl as well

@saracarl
Copy link
Collaborator

Ok, if there is a bracketed subject in the page, and the page is saved, then we need to save the state/fact/existence of that subject, even if it is wrong. The scenario here is "I messed up, I realized it during the subject categorization, so I'm going to cancel and go back and fix it." Subject categorization as a step takes place after the page is saved, so we'll have orphaned subjects if they cancel and go back and fix it.

So here's what we think we should do:

  1. save the page, with the links, which creates the new subject.
  2. left folks cancel or continue in the categorization page
  3. Then to fix "orphaned" subjects -- subjects with no links to them, which would occur after they fixed the typo in the subject on the page, we should clean up all orphaned subjects after each page save.

So for your scenarios:
1a) would actually create the subject on the save, no category. The subject likely gets cleaned up by edits and the next save, but that's not guaranteed.
2a) yes.
2b) Yes. How would a user get into this state? Saving the subject is correct, but it implies a "hanging" subject assignment -- neither finished nor cancelled. We should treat that the same as a cancellation, which might make more sense and might be easier to implement.
3a) Yes.

One caveat: Project owners can upload canonical subjects via a spreadsheet, and we don't want to delete those if they are not used.

If the subject record was created via a spreadsheet upload, then the Article record will have a provenance of the filename they uploaded. Every subject that was created via the transcription process will have a nil provenance. So when we "clean up orphaned subjects" at page save, we need to only delete articles with a nil provenance and no links.
(In production 6000/200,000 have a provenance.)

Removing next makes sense to me.

@WillNigel23 WillNigel23 force-pushed the 2313-abandon-subject-without-losing-transcription branch 2 times, most recently from 63b4c80 to aee5305 Compare July 16, 2024 22:40
@benwbrum
Copy link
Owner

I've just tested this manually, and it looks like--between this PR and #4175--we've missed an important piece of functionality; abandoning subject creation without losing transcription.

Here's what I did:

  • Transcribe a page
  • Add a hyperlink around [[Oats]]
  • Hit save
  • During category assignment, I realized that Oats should not be capitalized, so I hit Cancel
  • I was redirected back to the transcription page
  • However, if I look at the list of Uncategorized subjects, there is a subject for Oats with 0 pages.

@WillNigel23 WillNigel23 force-pushed the 2313-abandon-subject-without-losing-transcription branch from 9600571 to 70814ee Compare July 23, 2024 23:25
@benwbrum
Copy link
Owner

This works as designed, and is easy to use.

One question is whether--while we do this work--we want to eliminate orphaned subjects to handle this use case:

  • User transcribes a page
  • User indexes a mis-spelled word [[Consitution]]
  • User realizes their mistake on the assign categories screen and presses Cancel
  • User corrects the spelling of the word: [[Constitution]]
  • User categorizes their new subject
  • Now two subjects exist:
    • Constitution is categorized and links to the page they transcribed
    • Consitution is uncategorized and links to no pages at all

@saracarl
Copy link
Collaborator

Because we create the subject before asking the transcriber to categorize it, I don't know of a straightforward way to keep track of this and delete the subject from an abandoned subject categorization. There's no guarantee the subject needs to be deleted -- maybe something else made them cancel -- so either we:

  1. save the subject and it's in the system as an uncategorized subject with 0 references. The owner can delete it, correct?
  2. wait to create the subject until after it's categorized.

I'm actually fine with the first solution.

@benwbrum
Copy link
Owner

The alternative approach that would accomplish this is to simply delete all subjects with no page_article_links or article_article_links or provenance at the beginning of a save action, somewhere around the same code where we create page article links and new article records.

@saracarl
Copy link
Collaborator

That sounds great! Let's do that.

Is there a case where folks might create subjects by hand, rather than emergently?

@benwbrum
Copy link
Owner

The only ways for subjects to be created is

  • Emergently (via linking in page transcriptions, page translations, or subject articles)
  • Subject upload (which creates a provenance attribute)

@benwbrum benwbrum merged commit 41cd02c into development Jul 29, 2024
1 check passed
@benwbrum benwbrum deleted the 2313-abandon-subject-without-losing-transcription branch July 29, 2024 20:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

UI enhancement: abandon subject creation midstream without losing transcription
3 participants