diff --git a/bokehforge/docs/review.md b/bokehforge/docs/review.md index bb5c0f0..6d9638e 100644 --- a/bokehforge/docs/review.md +++ b/bokehforge/docs/review.md @@ -22,7 +22,7 @@ Choose an **Evaluation run** in the scene bar below the command bar, then select Click any comparison image or the expand control on a thumbnail to open it in the zoomable lightbox. Scroll the lightbox strip to browse the source frames, ready outputs from the selected evaluation, and any references. Hover over a thumbnail to preview it and move away to return to the selected image. Click or tap a thumbnail to select it, or use Left and Right to wrap through the strip. Zoom and pan stay fixed as you browse. Select **Swipe reference** and drag the divider to compare the image with its reference, or hold the period key (`.`) to see the reference across the whole view. You can pan while holding the key and the image resumes at the same position when you release it. -Use the rating section beneath the stacker output image to grade an output from 1 to 5, with 5 best, and add an optional comment. Stackroom saves both automatically, including comments entered before a grade. The status shows when the server confirms the save. Pending edits resume when the connection returns. If a save fails, the edit stays in the form and **Retry save** appears. **Export ratings** downloads saved grades and comments for every run as CSV, with a blank grade for comments saved on their own. +Use the rating section beneath the stacker output image to grade an output from 1 to 5, with 5 best, and add an optional comment. Press **1** through **5** in the workspace to grade the active output. Stackroom saves both automatically, including comments entered before a grade. The status shows when the server confirms the save. Pending edits resume when the connection returns. If a save fails, the edit stays in the form and **Retry save** appears. **Export ratings** downloads saved grades and comments for every run as CSV, with a blank grade for comments saved on their own. Use **Appearance** to set the accent. Stackroom remembers it in your browser and adjusts dark colors for contrast. **Reset accent** restores white. diff --git a/bokehforge/src/bokehforge/review/static/app.js b/bokehforge/src/bokehforge/review/static/app.js index 8103b4b..f038be0 100644 --- a/bokehforge/src/bokehforge/review/static/app.js +++ b/bokehforge/src/bokehforge/review/static/app.js @@ -1134,6 +1134,7 @@ function renderRating(row) { const ready = row?.status === "ready"; $("rating-title").textContent = ready ? "Rate " + stackerLabel(row.stacker) : "Rate outputs"; $("rating-form").hidden = !ready; + $("rating-shortcut").hidden = !ready; $("rating-empty").hidden = ready; $("rating-empty").textContent = row || outputLoading || !details ? "Ratings open when this output is available." @@ -1714,9 +1715,16 @@ new ResizeObserver(() => { for (const button of document.querySelectorAll(".benchmark-info")) button.onclick = () => showBenchmarkReason(button); for (const button of document.querySelectorAll("[data-close]")) button.onclick = () => $(button.dataset.close).close(); document.addEventListener("keydown", (event) => { - if (!scene || document.querySelector("dialog[open]") || - event.target.closest?.("input, textarea, select, [contenteditable], .overlay-picker") || - event.altKey || event.ctrlKey || event.metaKey || event.shiftKey) return; + if (!scene || document.querySelector("dialog[open]") || event.defaultPrevented || event.isComposing || + event.altKey || event.ctrlKey || event.metaKey) return; + const field = event.target.closest?.("input, textarea, select, [contenteditable], .overlay-picker"); + if (/^[1-5]$/.test(event.key)) { + if (!formKey || event.repeat || (field && !field.matches("#rating-form input[name=grade]"))) return; + event.preventDefault(); + $("rating-form").querySelector(`input[name=grade][value="${event.key}"]`).click(); + return; + } + if (field || event.shiftKey) return; if (event.key === "." && comparisonReference && !event.repeat) { event.preventDefault(); comparisonHoldKey = event.code || event.key; diff --git a/bokehforge/src/bokehforge/review/static/index.html b/bokehforge/src/bokehforge/review/static/index.html index f306a9e..ca1d368 100644 --- a/bokehforge/src/bokehforge/review/static/index.html +++ b/bokehforge/src/bokehforge/review/static/index.html @@ -136,7 +136,9 @@