/** * Test page for the editor canvas in a real browser (e2e/ui/canvas-clicks.spec.ts): the * bundled equine sheet in AnatomyCanvas, its drawing's root given the attributes of the * chosen `?drawing=` case, every click recorded. Served by the Vite dev server only * (`/e2e/harness/canvas.html`); the build has a single entry, index.html, so this page * never ships. */ import { StrictMode, useState } from 'react' import { createRoot } from 'react-dom/client' import '@/styles/index.css' import AnatomyCanvas from '@/components/canvas/AnatomyCanvas' import { bundledSheetProvider } from '@/sheets/provider' import { setSheetProvider, useSheet } from '@/sheets/useSheet' /** * Root attributes of the drawing per case (V1-2.2 owner brief 2026-10-30, defect 2): the * reported giant stroke, the same width with no stroke paint (an invisible enlarged * surface), and the hiding stroke properties. */ const DRAWINGS: Record = { plain: '', 'giant-stroke': 'stroke="#ff00ff" stroke-width="2000"', 'invisible-stroke': 'stroke-width="2000"', 'hidden-stroke': 'stroke="#ff00ff" stroke-width="2000" stroke-opacity="0"', } const params = new URLSearchParams(location.search) const rootAttrs = DRAWINGS[params.get('drawing') ?? 'plain'] ?? '' const viewId = params.get('view') ?? 'main' setSheetProvider({ async getReferenceSheet(speciesId) { const sheet = await bundledSheetProvider.getReferenceSheet(speciesId) if (!sheet || rootAttrs === '') return sheet const assets = Object.fromEntries( Object.entries(sheet.assets).map(([id, text]) => [ id, text.replace('([]) return (

Canvas harness

{/* A fixed height: the canvas never moves when the first click is listed. */} {clicks.join(' ')}
{sheet.status === 'ready' && ( setClicks((all) => [...all, id])} /> )}
) } createRoot(document.getElementById('root') as HTMLElement).render( , )