A QA engineer's toolkit: write bug reports in one line, and catch every place a website drifts from its Figma design.
BugLens has two tools that share one export format, so everything lands in the same spreadsheet your team already triages from.
| Bug Reporter | Figma vs Live | |
|---|---|---|
| Input | One or two sentences: "checkout button does nothing on iOS Safari" | A Figma frame link and the URL of the built page |
| Output | A complete, structured bug report: steps, expected/actual, severity, priority… | A list of every visual and content difference, each written up as a bug |
| Powered by | A local LLM through Ollama — nothing leaves your machine | The Figma REST API, headless Chromium and a deterministic diff engine |
Type a short description and get a full report with 17 fields: ID, title, date, bug type, module, platform, preconditions, numbered steps to reproduce, test data, expected result, actual result, error message, reproducibility, severity, priority, affected scope and status.
- One action per step. The prompt forces single physical actions — one click, one tap, one keystroke — starting from opening the app and ending at the failure.
- Honest about guesses. Values the model inferred rather than read from your description
are marked with
*; anything unknown is written as not specified, never a fake placeholder. - Project context. Set project, reporter, platform, module, severity hint and an ID prefix once; every report uses them, and IDs continue from the highest existing one.
- Spreadsheet-grade table. Inline cell editing, sort, filter by severity and type, regenerate a single row with a different interpretation, delete, undo.
- Sessions. Every session autosaves to history with an AI-generated title; rename, reload or delete sessions from the sidebar.
- Import & export. Import existing bugs from
.xlsx/.csv; export to Excel or CSV, or share via the system share sheet. - Keyboard first.
Ctrl+Entersubmit ·Ctrl+Zundo last row ·Deleteremove row ·Ctrl+Eexport ·Ctrl+Shift+Ssettings.
Paste a Figma frame link and a page URL. BugLens pulls the frame's layer tree from the Figma API, renders the page in headless Chromium at the frame's exact width, and compares the two element by element.
flowchart LR
F[Figma frame] -->|REST API| A["Flatten layers<br/><sub>text · font · colour · role<br/>coords relative to frame</sub>"]
L[Live URL] -->|Playwright| B["Capture leaf-text elements<br/><sub>computed styles · document coords</sub>"]
A --> M["Match text<br/><sub>exact → fuzzy, one-to-one</sub>"]
B --> M
M --> O["Estimate page offset<br/><sub>median of exact matches</sub>"]
O --> C["Checks"]
C --> R[Bug list → XLSX / CSV]
| Check | Reported when |
|---|---|
| Missing on Live | A text layer in the design appears nowhere on the page |
| Extra on Live | The page shows text no design layer contains (optional) |
| Text Mismatch | Text matched fuzzily — e.g. a typo or changed copy |
| Font Family | The first concrete family in the CSS stack differs from the design |
| Font Size | Size differs by more than 1px (High at 4px+) |
| Font Weight | Weight differs by 100 or more |
| Text Color | Colour distance exceeds a perceptible threshold |
| Alignment | Left / centre / right / justify differs (ignored where it can't be seen) |
| Position | An element is out of place after aligning the page to the design |
| Size | A text box's height differs — usually line-height or unexpected wrapping |
| Count Mismatch | Number of buttons, inputs, images or icons differs |
Naive design diffs flag everything. BugLens is built to report only real differences:
- Leaf-text extraction. Only elements that own their text are captured, so a
<div>never "contains" all of its children's copy and produces bogus matches. - One-to-one matching. Every design layer pairs with at most one page element, highest similarity first and nearest first among repeats — five "Learn more" links pair with the right five.
- Offset estimation. Real pages are centred, have headers above the fold, or sit inside a wider layout. The engine estimates the design→page offset from the median of exact matches before checking positions, so one shift doesn't produce a hundred position bugs.
- Role de-duplication. A Figma "Button" containing an icon and a label counts as one button, not three elements.
- Font-loader aware. Families renamed by
next/font(__Inter_a1b2c3,Inter Fallback) still matchInter. - Fonts settled. Capture waits for
document.fonts.readyand network idle, so metrics aren't taken from a fallback font.
The engine (src/lib/compareEngine.ts) is pure TypeScript with
no browser or network dependencies, and has its own test suite.
Count checks infer roles from layer names. Name layers the way you would anyway and they're
picked up: Button, Primary CTA, btn/submit → button · Input, Text field, Search bar
→ input · Icon/arrow, ic close → icon · any layer with an image fill, or Avatar,
Photo → image.
Requires Node.js 20+. For the Bug Reporter you also need Ollama.
git clone https://github.com/Aryapatel-007/BugLens.git
cd BugLens
npm install
npm run setup # downloads headless Chromium for Playwright (once)
ollama pull llama3.2-vision
npm run devOpen http://localhost:3000. The comparator is at Figma vs Live in the header, or http://localhost:3000/ui-compare.
Copy .env.example to .env.local to change the model or Ollama address:
OLLAMA_URL=http://localhost:11434
OLLAMA_MODEL=llama3.2-visionAny instruction-following model works; larger models write better reproduction steps.
- In Figma, open Settings → Security → Personal access tokens and create a token with read access to file content.
- Right-click the frame you want to check → Copy link.
- In BugLens, paste the token and the link, click Fetch Figma Elements.
- Enter the page URL (localhost dev servers work), adjust the position tolerance if your layout is fluid, and click Run Comparison.
- Filter by severity or issue type, expand rows for details, export to XLSX or CSV.
The token is only sent to Figma's API from your own BugLens server and is never stored.
| Command | What it does |
|---|---|
npm run dev |
Development server |
npm run build / npm start |
Production build / serve |
npm run setup |
Install Playwright's Chromium |
npm test |
Unit tests for the comparison engine |
npm run lint |
ESLint |
src/
app/
page.tsx Bug Reporter UI
ui-compare/page.tsx Figma vs Live UI
api/bug/generate one-line description → full report
api/bug/regenerate rewrite one report from a different angle
api/bug/title short session title
api/figma Figma frame → flattened, frame-relative layers
api/compare Playwright capture → comparison engine
lib/
compareEngine.ts matching, offset estimation, all checks (pure)
ollama.ts local LLM client
exportUtils.ts XLSX / CSV export and share
normalize.ts cleans up model output (steps, arrays)
types/
tests/ engine unit tests (node:test)
MIT © Arya Patel