Commit ca3c2a0
authored
✨ Add static HTML report generation for TDD run (#168)
## Summary
- Add static HTML report generation for `vizzly tdd run` that creates a
self-contained report at `.vizzly/report/index.html`
- Use SSR with React's `renderToString` for true static HTML output (no
JavaScript required to view)
- Add `--no-open` flag to skip auto-opening the report in browser
- Add `--keep-server` flag to use interactive live dashboard instead of
static report
- Clean up dead SPA static mode code that was never fully implemented
- Use native `<details>/<summary>` HTML elements for expand/collapse
functionality
<img width="1175" height="869" alt="image"
src="https://github.com/user-attachments/assets/a4648259-43c4-448a-bf7b-af284ed354b9"
/>
This should address #159
## Technical Details
**SSR Architecture:**
- New Vite SSR build config (`vite.ssr.config.js`) outputs
Node-compatible ES module
- Hook-free React component (`static-report-view.jsx`) for SSR
compatibility
- SSR entry point uses `renderToString` from `react-dom/server`
- CSS inlined in `<style>` tag, images copied to `report/images/` folder
**Report UI:**
- Dark theme with amber brand accent
- Grouped by status: Visual Changes → New → Passed (collapsed by
default)
- Side-by-side baseline vs current comparison when expanded
- Diff image shown separately below
- Summary bar with test counts and status
**Cleanup:**
- Removed `isStaticMode()` function from API client
- Removed unused `useStaticMode()` hook
- Removed static mode handling from TDD queries and SSE hooks
- Removed mock data from dev `index.html`
## Test plan
- [x] Run `vizzly tdd run "npm run test:reporter"` and verify static
report opens
- [x] Verify report works offline when opened as `file://` URL
- [x] Verify images load correctly in the static report
- [x] Test `--no-open` flag skips browser opening
- [x] Test `--keep-server` flag shows live dashboard instead
- [x] Verify build passes with `npm run build`
- [x] Verify existing tests pass with `npm test`1 parent 990cc5e commit ca3c2a0
File tree
17 files changed
+1415
-103
lines changed- clients/ember
- src/test-support
- src
- reporter
- src
- api
- components
- views
- hooks
- queries
- services
- utils
- tests
- services
- utils
17 files changed
+1415
-103
lines changedSome 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 | |
|---|---|---|---|
| |||
247 | 247 | | |
248 | 248 | | |
249 | 249 | | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
250 | 258 | | |
251 | 259 | | |
252 | 260 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
61 | | - | |
| 61 | + | |
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
| 66 | + | |
66 | 67 | | |
67 | 68 | | |
68 | 69 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
33 | 38 | | |
34 | 39 | | |
35 | 40 | | |
| |||
411 | 416 | | |
412 | 417 | | |
413 | 418 | | |
| 419 | + | |
414 | 420 | | |
415 | 421 | | |
416 | 422 | | |
| |||
449 | 455 | | |
450 | 456 | | |
451 | 457 | | |
452 | | - | |
| 458 | + | |
453 | 459 | | |
454 | 460 | | |
455 | | - | |
456 | | - | |
457 | | - | |
458 | | - | |
459 | | - | |
460 | | - | |
461 | | - | |
462 | | - | |
463 | | - | |
464 | | - | |
465 | | - | |
466 | | - | |
467 | | - | |
468 | | - | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
469 | 479 | | |
470 | 480 | | |
471 | 481 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | 12 | | |
21 | 13 | | |
22 | 14 | | |
| |||
53 | 45 | | |
54 | 46 | | |
55 | 47 | | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | 48 | | |
61 | 49 | | |
62 | 50 | | |
| |||
0 commit comments