Skip to content

Manage overrides in the web interface - #25

Merged
combor merged 2 commits into
mainfrom
override-forms
Oct 1, 2026
Merged

combor merged 2 commits into
mainfrom
override-forms

Conversation

@combor

@combor combor commented Oct 1, 2026

Copy link
Copy Markdown
Owner

Adds an Overrides page to the web interface, so corrections to matching no longer need curl.

  • List: each site's overrides, with what each one changes, and buttons to add one for a series or a film, edit or remove it.
  • Series form: TVDB ID, titles to search, the site's ID or page address, season rules and pinned episodes.
  • Film form: Radarr's title and year, titles to search, and the ID or page address.
  • Errors: a form that can't be saved comes back with each message beside its field and focus on the first one.
  • Adding an override for a series or film that already has one is refused with a link to it. The API's PUT still replaces.

Titles, rules and pins are rows whose Add and Remove buttons submit the form, which comes back changed but unsaved, so there is no new script and the forms work without JavaScript. The form checks what the store can't see (numbers, half-filled rows, an episode pinned twice); the store's refusals follow, placed by the new InvalidError.Field. The API's messages are unchanged.

htmx focuses the first autofocus input after every swap, so a form's page refreshes only its header, from a new GET /ui/topbar, and leaves what is typed alone. Tab counts on a form's page stay as they were when it loaded.

Tested: make test; Playwright checks in Chromium of adding and removing rows, focus after each, inline errors, saving with Enter, the duplicate refusal, editing, removing from the list and from the form, a film title with a slash, and that the header refresh leaves the form and focus alone; screenshots of the list, both forms, errors and confirmations in light and dark at desktop and phone widths; the real binary by hand; Codex review.

combor added 2 commits October 1, 2026 14:04
InvalidError gains a Field: titles, id, seasons, episodes, or a film's
title or year, and none if the override as a whole is at fault. Reason
gives the message without the field's name. The web interface's forms
use both to show a refusal beside the input it is about. The API's
messages are unchanged.
A new Overrides page lists each site's overrides, with forms to add,
change and remove them for series and films. A series' form has its
titles to search, the site's ID or page address, season rules and
pinned episodes; a film's has Radarr's title and year, titles and the
ID.

Titles, rules and pins are rows of inputs. Their Add and Remove buttons
submit the form, which comes back changed but unsaved, so no script is
needed. A hidden first submit button keeps Enter saving rather than
adding a row.

A form that can't be saved comes back with status 422 and each message
beside its field, and focus goes to the first one. The form checks what
the store can't see: numbers that aren't numbers, half-filled rows, an
episode pinned twice. The store's refusals follow. Adding an override
for a series or film that has one is refused with a link to it, where
the API's PUT would replace it.

htmx focuses the first autofocus input after every swap, so a form's
page refreshes only its header, from the new /ui/topbar, and leaves
what is typed alone. Saving returns to the list at the saved row, which
is highlighted.
@combor
combor merged commit beac009 into main Oct 1, 2026
5 checks passed
@combor
combor deleted the override-forms branch October 1, 2026 13:05
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