bettersight-statement-extra.../frontend
JasonFraser 4c0973b6b5 Fix pdf.js pages staying blank until a zoom action
Reported: pages appeared blank/"a silhouette" on first load and
refresh, becoming visible only after hitting zoom.

Root cause: loadDocument() computed fitZoom/zoom correctly after
loading a PDF, but never actually called renderAllPages() - only
zoomIn/zoomOut/resetZoom do (via applyZoom), which is why touching zoom
"fixed" it. With nothing drawing into them, every <canvas> sat at the
browser's own unset-canvas default (300x150px), a small blank shadowed
rectangle. The render pipeline itself was never in question - already
proven correct by zoom successfully triggering it - this was purely a
sequencing bug.

Fixed with nextTick() before renderAllPages(): setting numPages only
queues the v-for's canvas elements, they don't exist in the DOM (so
canvasRefs stays empty) until Vue flushes that update, which nextTick
explicitly waits for.

Also investigated the separately reported "no longer see the other top
bar pdf options" - checked the zoom-controls row's own v-if and CSS,
found no second bug there. Most likely the same blank-canvas symptom
read as the whole panel looking broken; not confirmed as the same
issue, flagged to the user to check once this fix is live rather than
assumed resolved.

Verified: npm run build passes, the app container rebuilt. measure.py
unaffected. Not machine-verified - Claude-in-Chrome did not connect
this session.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-10-13 15:05:46 -04:00
..
.vscode Restructure frontend to Vue 3 + Vite (Stage 2 of 2) 2026-10-12 06:32:49 -04:00
public Restructure frontend to Vue 3 + Vite (Stage 2 of 2) 2026-10-12 06:32:49 -04:00
src Fix pdf.js pages staying blank until a zoom action 2026-10-13 15:05:46 -04:00
.gitignore Restructure frontend to Vue 3 + Vite (Stage 2 of 2) 2026-10-12 06:32:49 -04:00
README.md Restructure frontend to Vue 3 + Vite (Stage 2 of 2) 2026-10-12 06:32:49 -04:00
index.html Restructure frontend to Vue 3 + Vite (Stage 2 of 2) 2026-10-12 06:32:49 -04:00
package-lock.json Replace the native PDF iframe with a pdf.js viewer for row highlighting 2026-10-13 11:26:48 -04:00
package.json Replace the native PDF iframe with a pdf.js viewer for row highlighting 2026-10-13 11:26:48 -04:00
vite.config.js Restructure frontend to Vue 3 + Vite (Stage 2 of 2) 2026-10-12 06:32:49 -04:00

README.md

Vue 3 + Vite

This template should help get you started developing with Vue 3 in Vite. The template uses Vue 3 <script setup> SFCs, check out the script setup docs to learn more.

Learn more about IDE Support for Vue in the Vue Docs Scaling up Guide.