Highlights
1. Expanded to 41 Rules + Bilingual Diagnostics (--lang en|zh)
- Added 15 new layout, typography, optical, and media integrity rules:
block-gap-collapsed, heading-proximity-violation, card-padding-vertical-asymmetry, viewport-edge-flush, grid-column-width-drift, container-center-drift, form-label-control-misalign, responsive-stretch-overflow, low-contrast-text (real-pixel WCAG 2.1), surface-boundary-invisible, control-unexpected-wrap, horizontal-page-overflow, table-header-cell-misalign (including split-header tables), image-aspect-distortion, and focus-ring-clipped.
- Added container text protrusion, table row overflow, and silent hard-clipping detection (while exempting valid
text-overflow: ellipsis and scrollable table wrappers).
- Added
--lang en|zh bilingual diagnostic messages and interactive HTML reports, plus English default README.md and README.zh-CN.md.
2. Geometry & Pixel-Optical Engine Upgrade (Zero Native Dependencies)
- Zero-dep STR Static R-Tree + OBB/SAT Narrow-Phase Collision (
src/core/spatial-index.ts): scale-invariant broad-phase queries, O(log N) 4-way nearest visible neighbor for heading-proximity-violation, and exact OBB+SAT narrow-phase collision for CSS-rotated/skewed elements (orientedQuad).
- 2D
elementsFromPoint Sticky/Fixed Occlusion Probe: catches fixed top headers and bottom bars visually covering headings and CTAs underneath.
- Analytical Rounded-Box SDF (
sdRoundedBox) + X-Height Ink Centroid + DOM Icon Priors: improves optical vertical centering precision on descender glyphs (g, j, p, q, y) and stacked plain inputs, plus pixel-level narrow-phase overlap confirmation (hasVisualOverlapInk).
3. Real-World Production Precision Refinements & Benchmark Report
- Generalized real-world UI abstractions: composite input wrapper climbing (AntD / MUI / Element Plus), borderless transparent nav/ghost button semantics, cross-control-form height/padding separation,
<aside> card tier isolation, centered table pill symmetry, and rotated badge local dimension extraction.
- Published docs/BENCHMARK_REPORT.md:
- 200-case multi-viewport blind benchmark: 95.1% Recall (176/185) (Batch 2 unseen: 97.5%), 88.3% Clean Zero-Finding (53/60), 32/38 rules at 0 FP.
- 12 targeted real-world GitHub Issue & algorithm fixtures: 100% Bug Recall (8/8), 1 FP across 4 complex clean dashboards.
- 11 live open-source production websites audited (
ui.shadcn.com, ant.design, mui.com, element-plus.org, radix-ui.com, playwright.dev, vite.dev, tailwindcss.com, github.com/features).
- Core Pure-TS Engine: 0.50ms (80 atoms) / 4.36ms (2,000-atom grid) / 6.34ms (1,200 dense overlap), 82/82 tests passing.
Install
npm i -g https://github.com/ShellMonster/ui-caliper/releases/download/v0.3.0/ui-caliper-0.3.0.tgz