Files
b24238a7d6 Download one app at a time, in the order they're shown (#403)
* feat(install): download one app at a time, in screen order

Downloads running side by side split the connection and each one crawls.
Apps now take turns: a download asked for while another is running waits
(shown as "Waiting for another download…", cancellable), and waiting
downloads start in the order the apps are listed on screen, following the
current sort. A download already finished on an earlier try skips the line,
and the next download starts as soon as the previous one is verified, while
that app installs.

- native: new `downloads::Downloads` queue (`install::DOWNLOADS`)
- protocol: `JobPhase::Queued`, `Command::DownloadOrder`
- ui: sends the sorted app order when it changes; new string in every catalog

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* feat(install): queue apps hidden by a filter or search in suite order

Only the apps on screen are sent as the download order; the queue puts any
other waiting app after them, in suite order, instead of by its place in the
current sort. Tests cover a hidden app, a search, and the queue's fallback.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* feat(install): let users choose how many downloads run at once

A "Simultaneous downloads" setting (1 to 4, default 1) in Settings > Updates,
sent in BackendOptions next to prereleases. The download queue counts running
downloads against it instead of allowing one: raising it starts waiting
downloads at once, lowering it lets running ones finish. Settings saved before
it existed allow one.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(install): take a place in the download line when a job starts

Jobs joined the line only on reaching their download, so with nothing
downloading the first to get there started, even below others on screen: an
Update all batch started in suite order. start_job now takes the job's place
(Downloads::join) before its thread runs, and places not yet at their download
count when choosing who goes next. A place dropped before its turn (the job
failed, was stopped or found its file already downloaded) leaves the line.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* docs(install): document the functions the download queue touches

CodeRabbit's docstring coverage check was at 38% of the functions in the diff.
Doc comments on the queue, its tests, and the backend and UI functions that
changed. No code changes.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* test(install): give the platform-gated test jobs a place in line

Two Job literals in tests that only build on Linux and Windows
(a_downgrade_refuses_anything_but_an_msi_over_an_msi_install and
a_mac_downgrade_goes_ahead_without_a_package_to_put_back) were missing the new
place field, so the native tests didn't compile there.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* fix(install): give the Windows MSI test a place in line, align the queued wording

The Windows-only integration test built a Job without the new place
field. The compact launcher-update row said "Waiting for other installs…"
for a queued download; it now matches the detail row.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* feat(install): let users turn the download limit off

"No limit" in Settings → Updates lets every download run at once, as the
launcher did before. The default stays at one.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* fix(install): keep the download queue building after the rebase onto main

Main grew new Job fields, two more UI catalogs (zh-TW, ka) and a settings
test that picked the nearest combo box. The test Job literal and both
catalogs get what the queue added, and the test now finds the install-format
chooser by its label, since the downloads dropdown sits closer to it.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MS5Qb6riBMzoujge5GuGZF

* fix(install): join the whole batch to the download line before any worker starts

An "Update all" started each worker right after joining the line, so the
first worker could take a free slot before a row above it had joined.
install_all now prepares every job first and starts the workers after.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MS5Qb6riBMzoujge5GuGZF

* test(install): check the batch path itself takes every place before a worker starts

The test called prepare_job directly, so putting install_all back to
starting each job as it is prepared would still have passed. The backend
now runs workers through a spawn function a test can replace; the test
holds the workers and checks, at each start, that all apps are in line.
Reverting install_all makes it fail.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MS5Qb6riBMzoujge5GuGZF

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: launcher-403-review <review@local>
2026-11-14 23:03:07 -06:00
..