Skip to content

feat: move a queued download up or down the queue - #288

Open
Manan1511 wants to merge 2 commits into
anmolkapil:mainfrom
Manan1511:main
Open

Manan1511 wants to merge 2 commits into
anmolkapil:mainfrom
Manan1511:main

Conversation

@Manan1511

@Manan1511 Manan1511 commented Nov 19, 2026 •

Copy link
Copy Markdown

What and why

Fixes #197.

A queued download's right-click menu (and the selection toolbar's More menu) now offers Move up and Move down, so you can change which download starts next without removing and re-adding anything. The updated order decides which one starts when a place is free.

  • It swaps the download's place with its neighbour's in the queue. Like Start next (feat: Start next moves a queued download to the front of the queue #275), it only reorders the waiting: nothing running is paused, downloadsAtOnce still holds, and the new order is saved right away so it survives a restart. At either end of the queue it does nothing.
  • It's built on the same path as Start next: a moveInQueue IPC channel, then DownloadManager.moveInQueue, which checks it was asked for one place either way. The "queued, in start order" sort that pump() used is now a small helper (queuedInOrder) shared with it. The two actions go through the shared actions list, so the menu, toolbar and a download's own screen agree.
  • Offered for one queued download at a time. With several selected, "move up" has no clear meaning, so it isn't shown.
  • I chose up/down controls over drag-and-drop because they fit the existing actions without a new dependency. Happy to add dragging in a follow-up if you'd like it.
  • Known small gap: Move up still shows on the first queued download (and Move down on the last), where it does nothing, because the actions list only sees one download at a time.

How I tested it

Windows 11, Plexo built from this branch.

  • npm run lint (0 errors), npm run typecheck, and Prettier on the changed files.
  • New e2e/moveInQueue.spec.ts drives the real app through the right-click menu with downloadsAtOnce: 1 and three local downloads: Move up and Move down change the order shown, doing it at either end changes nothing, the running download isn't paused, and the one moved to the front is the next to start once the running download finishes. It passes.
  • A new test in e2e/scheduleQueue.spec.ts: with the schedule closed, Move down reorders three waiting downloads, the app is killed and relaunched, and the new order still decides which starts first when the window opens. It shares a helper with the existing Start next restart test.
  • e2e/downloadActions.spec.ts updated for the new actions (queued only, one at a time, under More on the toolbar), plus the existing startNext.spec.ts. All pass.
  • npm run test:e2e:smoke: 165 passed, 13 skipped, 1 failed. The failure is ui.spec.ts "minimum window keeps download controls and a network row in view", which fails the same way on a clean main on my machine.
  • By hand in the running app (npm run dev) with one download running and two torrents queued: Move up and Move down from the right-click menu change the order shown (screenshots below). Not tried on macOS or Linux.

Right-clicking a queued download shows the new Move up and Move down entries. With one download running and two queued, Move down on the first queued one (arm64) puts the 24.04 download ahead of it:

Before After Move down
The menu on the first queued download, with Move up and Move down The two queued downloads in the new order

Manan1511 and others added 2 commits November 20, 2026 00:05
A queued download's menu (and the selection's More menu) offers Move up and
Move down, which swap its place in line with its neighbour's. Like Start next,
it only reorders the waiting: nothing running is paused, downloadsAtOnce still
holds, and the new order is saved right away so it survives a restart. At the
ends of the queue there's nowhere to go.

Refs anmolkapil#197

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The queued downloads in the order they start are now one helper that pump and
moveInQueue both use. moveInQueue refuses anything but one place either way,
since it arrives over IPC. A scheduled queue reordered by Move down keeps that
order through a crash and restart.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allow reordering queued downloads

1 participant