Skip to content

[PB-6531]feat/skip item option in name collision - #2039

Merged
terrerox merged 15 commits into
fix/name-collision-matching-and-batchingfrom
feat/skip-item-option-in-name-collision
Oct 7, 2026
Merged

terrerox merged 15 commits into
fix/name-collision-matching-and-batchingfrom
feat/skip-item-option-in-name-collision

Conversation

@jaaaaavier

@jaaaaavier jaaaaavier commented Jul 13, 2026 •

Copy link
Copy Markdown
Contributor

Description

Stacked on #2148 (which sits on #2147 and #2146). Adds a Skip option to the name-collision dialog, next to Replace and Keep both, for both upload and move collisions. Duplicates are now resolved one at a time, and a new "Apply this action to all duplicates" checkbox handles them all at once, closing the dialog immediately and running the work in the background.

The container logic lives in nameCollision.actions.ts and nameCollision.utils.ts (extracted in #2146 and #2147), so this PR adds the skip branch to the resolvers, the pending-group bookkeeping for the one-at-a-time flow, and their unit tests. The name-based matching and batching fixes that used to be bundled here are now #2148.

Also: the renameModal i18n block is renamed to alreadyExistsModal (the dialog doesn't rename anything), the description text is operation-neutral, and the apply-to-all label toggles the checkbox.

Skipping a folder is a no-op here; merging its new content into the existing folder comes in #2129, stacked on this one.

Related Issues

Related Pull Requests

Checklist

  • Changes have been tested locally.
  • Unit tests have been written or updated as necessary.
  • The code adheres to the repository's coding standards.
  • Relevant documentation has been added or updated.
  • No new warnings or errors have been introduced.
  • SonarCloud issues have been reviewed and addressed.
  • QA Passed

Testing Process

Tested uploading existing files, then, verified that all functions work as expected

Additional Notes

@jaaaaavier jaaaaavier self-assigned this Jul 13, 2026
@jaaaaavier jaaaaavier added the enhancement New feature or request label Jul 13, 2026
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jul 13, 2026 •

Copy link
Copy Markdown

Deploying drive-web with  Cloudflare Pages  Cloudflare Pages

Latest commit: 53ac5f2
Status:⚡️  Build in progress...

View logs

@sonarqubecloud

Copy link
Copy Markdown

@jaaaaavier
jaaaaavier marked this pull request as ready for review July 13, 2026 14:03
"title": "Umbenennen",
"label": "Name"
},
"renameModal": {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

nit: why teh change of the key?

Comment thread src/app/i18n/locales/es.json Outdated
"description": "{{itemName}} ya existe en esta carpeta. ¿Deseas reemplazarlo o mantener los dos?",
"multipleDescription": "Más de un elemento existe en esta localización. Deseas reemplazarlos o mantenerlos?",
"selectOption": "Selecciona una opción",
"description": "{{itemName}} ya existe en esta ubicación. ¿Deseas reemplazarlo por el que estás moviendo?",

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

it is like always gonna move all the items and it is not the only action. The modal also is used for uploading

Comment on lines +152 to +159
{remainingItemsCount > 1 && (
<div className="flex items-center">
<Checkbox checked={applyToAll} onClick={() => setApplyToAll((prev) => !prev)} />
<p className="ml-2 select-none text-base font-medium text-gray-80">
{translate('modals.alreadyExistsModal.applyToAll')}
</p>
</div>
)}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

to keep element consistency maybe we should do that pressint the text also select/unselect the checkbox

case 'upload' + 'replace':
await replaceAndUploadSingleItem(itemToUpload as IRoot | File, itemToReplace, group.destinationUuid);
break;
case 'upload' + 'skip':

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

move + skip option should exists or is only for upload option?

@github-actions

Copy link
Copy Markdown

This pull request has been inactive for 30 days. Is it still in progress? If so, please leave a comment or make an update to keep it open. Otherwise, it will be closed automatically in 15 days.

@terrerox terrerox self-assigned this Aug 22, 2026
@github-actions github-actions Bot removed the stalled label Aug 22, 2026
@terrerox
terrerox marked this pull request as draft August 22, 2026 16:21
@terrerox
terrerox force-pushed the feat/skip-item-option-in-name-collision branch 2 times, most recently from a8f0beb to 9ce4b8b Compare August 26, 2026 00:56
@terrerox

Copy link
Copy Markdown
Contributor

The folder-merge behavior (skip keeps the existing folder and uploads only the new content) is in the follow-up #2129, stacked on this branch

@terrerox
terrerox marked this pull request as ready for review August 26, 2026 01:06
@terrerox
terrerox requested a review from CandelR August 26, 2026 14:49
Comment on lines +260 to +277
case 'move' + 'keep':
await keepAndMoveItems([itemToUpload as DriveItemData], group.destinationUuid);
dispatch(storageActions.popItemsToDelete([itemToUpload as DriveItemData]));
break;
case 'move' + 'replace':
await replaceAndMoveItems(pairs as CollisionPair<DriveItemData>[], group.destinationUuid);
dispatch(storageActions.popItemsToDelete([itemToUpload as DriveItemData]));
break;
case 'upload' + 'keep':
await keepAndUploadItems([itemToUpload as IRoot | File], group.destinationUuid);
break;
case 'upload' + 'replace':
await replaceAndUploadItems(pairs as CollisionPair<IRoot | File>[], group.destinationUuid);
break;
case 'upload' + 'skip':
case 'move' + 'skip':
break;
}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This is almost duplicated, please check it. All the logic for managing the different types of items and actions can be moved out of the component, add tests to all that logic.

const movedItem = itemToUpload as DriveItemData;
return existingItems.find(
(existing) =>
!!existing.isFolder === !!movedItem.isFolder &&

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I'm not sure if existingItems items have the isFolder field.

@terrerox
terrerox force-pushed the feat/skip-item-option-in-name-collision branch from 9ce4b8b to 41817e2 Compare September 11, 2026 03:40
@terrerox
terrerox changed the base branch from master to fix/name-collision-matching-and-batching September 11, 2026 03:40
@terrerox
terrerox added this pull request to stack #2149 September 11, 2026 04:06
@terrerox
terrerox force-pushed the feat/skip-item-option-in-name-collision branch from 41817e2 to 890333f Compare September 11, 2026 04:43
@terrerox
terrerox removed this pull request from stack #2149 September 11, 2026 05:41
@terrerox
terrerox added this pull request to stack #2151 September 11, 2026 05:44
@terrerox
terrerox requested a review from CandelR September 11, 2026 05:51
@terrerox
terrerox force-pushed the fix/name-collision-matching-and-batching branch from 7091a30 to bce942f Compare September 15, 2026 03:33
@terrerox
terrerox force-pushed the feat/skip-item-option-in-name-collision branch from 890333f to c327fed Compare September 15, 2026 03:33
CandelR
CandelR previously approved these changes Sep 18, 2026
@terrerox
terrerox force-pushed the feat/skip-item-option-in-name-collision branch 2 times, most recently from dec3bf9 to 6c5fa93 Compare September 30, 2026 02:25
@terrerox
terrerox force-pushed the feat/skip-item-option-in-name-collision branch 2 times, most recently from 8be0b5a to c4b1f37 Compare October 7, 2026 01:03
Covers single and multiple duplicates, per-item and apply-to-all skipping,
non-conflicting files still uploading, and Replace trashing the matching
file, with auth, bootstrap and Drive endpoints mocked so the specs run
without a backend. Queued uploads are asserted through the task panel
because Playwright cannot intercept the bridge in Firefox.
Adds a Skip option to the name-collision dialog, next to Replace and Keep
both, for both upload and move collisions. Duplicates are resolved one at
a time, and a new "Apply this action to all duplicates" checkbox handles
them all at once, closing the dialog immediately and running the work in
the background.

The renameModal i18n block is renamed to alreadyExistsModal (the dialog
does not rename anything), the description text is operation-neutral and
the apply-to-all label toggles the checkbox.
Skipping a colliding folder upload now keeps the existing folder and uploads only
the files and subfolders that do not exist yet, merging colliding subfolders
recursively so the folder structure is preserved.
Covers keep both for files and folders, replacing a folder, merging a
skipped folder into the existing one, replace, keep both and skip for
moved files, and versioned replace. The Drive mock now tracks folders,
folder creation, moves and a versioning flag; moves are driven by
dispatching the HTML5 drag events on the row's drop zone.
@terrerox
terrerox force-pushed the feat/skip-item-option-in-name-collision branch from c4b1f37 to c947fa0 Compare October 7, 2026 13:25
@terrerox
terrerox removed this pull request from stack #2151 October 7, 2026 13:28
terrerox and others added 6 commits October 7, 2026 10:04
…restore-e2e

[PB-6531]: e2e coverage for same-name restore collisions
…atch

[PB-6531]: resolve same-name items within a move collision batch
…ge-on-skip

[PB-6531]: merge folder uploads into the existing folder on skip
[PB-6531]: e2e coverage for the skip option in name collisions
@terrerox
terrerox merged commit afbfe83 into fix/name-collision-matching-and-batching Oct 7, 2026
1 of 3 checks passed
@terrerox
terrerox deleted the feat/skip-item-option-in-name-collision branch October 7, 2026 14:43
@sonarqubecloud

sonarqubecloud Bot commented Oct 7, 2026

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
C Reliability Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants