Skip to content

Add overwrite warning for duplicate file uploads (#2679)#5477

Open
bstepanovski wants to merge 2 commits into
masterfrom
feature/upload-same-filename-alert-2679
Open

Add overwrite warning for duplicate file uploads (#2679)#5477
bstepanovski wants to merge 2 commits into
masterfrom
feature/upload-same-filename-alert-2679

Conversation

@bstepanovski
Copy link
Copy Markdown
Contributor

Fixes #2679

Uploading a file with the same name as an existing file had no warning, so files could be overwritten without users realizing it

  • Added an overwrite confirmation before uploads start with single and multi-file messaging plus a "never show again" option stored in localStorage
  • Intercepted the upload button click instead of using a pre-upload hook so canceling the warning does not leave uploads in a failed state
  • Added system tests covering single file overwrite warnings, multi file overwrite warnings, and disabling the warning

@github-project-automation github-project-automation Bot moved this to Awaiting Review in PR Review Pipeline May 20, 2026
@bstepanovski bstepanovski changed the title Add overwrite warning for duplicate uploads (#2679) Add overwrite warning for duplicate file uploads (#2679) May 20, 2026
@Bubballoo3
Copy link
Copy Markdown
Contributor

I'm not sure that I like the idea of stacking the modals on top of one another. It seems like that is a consequence of

Intercepted the upload button click instead of using a pre-upload hook so canceling the warning does not leave uploads in a failed state

But I feel like we should be able to intercept the upload and cancel it without leaving things in a failed state. I could be missing something though.

In any case, the modal itself suffers many of the issues noted in #5068. There are two close buttons, the title is not bolded, and the checkbox is part of the main content, when it seems like it would fit better below the dividing line next to the 'cancel' and 'upload' buttons. Finally, I think the message would be better framed as a question, something like 'The following file/s already exist. Overwrite these files?' and then the options can be 'Cancel' and 'Overwrite'. It also seems like the button to continue should be red, since this is a permanent action.

@Bubballoo3
Copy link
Copy Markdown
Contributor

But I feel like we should be able to intercept the upload and cancel it without leaving things in a failed state. I could be missing something though.

I see why now, since we show the upload progress in the upload modal. So there is no good way to close that and later continue without flashing the modals back and forth

Copy link
Copy Markdown
Contributor

@Bubballoo3 Bubballoo3 left a comment

Choose a reason for hiding this comment

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

It also looks like this doesn't present itself during folder uploads. Since a duplicate folder could overwrite or just plain delete several files at once, this is definitely a case we have to handle

@github-project-automation github-project-automation Bot moved this from Awaiting Review to Changes Requested in PR Review Pipeline May 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Changes Requested

Development

Successfully merging this pull request may close these issues.

upload with same filename alert

3 participants