Spaces:
Sleeping
Sleeping
File size: 3,880 Bytes
cfec14d |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 |
# ๐ UI Regression Testing Tool - Project Status
## ๐ Project Overview
**Goal**: Compare Figma designs with live websites to detect ALL visual differences (114 types across 15 categories)
**Approach**: Phased development with element-by-element comparison
---
## ๐ฏ Phase Status
| Phase | Description | Status |
|-------|-------------|--------|
| **Phase 1** | Core infrastructure + Visual overlay | ๐ข IN PROGRESS |
| **Phase 2** | Figma element extraction | โช Not started |
| **Phase 3** | Website DOM element extraction | โช Not started |
| **Phase 4** | Element-by-element comparison | โช Not started |
| **Phase 5** | Full 114-difference detection | โช Not started |
---
## ๐ฆ Phase 1: Core Infrastructure + Visual Overlay
### Goals:
1. โ
Clean project structure
2. โ
Screenshot capture (Figma + Website)
3. โ
Fix 2x scaling issue (Figma exports at retina)
4. โ
Visual diff overlay (side-by-side with red highlights)
5. โ
Improved UI with clear status/results
6. โ
Proper logging system
7. โ
Similarity scoring (normalized)
### Files Created:
```
ui-regression-v2/
โโโ app.py # Main Gradio interface
โโโ workflow.py # LangGraph workflow orchestration
โโโ state_schema.py # State definitions
โโโ requirements.txt # Dependencies
โโโ Dockerfile # HF Spaces deployment
โโโ README.md # HF Spaces config
โโโ PROJECT_STATUS.md # This file (for context)
โโโ agents/
โ โโโ __init__.py
โ โโโ agent_0_super_agent.py # Test plan generation
โ โโโ agent_1_design_inspector.py # Figma screenshot capture
โ โโโ agent_2_website_inspector.py # Website screenshot capture
โ โโโ agent_3_visual_comparator.py # Visual diff analysis
โโโ utils/
โ โโโ __init__.py
โ โโโ figma_client.py # Figma API integration
โ โโโ website_capturer.py # Playwright website capture
โ โโโ image_differ.py # Image comparison & overlay
โโโ data/ # Output directories
โโโ figma/
โโโ website/
โโโ comparisons/
```
### Key Decisions:
- Using Playwright for website screenshots
- Figma API for design screenshots
- PIL/OpenCV for image comparison
- Gradio for UI
- LangGraph for workflow orchestration
---
## ๐ฎ Upcoming Phases
### Phase 2: Figma Element Extraction
- Use Figma API to get all nodes (frames, components, text, etc.)
- Extract properties: position, size, color, text content
- Build element tree with hierarchy
### Phase 3: Website DOM Extraction
- Use Playwright to extract DOM elements
- Get computed CSS for each element
- Extract: buttons, inputs, text, images, etc.
- Match elements by type/position/content
### Phase 4: Element-by-Element Comparison
- Match Figma elements to Website elements
- Compare each property
- Detect: missing, extra, different elements
- Calculate per-element similarity
### Phase 5: Full 114-Difference Detection
- Implement all 15 categories from framework
- Layout & Structure (8 checks)
- Typography (10 checks)
- Colors & Contrast (10 checks)
- And 12 more categories...
---
## ๐ Important Information
### HF Space Configuration:
- SDK: Docker
- Port: 7860
- Python: 3.10
### Environment Variables Needed:
- `FIGMA_API_KEY` - Your Figma API token
- `HF_TOKEN` - (Optional) For enhanced AI analysis
### Figma File Requirements:
- File must have frames named with viewport (e.g., "Checkout-Desktop", "Checkout-Mobile")
- Frame widths: Desktop=1440px, Mobile=375px
---
## ๐ How to Continue Development
When starting a new chat with Claude:
1. Upload this `PROJECT_STATUS.md` file
2. Upload any files you want to modify
3. Say: "Continue UI Regression Tool from Phase X"
---
## ๐
Last Updated
Date: 2026-01-04
Phase: 1 (In Progress)
|