Skip to content

Add DOM-box quality metrics for Figma HTML artifacts#571

Merged
chubes4 merged 3 commits into
trunkfrom
fix/figma-html-dom-box-quality-gates
Jul 6, 2026
Merged

Add DOM-box quality metrics for Figma HTML artifacts#571
chubes4 merged 3 commits into
trunkfrom
fix/figma-html-dom-box-quality-gates

Conversation

@chubes4

@chubes4 chubes4 commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add a fixture-matrix DOM-box analyzer that converts captured rendered HTML boxes into actionable quality metrics and per-page findings.
  • Emit dom-box-quality.json beside captured dom-boxes.json during .fig -> HTML matrix runs and roll DOM metrics into fixture/matrix readiness totals.
  • Extend the DOM-box provider to include a bounded list of visible rendered elements missing the configured node-id attribute so missing data-figma-node-id boxes can be diagnosed.

Metrics added

  • dom_horizontal_overflow_count
  • dom_viewport_width_leak_count
  • dom_huge_vertical_spacing_count
  • dom_collapsed_box_count
  • dom_offscreen_box_count
  • dom_missing_node_id_box_count
  • per-page risk_score and risk_bucket, plus matrix rendered_dom_boxes risk category totals

Evidence

  • Verified existing Fisiostetic DOM-box capture with the new analyzer.
  • Sample local operator report: /var/folders/lr/c_cmmt7s0592m4njz99v5yb40000gn/T/opencode/figma-html-render-evidence-20260706/fisiostetic-dom-box-quality.json
  • Fisiostetic summary from that capture: 220 DOM boxes, 11 collapsed boxes, risk bucket high, no horizontal overflow or viewport-width leaks.

Tests

  • composer test in figma-transformer
  • npm ci in php-transformer/tools/visual-parity
  • npm test in php-transformer/tools/visual-parity
  • git diff --check

Limitations

  • The analyzer is threshold-based rendered DOM diagnostics; it does not compare against source screenshots or Figma geometry.
  • Existing historical dom-boxes.json files only expose missing node-id boxes if the provider/report included unidentified elements. New captures include a bounded unidentified_elements list.
  • Sample evidence path is local operator evidence, not reviewer-hosted artifact storage.

AI assistance

  • AI assistance: Yes
  • Tool(s): OpenCode with openai/gpt-5.5
  • Used for: Implemented the DOM-box analyzer, fixture-matrix wiring, provider diagnostics, tests, verification, and PR drafting under Chris's direction.

@chubes4 chubes4 merged commit 4fb50c2 into trunk Jul 6, 2026
1 check passed
@chubes4 chubes4 deleted the fix/figma-html-dom-box-quality-gates branch July 6, 2026 23:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant