feat: add dialog for existing file names during copy/paste - #708
Conversation
Merge BlockerHiding Skip whenever only one name collision remains makes Cancel the only way to decline that item. Cancel still aborts the whole transfer, including already-accepted non-conflicting files and earlier conflict choices. So a mixed paste (several files, one name conflict) or the last remaining conflict after Keep Both cannot skip the conflict without dropping the rest of the batch. New tests currently encode the missing Skip as intended. Fix: keep Skip visible whenever Cancel would drop already-accepted work ( Review: lgse/strata PR #708Title: feat: add dialog for existing file names during copy/paste 1. What the change does (vs PR claims)The PR claims: show a conflict dialog on copy/paste (and Duplicate) when the destination already has that name, instead of silently creating That is accurate for the same-folder path, and it is a small production change wrapped in a lot of tests:
Cross-folder Keep Both / Replace / Cancel already existed on 2. BLOCKER — Skip hidden when Cancel is not equivalentSeverity: correctness / data-loss-of-the-paste (not disk corruption)
Non-conflicting items are already in Cancel / Escape / X dismiss the modal and do not call
Issue #391 already defined this: X/Cancel/Escape abandon the whole batch, including earlier choices. Skip is the “continue without this item” action. This PR removes Skip exactly when that distinction matters. The new tests assert the regression:
Same Visual proof (mixed paste, 3 files, 1 conflict)Copied Clicked Cancel. Destination still only contains original Fix: keep Skip visible whenever Cancel would drop work ( 3. High — same-folder / Duplicate uses a danger Replace dialog whose Replace is a no-opWhere: Same-folder paste and Ctrl+D now open the same “File already exists” dialog as a cross-folder overwrite. Replace is focused, danger-styled, and the body says “Replacing it will overwrite its contents.” For a same-directory copy, Replace does not overwrite; it no-ops (good for not deleting the file, bad as default). Enter / clicking Replace on Duplicate or same-folder paste does nothing. Keep Both is the actual duplicate action. This fights closed #270 (“Prompting a replacement dialog is destructive and undesirable for duplicate workflows”) even though it matches this PR’s stated test plan. Keep Both does create Product choice William should make: either (a) Duplicate / same-folder copy skip the dialog and Keep Both automatically, or (b) keep the prompt but default Keep Both, drop Danger/overwrite copy for self-collisions, and do not focus Replace. The adapter no-op itself is the right safety net if Replace stays offered. 4. Non-blockingApply to All in the action bar. Label shortened from “Apply this choice to all remaining conflicts”; widget prepended to Layout is usable (checkbox left, buttons right). The old body sentence was clearer. E2E Drive-by naming tests. Hidden-file / Process. No Theme test. 5. Security / safetyNo high-confidence vulnerability.
6. Focus-area notesOverwrite vs Keep Both vs Cancel. Cross-folder Replace still overwrites; Keep Both still uses Same-folder vs cross-folder. Policy is now “always prompt,” which is consistent in the sense that both paths use one dialog, inconsistent in Replace semantics (overwrite vs no-op) and with Duplicate. Multi-file paste. Non-conflicts are queued first, then collisions one-by-one. Apply to All Keep Both still works (existing E2E). Skip-on-last / Skip-on-only-collision is the hole. Listing refresh. Detection is disk Consistency with existing Keep Both UX. Keep Both still hidden for moves; still numbered 7. Test coverage gaps vs claimed behaviorClaimed: Skip / Apply to All / Cancel “behave correctly” for multiple conflicts. Missing / inverted:
What they did add is useful for the happy path: same-folder dialog appears; Skip shown when two collisions exist; same-folder Replace no-op and Keep Both at the adapter; E2E same-folder copy now clicks Keep Both. 8. What looks solid
9. Recommendation on landingDo not land until Skip is restored whenever Cancel would drop already-accepted items (mixed paste and last remaining conflict, including undo collisions), and the tests that currently require Skip to be hidden in those cases are inverted. Treat same-folder / Duplicate defaulting to danger Replace (no-op, “will overwrite”) as a product decision: keep a prompt only if Keep Both is the default and the copy matches self-collision. Otherwise Duplicate should stay a silent numbered copy. After that, rebase onto Suggested GitHub review when you post one: Request changes, with the Skip/Cancel mixed-paste issue as the required fix. |
|
Addressed the review feedback in latest commit Restored Skip whenever Cancel would discard already accepted work, including mixed pastes and the final remaining conflict. |
Use ViewState transfer dispatch and wait for copied contents before assertions. Remove redundant commentary from the self-replace guard.
|
Reviewed and pushed through
Local pinned rootless-Podman verification: GUI verification used real pointer/keyboard E2E on private Xvfb/D-Bus, including mixed-paste Skip, Keep Both, same-folder duplicates, replacement, cancellation, and undo; no separate manual desktop session was used. Review fixes do not change UI appearance. E2E captures are local under Approved the fork workflow run for this head; CI passed. No remaining review blockers found. The pull request has not been merged. |
|
Guided desktop verification with the owner passed all six staged scenarios on |



Description
Refine the existing copy/paste conflict dialog: show Skip whenever cancelling would discard other accepted items, and show Apply to All in the action row only when further conflicts remain. Keep same-folder paste and Duplicate as silent numbered copies. Explicit self-replacement is a safe no-op.
Visual evidence
Original author attachment (before the follow-up restored silent same-folder duplication):
How to test
Expected result: Conflict choices preserve accepted work; cancellation changes nothing; same-folder duplicates remain non-destructive and do not prompt.
Related issue
Related to #395 and #270 (already closed); this is a follow-up, not a new resolution of those issues.