fix(anatomy): V1-2.2 marker layer and halo outside the drawing's group
Owner-approved lot B (brief 2026-11-01). The composition root is the engine's (namespaces and frame); the drawing's root becomes a group and the marker layer and halo are its siblings, so no root property reaches a marker. Point hitboxes declare stroke none and visibleFill. Census over the reader's whole allowlist; R3 references compared under the declared transform; click proofs in three engines.
This commit is contained in:
1 parent
f1bb19b30b
commit
4f52f5e1c4
23 files changed
+933
-112
No files matched your search
@@ -0,0 +1,12 @@
|
||||
<!doctype html>
|
||||
<html lang="fr">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>Canvas harness</title>
|
||||
</head>
|
||||
<body>
|
||||
<div id="root"></div>
|
||||
<script type="module" src="./canvas.tsx"></script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,73 @@
|
||||
/**
|
||||
* 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<string, string> = {
|
||||
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('<svg ', `<svg ${rootAttrs} `),
|
||||
]),
|
||||
)
|
||||
return { ...sheet, assets }
|
||||
},
|
||||
})
|
||||
|
||||
function Harness() {
|
||||
const sheet = useSheet('equine')
|
||||
const [clicks, setClicks] = useState<string[]>([])
|
||||
return (
|
||||
<main className="p-4">
|
||||
<h1 className="text-xl font-semibold">Canvas harness</h1>
|
||||
{/* A fixed height: the canvas never moves when the first click is listed. */}
|
||||
<output data-testid="clicks" className="block h-6 overflow-hidden">
|
||||
{clicks.join(' ')}
|
||||
</output>
|
||||
<div style={{ width: 'min(1000px, 100%)', aspectRatio: '2073.4 / 1629.4' }}>
|
||||
{sheet.status === 'ready' && (
|
||||
<AnatomyCanvas
|
||||
index={sheet.index}
|
||||
viewId={viewId}
|
||||
states={new Map()}
|
||||
onZoneClick={(id) => setClicks((all) => [...all, id])}
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
</main>
|
||||
)
|
||||
}
|
||||
|
||||
createRoot(document.getElementById('root') as HTMLElement).render(
|
||||
<StrictMode>
|
||||
<Harness />
|
||||
</StrictMode>,
|
||||
)
|
||||
Reference in new issue
Block a user