feat: delete control for done and failed entries #2

Merged
w33ble merged 5 commits from feat/delete-control into main 2026-09-06 19:13:54 -06:00
Collaborator

What

A delete control on the main page's episode list — remove Episodes you no longer want, along with their audio files.

Behavior

  • Control appears on done and failed entries only; queued/processing rows render no form, and direct POSTs against them 404
  • One click + inline confirm('Delete this episode?') — same no-framework precedent as the polling script
  • POST /entries/<public_id>/delete → 303 back to /; behind UI basic auth; malformed/unknown ids → 404; GET → 405
  • Done: store.DeleteEntry removes episode + job rows in one transaction and returns the audio path; the handler os.Removes it (best-effort — the row is the contract)
  • True removal: re-capturing the same Source after delete creates a fresh Episode (dedupe matches live rows only); the feed item vanishes on next render

Tests

10 new seam tests in internal/server/delete_test.go (file+rows+feed removal, failed delete, queued/processing rejection, missing/malformed ids, auth, 405, form rendering, re-capture-after-delete). mise run check + mise run test green; runtime smoke with fake runner verified file/feed/page cleanup and restart-safety.

Closes MCAST-14.

## What A delete control on the main page's episode list — remove Episodes you no longer want, along with their audio files. ## Behavior - Control appears on **done** and **failed** entries only; queued/processing rows render no form, and direct POSTs against them 404 - One click + inline `confirm('Delete this episode?')` — same no-framework precedent as the polling script - `POST /entries/<public_id>/delete` → 303 back to `/`; behind UI basic auth; malformed/unknown ids → 404; GET → 405 - Done: `store.DeleteEntry` removes episode + job rows in one transaction and returns the audio path; the handler `os.Remove`s it (best-effort — the row is the contract) - True removal: re-capturing the same Source after delete creates a fresh Episode (dedupe matches live rows only); the feed item vanishes on next render ## Tests 10 new seam tests in `internal/server/delete_test.go` (file+rows+feed removal, failed delete, queued/processing rejection, missing/malformed ids, auth, 405, form rendering, re-capture-after-delete). `mise run check` + `mise run test` green; runtime smoke with fake runner verified file/feed/page cleanup and restart-safety. Closes MCAST-14.
Add store.DeleteEntry (single tx, deletes episode row before job row to honor the FK direction; refuses queued/processing) and POST /entries/<public_id>/delete. Route follows the UI auth surface, redirects to / on success, 404s on missing id, queued/processing, or malformed path. Audio file removal is best-effort — the caller-facing row is the contract; a stray file is recoverable and logged.
Render a small ghost Delete form on done and failed rows only, gated by an inline confirm(). Queued/processing rows deliberately omit it (the route returns 404 anyway — the UI contract is that those rows have no affordance). CSS keeps the resting state muted and reveals --danger on hover/focus; failed rows tint the resting state to mirror the danger rail.
test: cover delete control behavior
All checks were successful
ci / check (pull_request) Successful in 4m3s
c15bae3357
Drive the seam through httptest: done-delete removes file + rows + feed item; failed-delete removes the row (no file to remove); queued/processing entries have no form and POSTing their id 404s; missing/malformed ids 404; auth required; GET returns 405 with Allow: POST; page renders the form only on done + failed rows. Re-capturing the same Source after a delete creates a fresh Episode (dedupe matches live rows only).
docs: clarify MEDIACAST_ARTWORK path semantics
All checks were successful
ci / check (pull_request) Successful in 54s
808c58690e
docs: MEDIACAST_ARTWORK accepts any container-readable path
All checks were successful
ci / check (pull_request) Successful in 46s
d68f25d0ef
w33ble approved these changes 2026-09-06 19:13:37 -06:00
w33ble merged commit d125f6d198 into main 2026-09-06 19:13:54 -06:00
w33ble deleted branch feat/delete-control 2026-09-06 19:13:54 -06:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
w33ble/mediacast!2
No description provided.