Skip to content

Conversation

@adamrefaey
Copy link
Collaborator

Change

This pull request introduces improvements to the bookmarking functionality, error handling, and user experience in the processing flow. The most notable changes include refactoring the bookmark update logic, ensuring proper cleanup of intervals, and integrating an upload modal in the error handling component.

Bookmarking Functionality:

  • Refactored the useToggleReportBookmark hook to simplify the logic for updating the bookmark status in the report detail page by directly replacing the report if IDs match, improving code clarity and maintainability. (frontend/src/common/hooks/useReports.ts)

Processing Flow Enhancements:

  • Added a call to clearStatusCheckInterval() before starting a new interval in the ProcessingPage component to ensure proper cleanup of intervals and prevent potential memory leaks. (frontend/src/pages/Processing/ProcessingPage.tsx)

Error Handling Improvements:

  • Updated the ProcessingError component to include an UploadModal for retrying uploads directly from the error screen. This involved adding state management for modal visibility and defining a callback to handle upload completion and navigate the user to the home page. (frontend/src/pages/Processing/components/ProcessingError.tsx) [1] [2] [3]

Does this PR introduce a breaking change?

{...}

What needs to be documented once your changes are merged?

{...}

Additional Comments

{...}

@adamrefaey adamrefaey requested a review from Copilot May 2, 2025 16:07
@adamrefaey adamrefaey self-assigned this May 2, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR improves the bookmarking functionality, processing flow, and error handling in the application. Key changes include refactoring the bookmark update logic, ensuring proper interval cleanup in the processing flow, and integrating an UploadModal in the error handling component.

  • Refactored the useToggleReportBookmark hook to update the report detail cache more succinctly.
  • Added a call to clearStatusCheckInterval() before starting a new interval in ProcessingPage.
  • Integrated an UploadModal in ProcessingError to allow users to retry uploads from the error screen.

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
frontend/src/pages/Processing/components/ProcessingError.tsx Added UploadModal and state management for improved error handling UX.
frontend/src/pages/Processing/ProcessingPage.tsx Ensured proper interval cleanup by clearing existing intervals before starting a new one.
frontend/src/common/hooks/useReports.ts Refactored the bookmark update logic by directly replacing the report based on matching IDs.

@GuidoBR GuidoBR merged commit a8af8dd into main May 2, 2025
1 check passed
@adamrefaey adamrefaey deleted the ADE-215 branch May 2, 2025 16:10
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.

3 participants