Skip to content

Conversation

n3-rd
Copy link

@n3-rd n3-rd commented Aug 13, 2025

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:

  • Added a CancelUploadButton component to the UI, which is conditionally shown when an upload can be canceled. Clicking this button will abort the current upload.
  • Extended the uploader context (UploaderContextState and UploaderContextActions) to include a canCancel flag and a cancelUpload function, enabling components to check if cancelation is possible and to trigger cancelation. [1] [2] [3] [4]
  • Implemented upload cancelation logic in UploaderRoot: tracks an AbortController, 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:

  • Replaced the <img> tag with Next.js's <Image> component for better image optimization and accessibility in the uploader form. [1] [2]
  • Minor code improvements, including variable scoping and React hook usage. [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.

n3-rd added 2 commits August 13, 2025 06:49
…ploader

- Introduced a `CancelUploadButton` component to allow users to cancel ongoing uploads.
- Updated the uploader context to include `canCancel` and `cancelUpload` actions.
- Replaced `<img>` with Next.js `<Image>` component for better performance and optimization.
- Enhanced upload state management to handle cancellation gracefully.
@n3-rd n3-rd requested a review from travis as a code owner August 13, 2025 06:01
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.

1 participant