Commit a3faa3d
committed
File ops: Redesign type-mismatch conflict dialog
Rebuild the conflict dialog on top of the original file→file shape (filename, "Existing:" / "New:" rows, the 4×2 button grid, the bottom Rollback row) so every clash type reads the same way. The variants only differ where the spec actually wants them to:
- File→file and folder→folder stay baseline.
- Folder→file: row labels switch to `Existing (file):` and `New (folder):`; no warning, `Overwrite` label unchanged.
- File→folder: row labels switch to `Existing (folder):` and `New (file):`; a red `role="alert"` block sits below the title and above the filename, calling out that the entire target folder would be deleted; `Overwrite` becomes `Overwrite folder with file`, `Overwrite all` becomes `Overwrite folders with files`. When `destinationSize === null`, the Existing-size slot renders `(unknown)` in muted color and `Overwrite all smaller` disables (with a tooltip) since there's no folder size to compare against. `Overwrite all older` always stays enabled — mtime is always available.
Wire-shape: `WriteConflictEvent.destinationSize` and `sizeDifference` shift to `number | null` to match the BE event the index-backed dir-size lookup now emits. The hand-maintained shim in `apps/desktop/src/lib/file-explorer/types.ts` is the only place this needs to land; `bindings.ts` doesn't carry this type.
Drop the agent's earlier "Currently / Incoming" cards + danger-styled "Replace folder" / "Replace file" buttons and their CSS (`.mismatch-cards`, `.mismatch-card*`, `.conflict-lede`) — they forked the layout where the spec wants one consistent shape.
Test coverage: `TransferProgressDialog.conflict.test.ts` walks a `describe.each`-driven matrix over the four clash types plus a known-size / null-size axis for the file→folder case, mounts the dialog component directly, captures the `onWriteConflict` callback from the mock, and asserts row labels, button copy, warning markup, disabled state, and one axe-core run per variant. 32 tests, ≈25 ms each in jsdom.1 parent d2b8f15 commit a3faa3d
3 files changed
Lines changed: 357 additions & 349 deletions
File tree
- apps/desktop/src/lib
- file-explorer
- file-operations/transfer
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
554 | 554 | | |
555 | 555 | | |
556 | 556 | | |
557 | | - | |
| 557 | + | |
558 | 558 | | |
559 | | - | |
560 | | - | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
561 | 563 | | |
562 | 564 | | |
563 | 565 | | |
564 | 566 | | |
565 | 567 | | |
566 | 568 | | |
567 | | - | |
568 | | - | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
569 | 572 | | |
570 | 573 | | |
571 | 574 | | |
| |||
0 commit comments