aunttwister / finance.collection

0 stars 0 forks source link

Progress bar representing the stages of scraping #1

Open aunttwister opened 4 months ago

aunttwister commented 4 months ago

Request for enhancing the progress bar of scraping which should reflect the ongoing stages of scraping. Likewise, upon stage completion, this should be portrayed as a notification to the frontend, which will be displayed in progress bar status.

aunttwister commented 4 months ago

= SPEC-001: Web Scraping Progress Bar with Exception Handling for Blazor WASM :sectnums: :toc:

== Feature Description

Implement a progress bar in a client-side Blazor WebAssembly application that visually represents the real-time progress of a web scraping operation. The progress bar should update reactively as the scraping task progresses and handle exceptions by reflecting errors visually, providing immediate feedback to the user without the need for a backend server.

== User Stories

=== Main User Story "As a user, I want to see a real-time progress bar on my Blazor application while data is being scraped, so that I can visually track the progress of the data collection process and be alerted to any issues that may occur."

== Functional Requirements

. The progress bar must be visually integrated within the existing Blazor application's UI. . Progress updates must be pushed from the scraping process to the UI without manual refreshes. . The progress bar must reflect accurate progress based on predefined checkpoints within the scraping process. . The implementation must handle scenarios where scraping is completed successfully or fails prematurely. . The progress bar must also respond to exceptions in the scraping process by updating its state to reflect errors, providing feedback that an issue has occurred. . The UI should allow the user to view details of the error if needed, without overwhelming the user with technical details.

== Non-Functional Requirements

. The progress bar update mechanism must be efficient and minimize performance impacts on the client-side application. . The UI should be responsive and visually indicate progress and error states even with rapid updates. . Consider accessibility features, such as color contrast and screen reader support.

== Acceptance Criteria

  1. When a scraping operation is initiated, the progress bar appears and is initially set to 0%.
  2. The progress bar updates in real-time as the scraping process emits progress events.
  3. Upon completion of the scraping task, the progress bar should reach 100% and possibly display a completion message.
  4. If the scraping fails at any point, the progress bar should show an error state (e.g., change color to red) and stop progressing.
  5. The UI should provide an option to view more details about the error or retry the operation if the user chooses.

== Implementation Considerations

. Use of .NET events in the scraping library to emit progress and exception updates. . Use of Blazor’s event handling and state management to update the UI based on the progress and error data received.

== Dependencies

. Modifications to the scraping library to emit progress-related and error events. . Blazor component development to handle events and update the UI.

== Testing Strategy

. Unit tests for event emission logic in the .NET scraping classes. . Component tests for the Blazor progress bar to ensure it reacts correctly to the emitted events and error states. . Integration tests to verify the complete system’s behavior from scraping to progress and error display.

== UI/UX Design

. Design a progress bar that is visually consistent with the existing application design. . The progress bar should visually change when an error state is detected.