6.6 KiB
Independent source review: isolated label cue candidate B
No blocker or high-severity source defect found in this frozen experimental diff. It is suitable for the parent's compilation and bounded native/performance experiment, not accepted as a fix or production behavior. No compiler, GUI, Gitea operation or production edit was performed. This report is the only new file.
Reviewed identity
Base 6ea7518e; uncommitted changes limited to crates/oa-desktop/src/diagram.rs, private diagram/label_cues.rs, and the added field in one diagram/attachment_tests.rs Scene literal. Read the predeclared experiment intent, source handoff, and the independent design critic from the diagram worktree.
Reviewed file SHA256:
- diagram.rs:
f9f7ff0ffa2f9cc41a2eb95651072a6200b67df1c28f427bd921b92724eaee3e - label_cues.rs:
82a819e2d7a1bd03a326a4e1c4bf318a6f6d4e87ebfcf22922253ab78a594055 - attachment_tests.rs:
1cbfa3d926e8c6d7dcbab2d393ce248dd7e190583886f75165c7d2f5c9e7e127
Correctness assessment
The helper consumes immutable Project, ProjectedView and RoutedView inputs and returns only a private cue map. No core model field, semantic endpoint, route point, authored label, projected placement/port, selection policy, hitbox or command changes. Picking still uses original path/label geometry; cue strokes introduce no semantic target.
label_cues.rs:16-46 implements the stated conservative geometry contract: clamp the route anchor to the label rectangle; omit gaps at or below 12 world units, including anchors inside/on the rectangle; reject closed intersection with every distinct edge's segments; reject landing distance at or below 7; and reject visible card/other ordinary label/association-end label intersections. Distinct edge IDs are retained, so a coincident foreign segment cannot be mistaken for a uniquely owned landing. Node/container suppression is intentional. The closed segment intersection and box tests are consistent for straight finite geometry, including collinear overlap and touching. No measured perceptual clearance is established by these constants.
Caching is attached to the existing Scene, not camera state. Both constructors derive from the geometry actually stored in that Scene. Allocation/work preview uses its own preview Project; ordinary route/node/port previews use the current semantic Project with their derived preview geometry, which is appropriate because these previews alter presentation. Existing context/revision, route, preview and port keys control rebuild; the work cache uses preview Arc identity. No new stale-cache path was found by inspection. Existing caller obligations to update context for model changes remain unchanged.
Canvas and SVG use the same derivation and boundary/anchor endpoints. Both paint the dotted cue after its owning path and before its label backing. The backing hides only the boundary's inward stroke half; the admitted open gap stays outside the box. Guards exclude later unrelated route/label/card centerline/rectangle intersections, addressing the ordinary interleaved rendering-order risk. Color matches MUTED (75,89,104); width and dash values match (1; 2/3). SVG has no arrow marker and uses pointer-events none. Cue endpoints are already within the routed path/label bounds, so no export bounds enlargement is required.
Meaningful tests and specific coverage limits
The four tests are relevant: representative geometry/SVG and model preservation, boundary gap versus center-distance distinction, obstruction guards, and actual Scene Arc reuse across selection/pointer/camera changes. They do not establish compilation or behavior until run.
Nonblocking evaluator weakness at label_cues.rs:160-165: all three foreign vertical segments intersect the cue. In particular x=1168 tests both the six-unit clearance condition and crossing rejection. Removing the landing-clearance predicate would still pass that alleged near-landing control. A future focused control should place a short parallel segment six units from the anchor, outside the cue segment, with a corresponding safely distant positive control. Current production predicate itself is correct by inspection.
Further untested boundaries: exactly 12 versus greater-than-12 gap; exactly 7 versus greater-than-7 landing clearance; collinear/touching rectangles; association-end label obstruction; a safe positive control adjacent to each obstruction; scene invalidation for changed route/revision/work preview. The reuse test does not verify invalidation. These are coverage limitations, not reproduced stale state or geometric defects. The representative test does not assert the complete cue set/count, which the native experiment should record.
Risks and release boundaries
The known central falsifier is unchanged: target cue length is 18 world units, approximately 9.3 pixels at representative Fit, while the foreign Allocation stroke still passes through the label. Four or so tiny dash elements may be missed or read as a relationship branch. Source correctness cannot show improved first association; require the fresh reading experiment before calling B a fix. This review does not endorse explaining the cue to the reader first.
Admission scans routes/cards/labels per eligible label: approximately O(eligible_labels * (total_route_segments + edges + nodes + association_labels)) per scene build, plus association-label geometry construction. The existing scene cache prevents ordinary hover/selection/camera rescans, but route drag previews can rebuild every changed gesture. Dense rebuild/preview latency remains an actual measurement gate. No demonstrated performance regression is claimed here.
Known limited geometry remains: no cue-to-cue avoidance; no port-symbol, arrowhead, glyph or stroke-width contour avoidance; own-route segments other than the anchor are not tested; no width-scaled guard. These may produce visual interference in other scenes, but no such failure was reproduced in this read-only scope. Do not generalize the straight-centerline/rectangle checks into an all-rendered-marks guarantee. Conservative omission is not proof that a label is already understandable.
The private module is proportionate for an isolated experiment. SVG duplicates width/dash/color literals that canvas receives via constants/style; values agree now, but sharing those values would reduce future drift if the candidate survives. No refactor is required before the bounded experiment.
Retain baseline and B with identical complete model, paths, labels and camera; measure first chosen association, controls, cue count/intersections and preview cost. Publication, native usability, save/reopen and broad accessibility acceptance remain outside this review.