Skip to content

fix(workbench): share-card highlight width, cursor, step-0, HiDPI - #30

Merged
hoce1n merged 1 commit into
mainfrom
260812-fix-share-image-render
Aug 12, 2026
Merged

hoce1n merged 1 commit into
mainfrom
260812-fix-share-image-render

Conversation

@monkeycode-global

Copy link
Copy Markdown
Contributor

Follow-up fix to the share-as-image feature (PR #29).

Changes

  • Active-line highlight now spans the full inner content width of the source panel, matching live CodeMirror's treatment, instead of being cut off at the rendered text width.
  • Removed the stray yellow cursor bar drawn left of the first line — a static export has no editor caret.
  • Step 0 (before any trace step is taken) no longer highlights line 1; the card renders a neutral top-of-file excerpt without implying the first line is executing.
  • The canvas backing store is now rendered at devicePixelRatio (capped at 3x) with a ctx.scale(dpr, dpr), so PNG exports stay sharp on HiDPI/retina displays. The exported image remains 1200x630 logical px; verified a deviceScaleFactor: 2 context produces a 2400x1260 PNG with measurably sharper edges.

Verification

  • Headless Chromium pixel checks: full-width highlight at left/mid/right sample points, zero yellow cursor-bar pixels at 1x and 2x, no highlight tint at step 0, 2400x1260 export at dsf=2.
  • npm run typecheck, npm run lint (0 errors), npm test (58 pass / 1354 expects), npm run build all green.

…I correctly

- Full-width active-line highlight matching live CodeMirror instead of an arbitrary text-width cutoff
- Remove the stray yellow cursor bar (static export has no editor caret)
- Step 0 (no trace step) renders no focus line instead of falsely highlighting line 1
- Render the canvas backing store at devicePixelRatio (capped at 3x) so exports stay sharp on HiDPI displays
Co-authored-by: monkeycode-ai <monkeycode-ai@chaitin.com>
@vercel

vercel Bot commented Aug 12, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
runtimejs Ready Ready Preview Aug 12, 2026 6:30am

@hoce1n
hoce1n merged commit 2df2ca3 into main Aug 12, 2026
3 checks passed
@hoce1n
hoce1n deleted the 260812-fix-share-image-render branch August 12, 2026 06:45

This branch was successfully deployed

1 active deployment
Preview — b4d1a541 Deployed Aug 12, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants