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.
This pull request introduces a user-facing "Cancel Upload" feature to the uploader component, allowing users to abort in-progress uploads. The implementation includes UI updates and underlying context and state management to support upload cancellation, as well as minor improvements to image handling.
Uploader Cancelation Feature:
CancelUploadButton
component to the UI, which is conditionally shown when an upload can be canceled. Clicking this button will abort the current upload.UploaderContextState
andUploaderContextActions
) to include acanCancel
flag and acancelUpload
function, enabling components to check if cancelation is possible and to trigger cancelation. [1] [2] [3] [4]UploaderRoot
: tracks anAbortController
, sets up cancelation state, and ensures that aborting an upload resets the uploader without surfacing errors to the user. [1] [2] [3] [4] [5] [6] [7]UI and Usability Improvements:
<img>
tag with Next.js's<Image>
component for better image optimization and accessibility in the uploader form. [1] [2]These changes collectively improve the user experience by providing a safe and responsive way to cancel uploads and by enhancing the uploader's UI and maintainability.