Thanks to visit codestin.com
Credit goes to github.com

Skip to content

fix(browser): offer keep-both for cross-folder paste conflicts - #599

Merged
l0gicgate merged 6 commits into
lgse:mainfrom
spandan11106:fix/395-unify-paste-collision-policy
Sep 8, 2026
Merged

fix(browser): offer keep-both for cross-folder paste conflicts#599
l0gicgate merged 6 commits into
lgse:mainfrom
spandan11106:fix/395-unify-paste-collision-policy

Conversation

@spandan11106

Copy link
Copy Markdown
Collaborator

Description

Same-folder copy paste silently generates a unique name (name (1).ext) on a collision and never prompts, while cross-folder paste only offers Replace/Skip/Cancel with no way to keep both copies. This adds a KeepBoth conflict option, reusing the existing unique-name generation logic, and surfaces it as a "Keep Both" button in the cross-folder conflict dialog for copy paste.

Move operations (cut/paste, drag-move) keep their prior Replace/Skip/Cancel behavior only — Keep Both is not offered there, because undo and post-move reveal currently assume a move never renames its destination; offering it there would need separate follow-up work to carry the renamed target through undo/reveal tracking.

Visual evidence

N/A from me directly — this only adds one new button ("Keep Both") to the existing "File already exists" conflict dialog, no other layout changes. I don't have a way to capture a screenshot from this environment; happy to attach one if needed.

How to test

  1. Create two folders with a same-named, differently-contented file, e.g. source/report.txt and dest/report.txt.
  2. Copy report.txt from source/ and paste into source/ again.
  3. Copy report.txt from source/, navigate to dest/, and paste.
  4. Cut report.txt from source/ (Ctrl+X), navigate to dest/, and paste.

Expected result:

  • Step 2 (same-folder copy): unchanged — report (1).txt is created silently, no dialog.
  • Step 3 (cross-folder copy): the conflict dialog now offers Skip / Keep Both / Replace / Cancel. Choosing Keep Both creates report (1).txt in dest/ without touching the existing file.
  • Step 4 (cross-folder move): the conflict dialog offers only Skip / Replace / Cancel, same as before — Keep Both is not shown for moves.
  • Cancel/Escape/the dialog's close button never modify any file, for either dialog.

Related issue

Closes #395

Same-folder copy paste silently generated a unique name on collision
while cross-folder paste only offered Replace/Skip, so users had no
way to keep both copies when pasting across folders. Add a KeepBoth
TransferConflict variant that reuses the existing unique-name
generation, and surface it as a "Keep Both" option in the conflict
dialog for copy paste only (moves keep their prior Replace/Skip
behavior, since undo and post-move reveal assume a move never renames
its target).

Closes lgse#395
@spandan11106

Copy link
Copy Markdown
Collaborator Author
image

Enter must not choose Replace when Keep Both has keyboard focus. Cover numbered-copy selection and undo, mixed conflict choices, and cancellation with real GUI interactions.
@l0gicgate

Copy link
Copy Markdown
Contributor

Merged main (c62354f) and fixed two review blockers:

  • Enter now activates the focused conflict action instead of always choosing Replace—even when Keep Both was focused.
  • Keep Both no longer bypasses the backend's self/descendant-transfer no-op guard.

Added regression coverage for keyboard/pointer Keep Both, numbered-copy selection and undo, mixed apply-to-all pastes, and copy/move cancellation. Audited every added comment and removed or tightened redundant prose.

Exercised the real GTK application on isolated Xvfb: Shift+Tab to Keep Both, then Enter creates and selects the numbered copy without changing the existing file. Pointer activation, undo, and Cancel/Escape/close also preserve the expected files.

GitHub still requires approval from someone other than the last pusher.

Captured current dialog/result screenshots, but this session has no GitHub attachment-upload tooling; these files were not uploaded:

  • /tmp/strata-599-review-media/keep-both-keyboard-focus.png
  • /tmp/strata-599-review-media/keep-both-result.png

@l0gicgate
l0gicgate merged commit dadea0d into lgse:main Sep 8, 2026
6 checks passed
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.

fix(file-operations): unify same-folder and cross-folder paste

2 participants