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:
1 parent
9c606aa567
commit
96b99784b5
17 files changed
+944
-37
No files matched your search
@@ -22,8 +22,12 @@ pub const GEOMETRY_MISSING: &str = "annotation.geometry.missing";
|
||||
/// An annotation not entirely inside the frame of its view, or whose path data a browser would
|
||||
/// not read whole (V1-2.2 owner brief 2026-10-30, `anatomy::frame`).
|
||||
pub const OUT_OF_FRAME: &str = "annotation.geometry.out_of_frame";
|
||||
/// A view drawn on a drawing with neither a `view_box` nor a usable drawing `viewBox`.
|
||||
/// A view drawn on a drawing with neither a usable `view_box` nor a usable drawing `viewBox`
|
||||
/// (`anatomy::frame`: finite, within the `f32` range rules, not a line).
|
||||
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";
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize)]
|
||||
#[cfg_attr(feature = "ts", derive(TS), ts(export))]
|
||||
@@ -107,7 +111,7 @@ fn frame_issue(document: &AnatomicalSheetDocument, fault: &FrameFault) -> SheetI
|
||||
NO_FRAME,
|
||||
format!("views[{view_index}]"),
|
||||
format!(
|
||||
"View \"{}\" has neither a view_box nor a usable drawing viewBox",
|
||||
"View \"{}\" has neither a usable view_box nor a usable drawing viewBox",
|
||||
document.views[view_index].id()
|
||||
),
|
||||
),
|
||||
@@ -116,13 +120,15 @@ fn frame_issue(document: &AnatomicalSheetDocument, fault: &FrameFault) -> SheetI
|
||||
placement,
|
||||
} => {
|
||||
let annotation = &document.annotations[annotation_index];
|
||||
let what = if placement == Placement::Unreadable {
|
||||
"has path data that cannot be read whole"
|
||||
} else {
|
||||
"is not entirely inside the frame"
|
||||
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::InFrame | Placement::OutOfFrame => {
|
||||
(OUT_OF_FRAME, "is not entirely inside the frame")
|
||||
}
|
||||
};
|
||||
(
|
||||
OUT_OF_FRAME,
|
||||
code,
|
||||
format!("annotations[{annotation_index}].geometry"),
|
||||
format!(
|
||||
"Annotation \"{}\" {what} of view \"{}\"",
|
||||
|
||||
@@ -21,7 +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, frame_issues, referenced_asset_ids, sheet_report,
|
||||
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;
|
||||
@@ -54,6 +55,9 @@ pub mod codes {
|
||||
/// An annotation outside the frame of its view, or a view without a frame (V1-2.2):
|
||||
/// measured on the views whose drawing reads clean.
|
||||
pub const OUT_OF_FRAME: &str = "verification.validation.out_of_frame";
|
||||
/// 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";
|
||||
pub const FINGERPRINT: &str = "verification.integrity.fingerprint";
|
||||
}
|
||||
|
||||
@@ -275,8 +279,15 @@ fn rule_failures(report: &SheetReport) -> Vec<&'static str> {
|
||||
.filter(|i| i.severity == SheetIssueSeverity::Error)
|
||||
};
|
||||
let mut out = Vec::new();
|
||||
let rule =
|
||||
|code: &str| ![super::report::GEOMETRY_MISSING, OUT_OF_FRAME, NO_FRAME].contains(&code);
|
||||
let rule = |code: &str| {
|
||||
![
|
||||
super::report::GEOMETRY_MISSING,
|
||||
OUT_OF_FRAME,
|
||||
NO_FRAME,
|
||||
TOO_SMALL,
|
||||
]
|
||||
.contains(&code)
|
||||
};
|
||||
if errors().any(|i| rule(&i.code)) {
|
||||
out.push(codes::RULES);
|
||||
}
|
||||
@@ -289,14 +300,23 @@ fn rule_failures(report: &SheetReport) -> Vec<&'static str> {
|
||||
out
|
||||
}
|
||||
|
||||
/// The frame code when a frame issue was found (after the drawing faults: a view is measured
|
||||
/// only on a drawing that reads clean).
|
||||
fn frame_failures(report: &SheetReport) -> Option<&'static str> {
|
||||
report
|
||||
.issues
|
||||
.iter()
|
||||
.any(|i| i.code == OUT_OF_FRAME || i.code == NO_FRAME)
|
||||
.then_some(codes::OUT_OF_FRAME)
|
||||
/// The frame codes of the frame issues found, in code order (after the drawing faults: a view
|
||||
/// is measured only on a drawing that reads clean).
|
||||
fn frame_failures(report: &SheetReport) -> Vec<&'static str> {
|
||||
let found = |codes: &[&str]| {
|
||||
report
|
||||
.issues
|
||||
.iter()
|
||||
.any(|i| codes.contains(&i.code.as_str()))
|
||||
};
|
||||
let mut out = Vec::new();
|
||||
if found(&[OUT_OF_FRAME, NO_FRAME]) {
|
||||
out.push(codes::OUT_OF_FRAME);
|
||||
}
|
||||
if found(&[TOO_SMALL]) {
|
||||
out.push(codes::MARKER_TOO_SMALL);
|
||||
}
|
||||
out
|
||||
}
|
||||
|
||||
struct CheckedDrawing {
|
||||
|
||||
Reference in new issue
Block a user