Skip to content

Control downloads and show history in the web interface - #23

Merged
combor merged 4 commits into
mainfrom
queue-history
Sep 30, 2026
Merged

combor merged 4 commits into
mainfrom
queue-history

Conversation

@combor

@combor combor commented Sep 30, 2026 •

Copy link
Copy Markdown
Owner

Adds download controls to the queue page and a new History page.

  • Queue: pause or resume the queue or a job, and remove a job after confirming. Removing the running download stops it.
  • History: finished and failed downloads, newest first. Removing one can also delete its folder.
  • The queue refreshes every second, history every five seconds.
  • Queue.Cancel removes only unfinished jobs, so a download that finishes as it is removed stays for import.

Controls are plain forms: htmx swaps in the new state, and without JavaScript they redirect back. Confirmations use the Popover API, which needs no script and stays open through the morphing refresh. Actions queue behind refreshes instead of cancelling them: the bundled htmx releases its queue when a cancelled request ends. Resumed downloads still restart from the beginning.

Tested: make test; Playwright screenshots of every state in light and dark at desktop and phone widths, with an axe audit; browser checks of each action, refreshes with a confirmation open, file deletion, API pauses, no-JavaScript forms, failure notices and request order on a slow link; the real binary with a job added through mode=addfile; Codex review.

Queue.Cancel deletes a job only while it is queued or downloading. A
download that finishes as someone cancels it then stays in history for
Sonarr or Radarr to import, instead of disappearing with its folder left
behind. HistoryRetention is exported so the web interface can say how
long finished jobs are kept.
The queue page can now pause and resume the whole queue or a single job,
and remove a job after asking first. A new history page lists finished
and failed downloads, newest first. Removing one from history can also
delete its folder, and the confirmation shows which folder that is. The
queue refreshes every second and history every five seconds.

Every control is a plain form. htmx swaps in the page's new state at
once, and without JavaScript the form returns to the page. Confirmations
use the Popover API, which needs no script and keeps its open state, and
a ticked box, through each refresh. A dialog's open attribute would be
cleared by the morph instead. An action cancels a refresh already under
way, so a refresh can't bring back the old state. If saving fails, a
notice appears outside the refreshing part of the page, so the next
refresh doesn't erase it.

A download being paused is shown in the list at once rather than as
still running. Removing from the queue uses Queue.Cancel, so a download
that finishes at that moment stays in history to be imported.
htmx focuses the first autofocus element after every swap, so the first
confirmation on the page pulled focus back to Keep every second. A
keyboard user who tabbed to Remove could then dismiss the confirmation
instead. The confirmations no longer autofocus: focus stays on the
remove button, and Tab moves into the confirmation.

A failed removal showed its notice at the bottom of the page. On phones,
the open confirmation covered it. The notice now appears inside the
confirmation, and refreshes leave it there until the confirmation is
closed.

Actions no longer cancel each other or a refresh under way. The bundled
htmx frees its request queue when a cancelled request ends, even though
the request that replaced it is still running, so later requests could
overlap and land out of order. Actions now wait in the same queue as the
refreshes, so responses arrive in the order they were requested.
@combor
combor merged commit 2694f4c into main Sep 30, 2026
5 checks passed
@combor
combor deleted the queue-history branch September 30, 2026 23:35
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.

1 participant