webui: mark songs with hand edits in the queue and REBUILD ALL FROM… #32

Merged
branderson merged 1 commits from edited-marks into main 2026-10-14 23:28:28 -07:00
Collaborator

Summary generated by LLM agent

Edits survive every rebuild since #29, but nothing in the UI said which songs had them. This marks them where it matters: in the queue, and in REBUILD ALL FROM… before anything is rebuilt.

API

GET /api/jobs and GET /api/rebuild-all now include edited_lines and stale_edits for each song, read from its edits.json. Only the job that currently stands for the song carries them. Edits belong to the song as it is now, so the runs it replaced would otherwise claim the same edits twice. The job list is polled every 3s, and this adds one small file read per current song per poll.

UI

  • Queue cards: a badge beside the artist: ✎ N in aqua for edited lines, ⚠ N in amber for edits set aside because their lyrics changed. Hovering spells it out, and screen readers get the same text.
  • REBUILD ALL FROM…: each song's row adds "N edited lines kept" and, if any, "N set aside". The intro now says lines edited by hand are kept.

Independent of #30/#31: it touches the queue and the dialog, not the sheet, so it targets main.

Testing

  • New tests: counts appear after an edit; they move to the rerun job, leaving the replaced run at zero; the REBUILD ALL FROM… candidates carry them; set-aside edits are counted.
  • Checked in Chromium on a seeded server with an edited song that also has a set-aside edit, its older run, and an unedited song. Only the current edited card shows ✎ 1 ⚠ 1. The dialog row reads "1 edited line kept · 1 set aside", and the unedited song shows neither. No script errors.
  • Full suite passes, except test_version (needs the package installed).
**Summary generated by LLM agent** Edits survive every rebuild since #29, but nothing in the UI said which songs had them. This marks them where it matters: in the queue, and in REBUILD ALL FROM… before anything is rebuilt. ## API `GET /api/jobs` and `GET /api/rebuild-all` now include `edited_lines` and `stale_edits` for each song, read from its `edits.json`. Only the job that currently stands for the song carries them. Edits belong to the song as it is now, so the runs it replaced would otherwise claim the same edits twice. The job list is polled every 3s, and this adds one small file read per current song per poll. ## UI - **Queue cards:** a badge beside the artist: `✎ N` in aqua for edited lines, `⚠ N` in amber for edits set aside because their lyrics changed. Hovering spells it out, and screen readers get the same text. - **REBUILD ALL FROM…:** each song's row adds "N edited lines kept" and, if any, "N set aside". The intro now says lines edited by hand are kept. Independent of #30/#31: it touches the queue and the dialog, not the sheet, so it targets `main`. ## Testing - New tests: counts appear after an edit; they move to the rerun job, leaving the replaced run at zero; the REBUILD ALL FROM… candidates carry them; set-aside edits are counted. - Checked in Chromium on a seeded server with an edited song that also has a set-aside edit, its older run, and an unedited song. Only the current edited card shows `✎ 1 ⚠ 1`. The dialog row reads "1 edited line kept · 1 set aside", and the unedited song shows neither. No script errors. - Full suite passes, except `test_version` (needs the package installed).
dejima-agent added 1 commit 2026-10-12 19:04:03 -07:00
webui: mark songs with hand edits in the queue and REBUILD ALL FROM…
tests / test (pull_request_target) Successful in 4m14s
2c96f53a4b
A song's edits are kept through any rebuild, but nothing said which songs
had them. GET /api/jobs and GET /api/rebuild-all now report each song's
edited and set-aside lines, read from its edits file, on the job standing
for the song only, since the runs it replaced would claim the same edits.
Queue cards show them as a badge, and the rebuild dialog lists them per
song and says hand edits are kept.
branderson approved these changes 2026-10-14 23:28:23 -07:00
branderson merged commit 7e12a8ee46 into main 2026-10-14 23:28:28 -07:00
Sign in to join this conversation.
No Reviewers
No labels
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: branderson/songtrace#32