Skip to content

Commit 0ae85fe

Browse files
rajbosCopilot
andcommitted
Add real webview screenshot capture using actual compiled bundles
New script capture-real-screenshots.js renders the real extension webview bundles (dist/webview/details.js, chart.js, usage.js, diagnostics.js) in headless Playwright/Chromium with: - VS Code Dark+ theme CSS variable values - acquireVsCodeApi() mock - Realistic sample data matching the exact window.__INITIAL_*__ shapes This produces pixel-accurate screenshots of the actual extension UI code -- same HTML, same CSS, same JS -- just rendered outside VS Code. - Update CI workflow to: npm ci, npm run compile, then capture-real - Add npm run screenshot:real script - Add harness HTML files to .gitignore Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 890545b commit 0ae85fe

File tree

4 files changed

+436
-11
lines changed

4 files changed

+436
-11
lines changed

.github/workflows/screenshot-generation.yml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,7 @@ on:
99
push:
1010
paths:
1111
- 'vscode-extension/src/**'
12-
- 'scripts/generate-all-previews.js'
13-
- 'scripts/capture-screenshots.js'
12+
- 'scripts/capture-real-screenshots.js'
1413
- 'test-data/**'
1514
- '.github/workflows/screenshot-generation.yml'
1615

@@ -28,23 +27,24 @@ jobs:
2827
uses: actions/setup-node@v4
2928
with:
3029
node-version: '20'
30+
cache: 'npm'
31+
cache-dependency-path: vscode-extension/package-lock.json
3132

32-
- name: Verify test data exists
33-
run: |
34-
echo "Checking test data..."
35-
ls -la test-data/chatSessions/
36-
echo "Found $(find test-data/chatSessions -name '*.json' | wc -l) test session files"
33+
- name: Install extension dependencies
34+
working-directory: vscode-extension
35+
run: npm ci
3736

38-
- name: Generate HTML previews from test data
39-
run: node scripts/generate-all-previews.js
37+
- name: Build extension (produces webview bundles)
38+
working-directory: vscode-extension
39+
run: npm run compile
4040

4141
- name: Install Playwright
4242
run: |
4343
npm install playwright
4444
npx playwright install chromium --with-deps
4545
46-
- name: Capture screenshots
47-
run: node scripts/capture-screenshots.js
46+
- name: Capture real screenshots
47+
run: node scripts/capture-real-screenshots.js
4848

4949
- name: List generated screenshots
5050
run: |

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ node_modules
1010
docs/images/screenshots/screenshot-instructions.html
1111
docs/images/screenshots/details-view-preview.html
1212
docs/images/screenshots/preview-*.html
13+
docs/images/screenshots/harness-*.html
1314
docs/images/screenshots/*.png
1415
example.json
1516
log-example.txt

0 commit comments

Comments
 (0)