Say when something is downloading, and where it goes

The webview saves the file perfectly well and mentions it to nobody,
which makes a download indistinguishable from a click that did nothing.
Each one is now announced in the corner as it saves, and offers to show
the finished file in the Finder. The folder is settable and defaults to
the system's Downloads.

Two gaps in the API shape this. There is no progress - DownloadEvent
reports a start and a finish and nothing between - so the destination
file is polled as it grows and the bytes written are shown; the indicator
spins rather than fills, because there is no total to divide by. And on
macOS the finish always reports no path at all, so the destination
assigned at request time is remembered against the URL and read back at
the end.

A name already taken gets "(2)" appended. Silently overwriting is the
last thing anyone wants from a download they were not told about.
This commit is contained in:
2026-09-02 10:42:45 +02:00
parent e1ac3d7509
commit 04b731cf37
20 changed files with 750 additions and 4 deletions
@@ -343,6 +343,26 @@ on a blocking worker rather than the calling thread — its completion handler r
main thread, and waiting for it *there* deadlocks until the timeout and returns nothing
every time.
## Downloads
The webview saves a file perfectly well and mentions it to nobody, which makes a download
indistinguishable from a click that did nothing. So each one is announced in the corner as
it saves, and offers to show the finished file in the Finder.
Two things the API does not give, and how each is handled:
- **No progress.** `DownloadEvent` reports a start and a finish and nothing between — no
byte count, no total. The destination is known, though, so the file is polled as it grows
and the bytes written are shown. There is no percentage because there is no total to
divide by, so the indicator spins rather than fills.
- **No path at the end.** On macOS `Finished` always reports `path: None`. The destination
assigned at `Requested` is therefore remembered against the URL, and read back when the
download finishes.
The folder is configurable and defaults to the system's Downloads. A name already taken
gets `(2)` appended, the way a browser does — silently overwriting is the last thing anyone
wants from a download they were not told about.
## Passwords
Submitting a form that contains a password offers to remember it, the way a browser does.