Skip to content

Releases

ui-caliper v0.3.0

Choose a tag to compare

@ShellMonster ShellMonster released this 29 Nov 16:17

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

ui-caliper v0.2.1

Choose a tag to compare

@ShellMonster ShellMonster released this 29 Nov 09:44

UI Caliper v0.2.1

跨端全局隐形像素导轨几何布局、像素墨迹光学与多图层测量引擎(Web / iOS / Android · CLI + stdio MCP Server · 零原生 C++ 依赖)。

核心特性

  • 四层单向依赖架构:100% 平台无关纯计算内核(src/core/)+ Web / Android / iOS 采集适配层 + 交互式 HTML 报告生成器 + CLI(caliper)/ stdio MCP Server。
  • 26 条跨端几何、光学与多图层规则:
    • 稀疏像素导轨与确定性有界聚类(X/Y 同行对齐、跨区对齐、高度与基线偏差)
    • 11 条间距、卡片内边距、二维 X 分桶碰撞/拥挤、内容裁切溢出、移动端安全区(导航栏子树自动豁免)与触摸热区、可选网格节奏规则
    • 像素墨迹光学检测(胶囊/按钮/纯描边输入框文字居中、图标分离、拉丁下伸字母容差保护、视口裁断自动跳过)
    • 多图层浮层隔离与安全自动巡检(下拉菜单、Tab 面板、Dialog/AlertDialog 与嵌套子菜单,自动检测锚点对齐、间隙/遮挡与视口溢出)
  • 交互式离线报告 & 零原生编译依赖:纯 TypeScript PNG 编解码与 Node 离线红线合成,输出带 2x 局部特写并列对比墙的独立 report.html 与 report.json。

安装与快速体验

在 npm 正式发布前,可直接从本 Release 附件的 .tgz 安装:

npm i -g https://github.com/ShellMonster/ui-caliper/releases/download/v0.2.1/ui-caliper-0.2.1.tgz
caliper doctor
caliper scan http://127.0.0.1:4173/ --viewports 13inch,27inch-1080p --explore-layers --out ./reports/check

验证状态

  • pnpm typecheck && pnpm build && pnpm test:6 个测试套件,62 / 62 全部通过(含 2,000 网格 + 1,200 密集重叠压测 < 80ms 与真机 Chromium 集成测试)。