ai-cfia / fertiscan-frontend

This repository is for the frontend of the project react
MIT License
1 stars 0 forks source link

As a dev, I want to track changes between the initial analysis and the user final submissions. #99

Open Endlessflow opened 1 week ago

Endlessflow commented 1 week ago

Context: Currently, after receiving images, our analyze route uses services to extract critical information and sends that information to the database. The data is then sent to the front end, where users can edit it until they are satisfied and submit it to the database.

We want to change this workflow. Instead of sending the final data to the database only after user modifications, we will send an initial post to the database during the analyze route. This will store the initial analysis response, allowing us to track differences between the initial analysis and the user's final submission. This will help us measure how often and how significantly the users modify the fields.

To achieve this, we need to make several modifications to the front end and create new backend routes to handle updates and deletions.

Child Issues:

Acceptance Criteria:

  1. Frontend Notification of Abandonment:

    • Implement a way for the frontend to detect when a user has abandoned a form (e.g., via navigating away, closing the browser, or refreshing the page).
    • Use browser modals to warn users that they are about to leave the page and will lose their progress.
  2. UI Event Handling:

    • Ensure the UI can handle events such as going back, leaving the page, and refreshing, and treat these events accordingly.