Commit 6f561f8
authored
✨ Add region sync for local TDD auto-approval (#191)
## Summary
Enables local TDD mode to use user-defined regions from the cloud
dashboard for auto-approving visual diffs. This brings feature parity
with the cloud product's region-based filtering.
**Phase 1 - CLI & API:**
- Add `POST /api/sdk/screenshots/regions` endpoint in cloud API
- Add `vizzly regions:sync` command with `--include-candidates` flag
- Auto-sync regions during baseline download when API token is
configured
- Store region data in `.vizzly/regions.json`
**Phase 2 - TDD Server & UI:**
- Add `POST /api/regions/sync` endpoint for UI-triggered sync
- Add 2D bounding box intersection calculation for region coverage
- Auto-approve comparisons when 80%+ of diffs fall within confirmed
regions
- Add "Sync Regions" button in Settings view
- Add region overlay visualization in fullscreen viewer (press `G` to
toggle)
- Extract `HotSpotOverlay` component to Observatory for sharing with
cloud
## How it works
1. Users confirm dynamic regions (timestamps, avatars, etc.) in the
cloud dashboard
2. CLI syncs these regions via `vizzly regions:sync` or Settings UI
3. During local comparisons, if 80%+ of diff clusters intersect
confirmed regions → auto-pass as "region-filtered"
4. Same behavior as cloud product, same 80% threshold
## Test plan
- [ ] Run `vizzly regions:sync` with valid API token - regions saved to
`.vizzly/regions.json`
- [ ] Start TDD server, open Settings, click "Sync Regions" - success
toast
- [ ] Create a diff that falls within a confirmed region - auto-passes
as "region-filtered"
- [ ] Open fullscreen viewer, press `G` - green region boxes appear on
screenshot
- [ ] Run `npm test` - all tests pass1 parent 60f7ade commit 6f561f8
17 files changed
Lines changed: 833 additions & 70 deletions
File tree
- .github/workflows
- src
- reporter/src/components
- comparison
- dashboard
- views
- server/handlers
- tdd
- core
- metadata
- services
- tests/tdd
- core
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
269 | 269 | | |
270 | 270 | | |
271 | 271 | | |
272 | | - | |
| 272 | + | |
273 | 273 | | |
274 | 274 | | |
275 | 275 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
119 | 119 | | |
120 | 120 | | |
121 | 121 | | |
122 | | - | |
| 122 | + | |
123 | 123 | | |
124 | 124 | | |
125 | 125 | | |
| |||
Lines changed: 49 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| 22 | + | |
22 | 23 | | |
23 | 24 | | |
24 | 25 | | |
| |||
101 | 102 | | |
102 | 103 | | |
103 | 104 | | |
| 105 | + | |
104 | 106 | | |
105 | 107 | | |
106 | 108 | | |
| |||
111 | 113 | | |
112 | 114 | | |
113 | 115 | | |
114 | | - | |
| 116 | + | |
115 | 117 | | |
116 | 118 | | |
117 | 119 | | |
| |||
291 | 293 | | |
292 | 294 | | |
293 | 295 | | |
294 | | - | |
| 296 | + | |
295 | 297 | | |
296 | 298 | | |
297 | 299 | | |
| |||
300 | 302 | | |
301 | 303 | | |
302 | 304 | | |
303 | | - | |
| 305 | + | |
304 | 306 | | |
305 | 307 | | |
306 | 308 | | |
| |||
320 | 322 | | |
321 | 323 | | |
322 | 324 | | |
| 325 | + | |
323 | 326 | | |
324 | 327 | | |
325 | 328 | | |
| |||
352 | 355 | | |
353 | 356 | | |
354 | 357 | | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
355 | 364 | | |
356 | 365 | | |
357 | 366 | | |
358 | 367 | | |
359 | 368 | | |
360 | | - | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
361 | 377 | | |
362 | 378 | | |
363 | 379 | | |
| |||
381 | 397 | | |
382 | 398 | | |
383 | 399 | | |
384 | | - | |
| 400 | + | |
385 | 401 | | |
386 | 402 | | |
387 | 403 | | |
| |||
523 | 539 | | |
524 | 540 | | |
525 | 541 | | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
526 | 556 | | |
527 | 557 | | |
528 | 558 | | |
| |||
661 | 691 | | |
662 | 692 | | |
663 | 693 | | |
| 694 | + | |
664 | 695 | | |
665 | 696 | | |
666 | 697 | | |
| |||
793 | 824 | | |
794 | 825 | | |
795 | 826 | | |
| 827 | + | |
| 828 | + | |
| 829 | + | |
| 830 | + | |
| 831 | + | |
| 832 | + | |
| 833 | + | |
| 834 | + | |
| 835 | + | |
| 836 | + | |
| 837 | + | |
| 838 | + | |
| 839 | + | |
796 | 840 | | |
797 | 841 | | |
798 | 842 | | |
| |||
Lines changed: 16 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
3 | 4 | | |
4 | 5 | | |
5 | 6 | | |
| |||
23 | 24 | | |
24 | 25 | | |
25 | 26 | | |
| 27 | + | |
| 28 | + | |
26 | 29 | | |
27 | 30 | | |
28 | 31 | | |
| |||
305 | 308 | | |
306 | 309 | | |
307 | 310 | | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
308 | 324 | | |
309 | 325 | | |
310 | 326 | | |
| |||
Lines changed: 9 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
58 | | - | |
| 58 | + | |
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
67 | 70 | | |
68 | 71 | | |
69 | 72 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
162 | 162 | | |
163 | 163 | | |
164 | 164 | | |
165 | | - | |
| 165 | + | |
166 | 166 | | |
167 | 167 | | |
168 | 168 | | |
| |||
179 | 179 | | |
180 | 180 | | |
181 | 181 | | |
182 | | - | |
| 182 | + | |
183 | 183 | | |
184 | 184 | | |
185 | 185 | | |
| |||
0 commit comments