Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Change
This pull request introduces several updates across the codebase, focusing on improving query invalidation consistency, refactoring components for better maintainability, and enhancing the user interface. Key changes include replacing synchronous query invalidations with asynchronous ones, refactoring components to use
FC
(Function Component) from React, and restructuring theReportDetailPage
for better separation of concerns.Query Invalidation Improvements:
onSuccess
callbacks in hooks likeuseChat
,useSignIn
, andProcessingPage
to useawait
for query invalidations, ensuring consistent behavior and preventing potential race conditions. (frontend/src/common/hooks/useChat.ts
[1] [2]],frontend/src/pages/Auth/SignIn/api/useSignIn.ts
[3]],frontend/src/pages/Processing/ProcessingPage.tsx
[4]])Component Refactoring:
React.FC
withFC
in multiple components for consistency and brevity. This change affects components likeAiAnalysisTab
,AiAssistantNotice
,EmergencyAlert
, and others in theReportDetail
module. (frontend/src/pages/ReportDetail/components/ActionButtons.tsx
[1]],AiAnalysisTab.tsx
[2]],AiAssistantNotice.tsx
[3]], etc.)ReportDetailPage
Enhancements:handleDiscard
andhandleNewUpload
logic fromReportDetailPage
to theActionButtons
component, improving separation of concerns and reducing the complexity of the page component. (frontend/src/pages/ReportDetail/ReportDetailPage.tsx
[1] [2]],ActionButtons.tsx
[3]])__back-button
style inReportDetailPage.scss
for improved UI consistency. (frontend/src/pages/ReportDetail/ReportDetailPage.scss
[frontend/src/pages/ReportDetail/ReportDetailPage.scssR28-R40])Code Cleanup:
ReportDetailPage.tsx
, such as theuseToasts
hook and thequeryClient
instance, which are now handled in child components. (frontend/src/pages/ReportDetail/ReportDetailPage.tsx
[1] [2]])UI Enhancements:
ProcessingPage
by adding afrom
property to thehistory.push
call, enabling better tracking of the previous page. (frontend/src/pages/Processing/ProcessingPage.tsx
[frontend/src/pages/Processing/ProcessingPage.tsxL76-R81])These changes collectively improve code maintainability, user experience, and overall performance.
Does this PR introduce a breaking change?
{...}
What needs to be documented once your changes are merged?
{...}
Additional Comments
{...}