feat(editor): two-finger pan, touch hint, loupe, touch-sized handles

useFraming gains twoPointerPan (the editor's pinch also pans by the
midpoint and scales from the spread since the pinch began; the
catalogue passes nothing). A futile one-finger drag shows the R-1
hint unless two fingers already worked in this editor visit (work
store flag). A finger drag of a handle shows the loupe (technique A:
the drawing copied once, data-anno-id stripped, outline on top).
editor-touch.spec covers 1 024, 1 180 and 1 280 px with CDP touch.
measure-drag.ts is the hand-run smoothness measure (MEASURE_DRAG=1).
equineShape moved from editor-zones.spec to support/editor.ts, no
assertion changed.
This commit is contained in:
bchanot committed 2026-11-18 10:54:46 +01:00
1 parent 3a7715486b
commit 85231a2680
18 files changed
+1338 -53

No files matched your search

+39
View File
@@ -899,3 +899,42 @@ export const INKSCAPE_EXPORT = readFileSync(
'../../../../crates/core/tests/fixtures/svg/exports/inkscape-1.4.3-inkscape-svg.svg',
),
)
/** The curated equine draft (document and drawing): a drawing and a document of real size. */
const EQUINE_DRAFT = join(
__dirname,
'../../../../supabase/seed/anatomical-sheets/equine/draft',
)
interface Draft {
vertebral_config: unknown
references: unknown
categories: unknown
finding_zones: unknown
views: { id: string; svg_asset_id: string | null }[]
annotations: { view_id: string; kind: string }[]
}
/** The equine draft's main view, its annotations and structures, on the seeded drawing. */
export function equineShape(document: Record<string, unknown>) {
const draft = JSON.parse(
readFileSync(join(EQUINE_DRAFT, 'document.json'), 'utf8'),
) as Draft
const [seeded] = document.views as Draft['views']
const main = draft.views.find((view) => view.id === 'main')!
Object.assign(document, {
vertebral_config: draft.vertebral_config,
references: draft.references,
categories: draft.categories,
finding_zones: draft.finding_zones,
views: [{ ...main, svg_asset_id: seeded.svg_asset_id }],
// The detail view is left out, so is the link that opens it.
annotations: draft.annotations.filter(
(a) => a.view_id === 'main' && a.kind !== 'detail_trigger',
),
})
}
/** The equine main view's drawing, as a person would attach it. */
export const equineDrawing = () =>
readFileSync(join(EQUINE_DRAFT, 'assets/horse.svg'), 'utf8')