Repository navigation
Add a keywords box to the review page form - #189
Conversation
Sent as the keywords string parse_job already reads, disabled while captions are off, and the finished run's summary lists the keywords from the manifest.
A21-devs
left a comment
There was a problem hiding this comment.
Read the diff after the headless run. The field name, the null for an empty or disabled box, and the summary line all line up with parse_job and the manifest, and old manifests without keywords still render (m.keywords?.length). Two things on the input itself.
| </label> | ||
| <!-- matched against the transcript, so it's off with captions (the server would refuse it) --> | ||
| <label class="wide" id="keywords">Favor moments where these are said | ||
| <input type="text" name="keywords" placeholder="clutch, no way" maxlength="500" autocomplete="off"> |
There was a problem hiding this comment.
maxlength="500" makes the browser cut pasted text at 500 characters without saying anything. If someone pastes a long list, the last phrase gets chopped mid-word (golden swo) and that fragment becomes a keyword they never typed, which is worse than the server's keywords can be at most 500 characters. Without maxlength the 400 lands in #form-error like every other limit. The test then shouldn't pin maxlength either.
|
|
||
| // keywords are looked for in the transcript, which only exists with captions on | ||
| const captionsBox = document.querySelector('input[name="captions"]'); | ||
| const syncKeywords = () => { $("new-job").elements.keywords.disabled = !captionsBox.checked; }; |
There was a problem hiding this comment.
When captions are off the box just goes grey (the page has no :disabled style for inputs, so it's the browser default, which is faint in dark mode) and nothing says why. Someone who unchecked Captions earlier will see a box they can't type in. A title on the input saying it needs captions, set in syncKeywords, would cover it.
|
Fixed both in 846ab66.
ruff, mypy and the server tests pass. |
A21-devs
left a comment
There was a problem hiding this comment.
Second pass on 846ab66. Both points are fixed: the input has no maxlength, so a long paste reaches the server and comes back as the 500-character error, and the disabled box now has a title and the 0.5 opacity. input:disabled is a page-wide rule, but the keywords box is the only input the page ever disables, so nothing else changes. The new test case is 560 characters ("golden sword, " * 40), so it really does go over the limit. Nothing else from me.
maxlength cut a long paste mid-word without telling anyone. The disabled box now has a title and a visible disabled style.
Closes #122
The review page form had no way to pass
--keywords, even though the CLI, MCP tool andserveAPI all take it.What changed in
web/index.html:clutch, no way,maxlength500 to matchMAX_KEYWORDS_TEXT.FormData, so the job goes out withkeywords: nulland the server doesn't reject it with "keywords ... need captions on". An empty box is sent asnulltoo.2 clips, keywords: no way, golden swordwhen the manifest has keywords. Runs without keywords look the same as before.The reasons line already shows
said "..."per clip, so nothing changed there.Testing
uv run ruff check src tests,uv run mypy,uv run pytest -q: 769 passed.test_form_keywords_field_matches_parse_job: the input is namedkeywords, itsmaxlengthequalsMAX_KEYWORDS_TEXT, the submit handler sends it, and the placeholder text parses to["clutch", "no way"].clipwright serve --port 8799, driven with headless Edge over CDP on a 4 min TTS-over-gameplay video, whisper tiny:No way, golden SWORD, the POST body had"keywords": "No way, golden SWORD"keywords: "no way" 3x, "golden sword" 3x, summary:2 clips, keywords: no way, golden sword, both clips' reasons includesaid "no way", "golden sword"keywords: null, no form error