Skip to content

feat(presets): add Copy to folder tools on the back face - #814

Merged
KnifeLemon merged 4 commits into
KnifeLemon:mainfrom
1644ye:codex/upstream-browser-downloads
Oct 30, 2026
Merged

KnifeLemon merged 4 commits into
KnifeLemon:mainfrom
1644ye:codex/upstream-browser-downloads

Conversation

@1644ye

@1644ye 1644ye commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

Add a user-created Copy to folder preset: browser originals, local files and batches of files/folders are copied byte for byte. Local originals are never moved or replaced. No slices are added to the default donuts.

The preset editor reuses the existing fixed output folder and Ask every time choices. A single file can be renamed in the existing save dialog; batches/folders use the folder picker. Cancelling creates no job. The former Download settings and built-in Download slice have been removed from this PR.

  • A collision adds a number, including when a save-dialog path already exists; nothing is overwritten.
  • A missing or unwritable destination fails with a message without creating the destination. Copying into the source's current folder does nothing.
  • Folder structure and empty folders are preserved. Copying a folder into itself/its descendants is rejected.
  • Copies are published only after writing finishes. Watched destinations then process the completed files, including files in an arriving folder when subfolder watching is enabled.
  • Folder presets belong to the back face, accept every file type and can be placed in a group slice. The toolbar editor provides creation and prevents placing folder presets/groups on the front face.

Closes #821. Reuses #521 and follows #806.

Validation on Windows / .NET 10, based on upstream 7fc129f:

  • dotnet format Filee.slnx --no-restore --verify-no-changes: passed.
  • All six test projects passed: App 1,635; Cli 55; Core 758; Engines 1,942; Platform 94; Setup 206 (4,690 passed, zero failures in the final project runs).
  • Regression group: 48 passed, zero skipped. It includes the real browser drop -> back-face folder slice -> byte comparison, cancellation before fetching/enqueueing, preset editor/groups and the existing shared-window tests.
  • Core tests cover byte identity for a browser download, untouched local originals, numbered clashes, missing destination without creation, same-folder no-op, batches/folder structure, cancellation cleanup and watched-folder delivery.

The initial full run exposed an existing test cleanup bug: the random tray-click test retained simulated click flags and reopened the main window while cleaning up, causing five later tests to fail. A minimal combination reproduced it. Commit 099adb5 clears those flags only in the test's cleanup and asserts the window is gone; it does not change production window behavior. The complete App project was then rerun successfully with normal collection parallelism.

App/engine tests used isolated FILEE_DATA_DIR; Setup was rerun without that override because it asserts real default paths. Optional-engine/OS-specific/Explorer-package/symlink tests and the intentionally disabled upstream media-generation test remain skipped; none are counted as passed. Directory symlinks/reparse points fail explicitly rather than being followed during folder copying.

Screenshots rendered from the actual Avalonia views in the UI tests:

Preset editor

Folder group on the back face

Chinese screenshots and validation details.

@github-actions github-actions Bot added the feature New features label Oct 30, 2026
@KnifeLemon

Copy link
Copy Markdown
Owner

Thanks, @1644ye! Saving a browser drop's original bytes without converting overlaps with things Filee already has:

Adding a separate Download action with its own location settings needs a design decision first. Please open an issue with:

  • the case that today's options don't cover;
  • how you see it fitting next to Ask every time.

New features start with an issue so we agree on the shape before the code. I'll keep this draft open until then.

@1644ye

1644ye commented Oct 30, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for the scope feedback. I opened #821 with the concrete workflow, existing behavior, and the smaller integration options for discussion. This PR will remain draft while we agree on the requirement and scope.

@1644ye 1644ye changed the title feat(download): save browser originals with configurable locations feat(presets): add Copy to folder tools on the back face Oct 30, 2026
@1644ye

1644ye commented Oct 30, 2026

Copy link
Copy Markdown
Contributor Author

Reworked to the agreed scope in 099adb5 (feature implementation 1b9367e).

This is now a user-created Copy to folder preset on the back face, including groups and every file type. It copies browser originals, local files and folders without moving sources, reuses the existing fixed-folder / Ask every time UI, numbers clashes, fails missing destinations without creating them, and lets watched destinations process complete copies. The separate Download settings and default Download slice are gone.

dotnet format --verify-no-changes passed. All six test projects passed (4,690 passed across the final project runs), and the combined regression group passed all 48 cases. The description explains conditional skips, Setup's required default paths, and the separately committed test-cleanup correction found by the full run.

Editor and grouped-folder screenshots are in the updated PR description and review evidence. Marking ready for your CI approval.

@1644ye
1644ye marked this pull request as ready for review October 30, 2026 13:27
@1644ye
1644ye requested a review from KnifeLemon as a code owner October 30, 2026 13:27

@KnifeLemon KnifeLemon left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Thanks @1644ye, this is exactly the scope we agreed in #821. The PR is clean and well tested.

What I checked:

  • FolderCopy.CopyAsync: the copy goes to .filee-copy-….tmp inside the destination first, then moves into place with overwrite: false.
    • Watchers never see half-written files (IsWorkPath).
    • A clash just tries the next number.
    • The finally only removes this run's stage, never the source or a published result.
  • Folders:
    • copying a folder into itself or a subfolder is refused;
    • linked directories are refused instead of followed;
    • empty folders are kept.
  • Same folder returns null → Skipped, and a missing destination throws before anything is created.
  • IsCropTool now checks Kind == PresetKind.Tool, so a copy preset can't fall into the crop path. Good catch.
  • Tests cover the cases we listed, including the real browser drop → byte comparison. CI is green on all platforms.

Two small things, neither blocking. They'd fit a follow-up if you like:

  1. Error text: a missing destination shows error.conversion_failed with the English exception message as detail. A key of its own (for example error.copy_destination_missing) would read better in the other 18 languages.
  2. Downgrades: a settings file with a CopyToFolder preset makes an older Filee fail to read that preset's kind. That's acceptable for a new feature, but worth a line in the CHANGELOG entry when it ships.

Approving and merging.

@KnifeLemon
KnifeLemon merged commit 35679f5 into KnifeLemon:main Oct 30, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature New features

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: Discuss keeping original browser-drop bytes without a conversion

2 participants