Page MenuHomePhabricator

Add popup for feedback and final approval after bulk OCR and before the text is written back
Open, Needs TriagePublic

Description

Assuming that the flow in T394130 is built an functional, the following improvements need to be made.

This task deals with adding a dialog box once the OCR results for the initial pages are ready so that appropriate confirmation can be obtained from the user before writing the transcribed text back to the text layer.

Details and specifics

  • There should be a dialog box with the content area divided into two halves: one half showing the image of the page and the other half containing the transcribed text as obtained from the API response.
    • Ideally, previews should be shown for at least the first 5 pages of the book
  • Once the user clicks “Approve”, the OCRed text should be inserted into the text layer of each page of the book
  • Have a banner at the top of the approve dialog box that says Proceed with the action only if you know what you are doing as it affects multiple pages of the book.

Possible OOUI components

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript

Hi! I have been reviewing the bulk OCR implementation in the Wikisource extension, particularly the BulkOcrWidget module.

From what I can see, once OCR processing finishes the workflow emits the ocr-complete event, which immediately calls saveOcrResults() to write the OCR output to Page namespace pages.

For T394131, it seems the confirmation step could be introduced at this point in the flow, intercepting the ocr-complete event and presenting a preview/confirmation dialog before invoking saveOcrResults().

Since the OCR results are stored in ocrDictionary, it might also be possible to display a small preview or summary of the generated OCR text before committing the changes.

Before attempting an implementation, I wanted to confirm whether the intended behavior is to preview OCR output per page (for example the first few pages) or simply provide a confirmation step before saving the results......

Thanks for taking a look at this!

Yes you seem to have the flow figured out correctly. The intended behaviour is more about previewing the first and/or last few pages than just a simple confirmation.

However since this task is part of the bigger bulk ocr task, I would suggest that you familiarise yourself with the codebase by attempting one of the other smaller wikisource related tasks. There's always something to be done!

Thanks for the clarification and direction! I will explore some smaller Wikisource-related tasks to get more familiar with the codebase first.