fix(anatomy): V1-2.2 refuse markers too small on the phone preview

Owner decision 2026-11-01: the scale bypass (viewBox blown up, drawing
scaled back) is closed by the visible size, 4 CSS px on the editor at
320 x 568 (equine junctions 4.97 px), verdict marker_too_small. A frame
is usable only where browsers draw it faithfully: edges within 2^20,
span from 1 unit, aspect 100, offset 256 spans; measured in 3 engines.
This commit is contained in:
bchanot committed 2026-11-01 01:28:48 +01:00
1 parent 9c606aa567
commit 96b99784b5
17 files changed
+944 -37

No files matched your search

@@ -0,0 +1,33 @@
import { createRequire } from 'node:module'
const require = createRequire(process.argv[2] + '/apps/app/package.json')
const pw = require('@playwright/test')
const sizes = [[320,568],[360,640],[375,667],[390,844],[1280,800]]
const browser = await pw.chromium.launch()
for (const [w,h] of sizes) {
const ctx = await browser.newContext({ viewport: { width: w, height: h }, locale: 'fr-FR', hasTouch: w < 500, isMobile: w < 500 })
const page = await ctx.newPage()
await page.goto('http://127.0.0.1:5197/new')
await page.getByLabel('Nom complet').first().fill('P F')
await page.getByLabel("Nom de l'animal").first().fill('A F')
await page.getByLabel('Nom du propriétaire').first().fill('O F')
await page.getByRole('button',{name:'Démarrer le bilan'}).click()
await page.waitForURL(/editor/)
const dlg = page.getByRole('dialog'); if (await dlg.count()) { await page.keyboard.press('Escape') }
await page.locator('[data-anno-id="hock"]').first().waitFor({ state: 'attached' })
const m = await page.evaluate(() => {
const svg = document.querySelector('.svg-canvas svg'); const r = svg.getBoundingClientRect()
const vb = svg.viewBox.baseVal
const twins = [...svg.querySelectorAll('circle[pointer-events="none"]')].map(c => c.getBoundingClientRect().width)
return { svgW: r.width, svgH: r.height, vbW: vb.width, vbH: vb.height, scale: Math.min(r.width / vb.width, r.height / vb.height), twinMin: Math.min(...twins), twinMax: Math.max(...twins) }
})
// detail modal
await page.locator('[data-anno-id="head-trigger"]').first().dispatchEvent('click')
let d = null
try { await page.locator('dialog [data-anno-id="atm"]').first().waitFor({ state: 'attached', timeout: 5000 })
d = await page.evaluate(() => { const svg = document.querySelector('dialog .svg-canvas svg'); const r = svg.getBoundingClientRect(); const vb = svg.viewBox.baseVal
const twins = [...svg.querySelectorAll('circle[pointer-events="none"]')].map(c => c.getBoundingClientRect().width)
return { svgW: r.width, svgH: r.height, vbW: vb.width, vbH: vb.height, scale: Math.min(r.width / vb.width, r.height / vb.height), twinMin: Math.min(...twins) } }) } catch (e) { d = String(e).slice(0,100) }
console.log(w, h, JSON.stringify(m), 'detail', JSON.stringify(d))
await ctx.close()
}
await browser.close()