Give mixed selections something to do

A Drag of different kinds showed an empty wheel, because the catalog only
answers for a single category. Filee's answer is a mixed profile, so add
Zip (one archive, flat names) and Merge (non-PDFs are converted to PDF
first); a multi-file drag of one kind gets Zip too.
This commit is contained in:
2026-10-20 01:30:42 +08:00
parent 2d031e58a4
commit a01d5def89
8 changed files with 295 additions and 41 deletions
+16 -1
View File
@@ -9,7 +9,7 @@ drag machinery or the conversion catalog.
```bash
swift build # debug
swift build -c release
./.build/debug/Konverter --self-test # 41 checks, exits non-zero on failure
./.build/debug/Konverter --self-test # 46 checks, exits non-zero on failure
./.build/debug/Konverter --convert <files…> --to <ext>
./.build/debug/Konverter --convert <file> --tool <toolID> --param k=v
./build-app.sh <version> # → Konverter.app (signed)
@@ -119,6 +119,21 @@ maths, update those expectations rather than deleting them.
- Optional engines must always degrade, never crash: absence of ffmpeg or
LibreOffice should surface as an unavailable wheel item with a reason, and
`Toolchain.missingToolAdvice` supplies the `brew install …` line for the UI.
- **Mixed selections must never produce an empty wheel.** `WheelBuilder` falls
back to `ToolID.combineTools(for:)` (Zip, Merge) whenever a drag has no single
category, and appends Zip to every multi-file tools wheel. `mergePDF` converts
non-PDF inputs through `Converter.convert(_:to:.pdf)` into a temp folder, so
it accepts photos and documents, not just PDFs. If you add a tool that works
across kinds, add it to `combineTools` and cover it in the self-test.
## Reference material
Research on the apps this project is modelled on lives in an untracked
`.reference/` folder (`.reference/.gitignore` contains `*`, so nothing there is
ever committed). Currently: `tangerine.md` (the closed-source app we clone),
`filee.md` + a shallow clone of `KnifeLemon/Filee` (MIT, the open-source
sibling), and `README.md` indexing them. Read `filee.md` before designing a
feature that Filee already has — the "borrow next" list there is the roadmap.
## Build/bundle notes