fix(anatomy): V1-2.2 refuse zones without a usable interior

A polygon or path zone or trigger must fill a disc of 4 CSS px on the
320 x 568 preview under the layer's nonzero rule, stroke left out:
conservative widest-disc search on the flattened outline, caps and a
per-sheet budget, closed codes interior_too_small and
marker_interior_too_small. Browser probe on six projects.
This commit is contained in:
bchanot committed 2026-11-01 12:19:08 +01:00
1 parent de2dfb392e
commit 8dd2d78d38
18 files changed
+1852 -38

No files matched your search

+11
View File
@@ -28,6 +28,9 @@ pub const NO_FRAME: &str = "view.frame.unknown";
/// An annotation in frame that shows below `anatomy::frame::MIN_VISIBLE_PX` on the smallest
/// preview (owner brief 2026-11-01, the scale bypass).
pub const TOO_SMALL: &str = "annotation.geometry.too_small";
/// A polygon or a path in frame whose fill holds no disc of `anatomy::frame::MIN_VISIBLE_PX` on
/// the smallest preview (owner brief 2026-11-01, zone without interior; `anatomy::interior`).
pub const INTERIOR_TOO_SMALL: &str = "annotation.geometry.interior_too_small";
#[derive(Debug, Clone, PartialEq, Eq, Serialize)]
#[cfg_attr(feature = "ts", derive(TS), ts(export))]
@@ -123,6 +126,14 @@ fn frame_issue(document: &AnatomicalSheetDocument, fault: &FrameFault) -> SheetI
let (code, what) = match placement {
Placement::Unreadable => (OUT_OF_FRAME, "has path data that cannot be read whole"),
Placement::TooSmall => (TOO_SMALL, "shows too small on the phone preview"),
Placement::InteriorTooSmall => (
INTERIOR_TOO_SMALL,
"fills no interior wide enough to tap on the phone preview",
),
Placement::InteriorUnmeasured => (
INTERIOR_TOO_SMALL,
"is too complex for the interior measure on the phone preview",
),
Placement::InFrame | Placement::OutOfFrame => {
(OUT_OF_FRAME, "is not entirely inside the frame")
}
+9 -2
View File
@@ -21,8 +21,8 @@ use ts_rs::TS;
use super::caps::CapsReport;
use super::fingerprint::{FingerprintError, document_fingerprint};
use super::report::{
NO_FRAME, OUT_OF_FRAME, SheetReport, TOO_SMALL, frame_issues, referenced_asset_ids,
sheet_report,
INTERIOR_TOO_SMALL, NO_FRAME, OUT_OF_FRAME, SheetReport, TOO_SMALL, frame_issues,
referenced_asset_ids, sheet_report,
};
use super::review::{Completeness, ElementChange, ReviewGroup, change_list};
use super::schema::AnatomicalSheetDocument;
@@ -58,6 +58,9 @@ pub mod codes {
/// An annotation in frame that shows below 4 CSS px on the smallest preview (owner brief
/// 2026-11-01): measured on the same views.
pub const MARKER_TOO_SMALL: &str = "verification.validation.marker_too_small";
/// A polygon or a path in frame whose fill holds no disc of 4 CSS px on that preview, its
/// stroke left out (owner brief 2026-11-01, zone without interior).
pub const MARKER_INTERIOR_TOO_SMALL: &str = "verification.validation.marker_interior_too_small";
pub const FINGERPRINT: &str = "verification.integrity.fingerprint";
}
@@ -285,6 +288,7 @@ fn rule_failures(report: &SheetReport) -> Vec<&'static str> {
OUT_OF_FRAME,
NO_FRAME,
TOO_SMALL,
INTERIOR_TOO_SMALL,
]
.contains(&code)
};
@@ -316,6 +320,9 @@ fn frame_failures(report: &SheetReport) -> Vec<&'static str> {
if found(&[TOO_SMALL]) {
out.push(codes::MARKER_TOO_SMALL);
}
if found(&[INTERIOR_TOO_SMALL]) {
out.push(codes::MARKER_INTERIOR_TOO_SMALL);
}
out
}