No image zoom or pan, and a failed image blanks the canvas permanently #99
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Severity: MEDIUM
The problems
No zoom or pan. The image canvas is
object-fit: containonly(
ReviewWorkspacePage.tsx:493-497,styles.css:471-492).docs/circa-ui-spec.md§8.4 requires"quick toggle… zoom and pan." Reading faded pencil on the back of a print without zoom is not
realistic — and the OCR review UI (#21) will only raise the stakes.
One failed image blanks the canvas permanently.
onErrorsetsimg.style.display = "none"imperatively. Because the same
<img>element is reused for front and back, a failed back imageblanks the canvas and switching back to Front never resets the style. The unused
.image-canvas-placeholderclass shows an error state was intended and dropped.Scope
hook) is justified — this is the primary work surface.
srcchange, or key the<img>byshowBack.Done when
References
frontend/src/pages/ReviewWorkspacePage.tsx:493-497frontend/src/styles.css:471-492docs/circa-ui-spec.md§8.4Done in
97d5cdc, with #98 and #100. CI run #60 green.Done when:
Wheel zoom (cursor-anchored), drag pan, double-click to toggle fit versus actual size,
+/-/arrows/0from the keyboard, and visible zoom buttons in the toolbar so the capability is discoverable rather than only bindable. Zoom resets when the photograph changes and when the side toggles — a reviewer who zoomed into the back of one print should not land mid-zoom on the next.No dependency was added, against the issue's suggestion that one is justified. Roughly sixty lines, and two reasons: the keyboard requirement in the third done-when box is the part pan-zoom libraries do worst, and
scripts/audit.mjsis a gate whose surface is worth keeping small. If this proves fiddly in real use the decision is cheap to revisit.The failed-image bug was as described and slightly worse.
onErrorsetstyle.display = "none"imperatively on an<img>shared between front and back, so a failed back scan blanked the canvas and switching to Front never restored it — React had no idea the style had been touched. It is now state keyed by which side is showing, and the canvas says "Back image unavailable" rather than showing nothing.A second bug surfaced while building it, which no issue named. Pointer capture retargets the compatibility
clickat the capturing element, so a pan begun on the "View original" link would have made that link dead — at exactly the zoom levels where a reviewer most wants the original. Guarded inonPointerDown.One honest gap in the coverage. Pan clamping, cursor-anchored zoom and the double-click fit toggle are implemented but not unit-tested: jsdom performs no layout, so
offsetWidth,naturalWidthand everygetBoundingClientRect()are zero and there is nothing to assert geometry against.toggleActualSizedeliberately no-ops when it cannot measure, which is also why double-click is inert under test. The wheel test proves the wheel zooms, not where it zooms to. Holding those properly needs a Playwright test — the same route #97's dock invariant took — and is worth adding if this area changes again.The zoom readout announces itself with
aria-live="polite". Doing that required scoping a #104 test which had been asserting that nostatusrole existed anywhere on the page after the job confirmation cleared; that assertion was accidentally load-bearing, making every future live region on this page a test failure.