-
Notifications
You must be signed in to change notification settings - Fork 204
feat(browser-trace): add HTML report generation #86
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
shrey150
wants to merge
1
commit into
main
Choose a base branch
from
shrey/browser-trace-html-report
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+548
−0
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,182 @@ | ||
| <!DOCTYPE html> | ||
| <html lang="en"> | ||
| <head> | ||
| <meta charset="UTF-8"> | ||
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
| <title>Browser Trace — {{TITLE}}</title> | ||
| <link rel="preconnect" href="https://fonts.googleapis.com"> | ||
| <link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap" rel="stylesheet"> | ||
| <style> | ||
| :root { | ||
| --brand: #F03603; | ||
| --pass: #90C94D; | ||
| --fail: #F03603; | ||
| --blue: #4DA9E4; | ||
| --yellow: #F4BA41; | ||
| --black: #100D0D; | ||
| --gray: #514F4F; | ||
| --border: #edebeb; | ||
| --bg: #F9F6F4; | ||
| --card: #ffffff; | ||
| --text: #100D0D; | ||
| --muted: #514F4F; | ||
| } | ||
| * { margin: 0; padding: 0; box-sizing: border-box; } | ||
| body { font-family: Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif; background: var(--bg); color: var(--text); line-height: 1.6; font-size: 16px; } | ||
| .container { max-width: 960px; margin: 0 auto; padding: 2rem 1.5rem; } | ||
| code { font-family: 'Geist Mono', 'SF Mono', 'Fira Code', monospace; font-size: 0.8125em; background: #f6f5f5; padding: 0.125em 0.375em; border-radius: 2px; border: 1px solid var(--border); } | ||
|
|
||
| /* Header */ | ||
| header { margin-bottom: 2rem; display: flex; align-items: center; justify-content: space-between; } | ||
| .header-left h1 { font-size: 1.5rem; font-weight: 600; margin-bottom: 0.25rem; color: var(--black); } | ||
| .header-left h1 a { color: var(--brand); text-decoration: none; } | ||
| .header-left h1 a:hover { text-decoration: underline; } | ||
| .header-left .meta { color: var(--muted); font-size: 0.875rem; } | ||
| .header-logo { flex-shrink: 0; } | ||
|
|
||
| /* Summary bar */ | ||
| .summary { display: flex; gap: 0.75rem; margin-bottom: 1.5rem; flex-wrap: wrap; } | ||
| .stat { background: var(--card); border: 1px solid var(--border); border-radius: 4px; padding: 1rem 1.25rem; flex: 1; min-width: 120px; } | ||
| .stat .label { font-size: 0.6875rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); font-weight: 600; margin-bottom: 0.25rem; } | ||
| .stat .value { font-size: 1.5rem; font-weight: 700; color: var(--black); } | ||
| .stat .value.pass { color: var(--pass); } | ||
| .stat .value.fail { color: var(--fail); } | ||
| .stat .value.blue { color: var(--blue); } | ||
|
|
||
| /* Health bar */ | ||
| .health-bar { background: var(--card); border: 1px solid var(--border); border-radius: 4px; padding: 1rem 1.25rem; margin-bottom: 2rem; } | ||
| .health-bar .bar-track { height: 6px; background: #f6f5f5; border-radius: 3px; overflow: hidden; margin-top: 0.5rem; } | ||
| .health-bar .bar-fill { height: 100%; border-radius: 3px; } | ||
| .health-bar .bar-fill.good { background: var(--pass); } | ||
| .health-bar .bar-fill.warn { background: var(--yellow); } | ||
| .health-bar .bar-fill.bad { background: var(--fail); } | ||
|
|
||
| /* Section */ | ||
| .section { margin-bottom: 2rem; } | ||
| .section h2 { font-size: 1rem; font-weight: 600; margin-bottom: 0.75rem; display: flex; align-items: center; gap: 0.5rem; color: var(--black); } | ||
| .section h2 .count { font-size: 0.6875rem; font-weight: 600; border-radius: 2px; padding: 0.125rem 0.5rem; border: 1px solid var(--border); background: #f6f5f5; color: var(--muted); } | ||
|
|
||
| /* Page card */ | ||
| .page-card { background: var(--card); border: 1px solid var(--border); border-radius: 4px; margin-bottom: 0.5rem; overflow: hidden; } | ||
| .page-card.has-errors { border-left: 3px solid var(--fail); } | ||
| .page-card.clean { border-left: 3px solid var(--pass); } | ||
| .page-card summary { padding: 0.75rem 1rem; cursor: pointer; display: flex; align-items: center; gap: 0.75rem; list-style: none; } | ||
| .page-card summary::-webkit-details-marker { display: none; } | ||
| .page-card summary::before { content: '\25B6'; font-size: 0.5rem; color: var(--muted); transition: transform 0.15s; flex-shrink: 0; } | ||
| .page-card[open] summary::before { transform: rotate(90deg); } | ||
| .page-card .badge { font-size: 0.6875rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; padding: 2px 10px; border-radius: 2px; flex-shrink: 0; } | ||
| .page-card .badge.error { background: rgba(240,54,3,0.08); color: var(--fail); border: 1px solid rgba(240,54,3,0.2); } | ||
| .page-card .badge.clean { background: rgba(144,201,77,0.12); color: #5a8a1a; border: 1px solid rgba(144,201,77,0.3); } | ||
| .page-card .badge.page-id { background: #f6f5f5; color: var(--muted); border: 1px solid var(--border); } | ||
| .page-card .page-url { font-family: 'Geist Mono', 'SF Mono', 'Fira Code', monospace; font-size: 0.8125rem; color: var(--text); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; } | ||
| .page-card .page-meta { color: var(--muted); font-size: 0.8125rem; margin-left: auto; white-space: nowrap; } | ||
| .page-card .body { padding: 0 1rem 1rem 1rem; } | ||
|
|
||
| /* Domain breakdown */ | ||
| .domain-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 0.5rem; margin-bottom: 0.75rem; } | ||
| .domain-chip { background: #f6f5f5; border: 1px solid var(--border); border-radius: 4px; padding: 0.5rem 0.75rem; } | ||
| .domain-chip .domain-name { font-size: 0.6875rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); font-weight: 600; } | ||
| .domain-chip .domain-count { font-size: 1.125rem; font-weight: 700; color: var(--black); } | ||
| .domain-chip .domain-errors { font-size: 0.75rem; color: var(--fail); font-weight: 600; } | ||
| .domain-chip .domain-warnings { font-size: 0.75rem; color: var(--yellow); font-weight: 600; } | ||
|
|
||
| /* Network breakdown */ | ||
| .network-bar { display: flex; height: 6px; border-radius: 3px; overflow: hidden; margin: 0.5rem 0; background: #f6f5f5; } | ||
| .network-bar .seg { height: 100%; } | ||
| .network-bar .seg-ok { background: var(--pass); } | ||
| .network-bar .seg-fail { background: var(--fail); } | ||
| .network-types { display: flex; gap: 0.75rem; flex-wrap: wrap; font-size: 0.75rem; color: var(--muted); } | ||
| .network-types span { display: inline-flex; align-items: center; gap: 0.25rem; } | ||
|
|
||
| /* Error list */ | ||
| .error-list { margin-top: 0.75rem; } | ||
| .error-item { background: rgba(240,54,3,0.04); border: 1px solid rgba(240,54,3,0.12); border-radius: 4px; padding: 0.5rem 0.75rem; margin-bottom: 0.375rem; font-size: 0.8125rem; } | ||
| .error-item .error-kind { font-weight: 600; color: var(--fail); font-size: 0.6875rem; text-transform: uppercase; letter-spacing: 0.03em; } | ||
| .error-item .error-msg { color: var(--text); margin-top: 0.125rem; word-break: break-all; } | ||
|
|
||
| /* Screenshot */ | ||
| .screenshot { margin-top: 0.75rem; } | ||
| .screenshot img { max-width: 100%; border-radius: 4px; border: 1px solid var(--border); cursor: pointer; } | ||
| .screenshot .caption { font-size: 0.75rem; color: var(--muted); margin-top: 0.375rem; } | ||
|
|
||
| /* Screenshot timeline */ | ||
| .screenshot-timeline { display: flex; gap: 0.5rem; overflow-x: auto; padding: 0.5rem 0; } | ||
| .screenshot-timeline .thumb { flex-shrink: 0; width: 160px; cursor: pointer; } | ||
| .screenshot-timeline .thumb img { width: 100%; border-radius: 4px; border: 1px solid var(--border); } | ||
| .screenshot-timeline .thumb .caption { font-size: 0.6875rem; color: var(--muted); margin-top: 0.25rem; text-align: center; } | ||
|
|
||
| /* Lightbox */ | ||
| .lightbox { display: none; position: fixed; inset: 0; background: rgba(16,13,13,0.85); z-index: 1000; align-items: center; justify-content: center; padding: 2rem; cursor: zoom-out; } | ||
| .lightbox.active { display: flex; } | ||
| .lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 4px; } | ||
|
|
||
| /* Footer */ | ||
| footer { margin-top: 3rem; padding-top: 1.5rem; border-top: 1px solid var(--border); display: flex; align-items: center; justify-content: center; gap: 0.5rem; font-size: 0.75rem; color: var(--muted); } | ||
| footer a { color: var(--brand); text-decoration: none; font-weight: 500; } | ||
| footer a:hover { text-decoration: underline; } | ||
| footer svg { flex-shrink: 0; } | ||
| </style> | ||
| </head> | ||
| <body> | ||
|
|
||
| <div class="container"> | ||
| <header> | ||
| <div class="header-left"> | ||
| <h1>{{TITLE_HTML}}</h1> | ||
| <div class="meta">{{META}}</div> | ||
| </div> | ||
| <a href="https://browserbase.com" target="_blank" rel="noopener" class="header-logo" title="Powered by Browserbase" style="display:flex;align-items:center;gap:0.5rem;text-decoration:none;color:var(--muted);font-size:0.8125rem;font-weight:500;"> | ||
| <span>Powered by Browserbase</span> | ||
| <svg width="32" height="32" viewBox="0 0 100 100" fill="none" xmlns="http://www.w3.org/2000/svg"><rect width="100" height="100" rx="8" fill="#F03603"/><path d="M36 72.2222V27.7778H51.2381C57.5873 27.7778 62.6667 32.8571 62.6667 39.2063V41.746C62.6667 44.6667 61.5873 47.3968 59.7461 49.3651C62.2858 51.4603 63.9366 54.6349 63.9366 58.254V60.7936C63.9366 67.1428 58.8572 72.2222 52.508 72.2222H36ZM42.3493 65.873H52.508C55.3651 65.873 57.5873 63.6508 57.5873 60.7936V58.254C57.5873 55.3968 55.3651 53.1746 52.508 53.1746H42.3493V65.873ZM42.3493 46.8254H51.2381C54.0953 46.8254 56.3175 44.6032 56.3175 41.746V39.2063C56.3175 36.3492 54.0953 34.127 51.2381 34.127H42.3493V46.8254Z" fill="white"/></svg> | ||
| </a> | ||
| </header> | ||
|
|
||
| <div class="summary"> | ||
| <div class="stat"><div class="label">Pages</div><div class="value">{{PAGE_COUNT}}</div></div> | ||
| <div class="stat"><div class="label">Events</div><div class="value blue">{{TOTAL_EVENTS}}</div></div> | ||
| <div class="stat"><div class="label">Requests</div><div class="value">{{TOTAL_REQUESTS}}</div></div> | ||
| <div class="stat"><div class="label">Errors</div><div class="value fail">{{TOTAL_ERRORS}}</div></div> | ||
| <div class="stat"><div class="label">Duration</div><div class="value">{{DURATION}}</div></div> | ||
| </div> | ||
|
|
||
| <div class="health-bar"> | ||
| <div style="display:flex;justify-content:space-between;align-items:baseline;"> | ||
| <span style="font-size:0.875rem;font-weight:500;">Network Health</span> | ||
| <span style="font-size:1.25rem;font-weight:700;">{{HEALTH_RATE}}%</span> | ||
| </div> | ||
| <div class="bar-track"><div class="bar-fill {{HEALTH_CLASS}}" style="width:{{HEALTH_RATE}}%"></div></div> | ||
| </div> | ||
|
|
||
| <!-- ERRORS SECTION — only rendered if there are errors --> | ||
| {{ERRORS_SECTION}} | ||
|
|
||
| <!-- PAGES SECTION --> | ||
| {{PAGES_SECTION}} | ||
|
|
||
| <!-- SCREENSHOTS SECTION — only rendered if screenshots exist --> | ||
| {{SCREENSHOTS_SECTION}} | ||
| </div> | ||
|
|
||
| <div class="lightbox" id="lightbox" onclick="this.classList.remove('active')"> | ||
| <img id="lightbox-img" src="" alt="Screenshot enlarged"> | ||
| </div> | ||
|
|
||
| <footer> | ||
| <svg width="16" height="16" viewBox="0 0 100 100" fill="none" xmlns="http://www.w3.org/2000/svg"><rect width="100" height="100" rx="8" fill="#F03603"/><path d="M36 72.2222V27.7778H51.2381C57.5873 27.7778 62.6667 32.8571 62.6667 39.2063V41.746C62.6667 44.6667 61.5873 47.3968 59.7461 49.3651C62.2858 51.4603 63.9366 54.6349 63.9366 58.254V60.7936C63.9366 67.1428 58.8572 72.2222 52.508 72.2222H36ZM42.3493 65.873H52.508C55.3651 65.873 57.5873 63.6508 57.5873 60.7936V58.254C57.5873 55.3968 55.3651 53.1746 52.508 53.1746H42.3493V65.873ZM42.3493 46.8254H51.2381C54.0953 46.8254 56.3175 44.6032 56.3175 41.746V39.2063C56.3175 36.3492 54.0953 34.127 51.2381 34.127H42.3493V46.8254Z" fill="white"/></svg> | ||
| Generated by <a href="https://github.com/browserbase/skills">browser-trace</a> · Powered by <a href="https://browserbase.com">Browserbase</a> | ||
| </footer> | ||
|
|
||
| <script> | ||
| document.querySelectorAll('.screenshot img, .screenshot-timeline .thumb img').forEach(img => { | ||
| img.addEventListener('click', e => { | ||
| e.stopPropagation(); | ||
| document.getElementById('lightbox-img').src = img.src; | ||
| document.getElementById('lightbox').classList.add('active'); | ||
| }); | ||
| }); | ||
| document.addEventListener('keydown', e => { | ||
| if (e.key === 'Escape') document.getElementById('lightbox').classList.remove('active'); | ||
| }); | ||
| </script> | ||
| </body> | ||
| </html> | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Google Fonts CDN link violates offline requirement
Medium Severity
The template loads the Inter font from
fonts.googleapis.com, butSKILL.mdexplicitly requires "no CDN links, no external assets" so the report works offline. Opening the report without internet triggers failed network requests for the font stylesheet. The CSS fallback chain (-apple-system,system-ui, etc.) prevents total breakage, but the CDN links contradict the documented design constraint and the goal of a fully self-contained file.Reviewed by Cursor Bugbot for commit 64550b6. Configure here.