Put "Time it for real" on the bar and the result under the header

Nothing on the page could trigger the measurement, so the running time a
revision cuts against was only reachable through the API.
This commit is contained in:
gator 2026-09-17 12:16:10 +00:00
parent 9a00b66b68
commit d94390d135

View file

@ -309,6 +309,12 @@
+ 'Each other model reads ONLY this script - no book - and says what it understood.">' + 'Each other model reads ONLY this script - no book - and says what it understood.">'
+ (REVIEWS.length ? "Test it again" : "Does it make sense? Ask " + others + " readers") + (REVIEWS.length ? "Test it again" : "Does it make sense? Ask " + others + " readers")
+ '</button>'); + '</button>');
out.push('<button type="button" class="btn" data-measure="' + esc(meta.id)
+ '" title="Speaks every line in the cast voices and reports what the '
+ 'trailer really runs.">'
+ ((PKG.timing && PKG.timing.measured_seconds) ? "Time it again" : "Time it for real")
+ '</button>');
if (RUN.stage === "revising") if (RUN.stage === "revising")
out.push('<button type="button" class="btn" disabled>Rewriting…</button>'); out.push('<button type="button" class="btn" disabled>Rewriting…</button>');
else if (REVIEWS.length || Object.keys(NOTES).length) else if (REVIEWS.length || Object.keys(NOTES).length)
@ -414,7 +420,8 @@
+ (Number(meta.iteration) > 1 ? ' &middot; revision ' + meta.iteration : '') + (Number(meta.iteration) > 1 ? ' &middot; revision ' + meta.iteration : '')
+ ' &middot; ' + shots.length + ' shots &middot; ' + ' &middot; ' + shots.length + ' shots &middot; '
+ Math.floor(secs / 60) + ':' + String(Math.round(secs % 60)).padStart(2, "0") + Math.floor(secs / 60) + ':' + String(Math.round(secs % 60)).padStart(2, "0")
+ ' &middot; ' + cast.length + ' characters</p>'; + ' &middot; ' + cast.length + ' characters</p>'
+ timingHtml();
var probs = draft.problems var probs = draft.problems
? '<div class="probs"><b>The checker has objections</b><ul>' ? '<div class="probs"><b>The checker has objections</b><ul>'
@ -596,6 +603,15 @@
r = await act("draw_storyboard", { draft_id: el.getAttribute("data-draw") }); r = await act("draw_storyboard", { draft_id: el.getAttribute("data-draw") });
if (r) await refresh(); return; if (r) await refresh(); return;
} }
if ((el = hit("data-measure"))) {
el.disabled = true; el.textContent = "Speaking every line…";
r = await act("measure_script", { draft_id: el.getAttribute("data-measure") });
if (r) {
showMsg("msg", "Speaking every line in the cast voices. A minute or two.", "ok");
setTimeout(refresh, 20000);
}
return;
}
if ((el = hit("data-review"))) { if ((el = hit("data-review"))) {
el.disabled = true; el.disabled = true;
r = await act("start_review", { run_id: runId }); if (r) await refresh(); return; r = await act("start_review", { run_id: runId }); if (r) await refresh(); return;