feat(domain): per-view minimum point radius in preview state

PreviewState.min_point_radius maps a view id to the smallest point
hitbox radius that passes TooSmall on the smallest preview, so the
sheet editor can mark it on a size slider. Twin constants named in
layer.rs; frame.rs shares one first-view drawing lookup.
This commit is contained in:
bchanot committed 2026-11-17 16:33:40 +01:00
1 parent 56c75b12ef
commit 5ca2b7e3ad
8 files changed
+202 -9

No files matched your search

@@ -22,6 +22,7 @@ import type {
Finding,
Observation,
PdfLabelSet,
PreviewState,
Report,
ReportArchiveEnvelope,
ReportZone,
@@ -60,4 +61,11 @@ describe('ts-rs contract types', () => {
expectTypeOf<ReportArchiveEnvelope>().toMatchTypeOf<ZodEnvelope>()
expectTypeOf<ZodEnvelope>().toMatchTypeOf<ReportArchiveEnvelope>()
})
// The preview state's per-view minimum point radius: view id to a number, none when absent.
it('give the preview state a radius per view id', () => {
expectTypeOf<PreviewState['min_point_radius']>().toEqualTypeOf<
Record<string, number>
>()
})
})
+6
View File
@@ -13,6 +13,12 @@ export type PreviewState = { status: PreviewStatus,
* Recomputed; absent when the document has an integrity error.
*/
fingerprint: string | null, report: SheetReport, drawings: Array<PreviewDrawingState>, index: PreviewIndex | null,
/**
* The smallest hitbox radius of a point in each view, by view id: the radius whose visible
* disc just passes the minimum size on the smallest preview. Absent for a view without a
* usable frame or drawing, and for one where every radius passes.
*/
min_point_radius: { [key in string]: number },
/**
* The document as read (defaults filled in).
*/