Skip to content

fix(drive): render screenshots locally - #60

Merged
kitlangton merged 1 commit into
mainfrom
finish-extraction
Aug 14, 2026
Merged

fix(drive): render screenshots locally#60
kitlangton merged 1 commit into
mainfrom
finish-extraction

Conversation

@kitlangton

Copy link
Copy Markdown
Contributor

What

Make Drive own screenshot rendering. OpenCode now exposes terminal frame capture over the simulation bridge, while opencode-drive converts that frame to PNG and writes it into the active instance generation's media directory.

Before / After

Before: ui.screenshot crossed the simulation RPC boundary, so OpenCode's simulation package had to carry Canvas, fonts, and PNG rendering code. That coupled production OpenCode artifacts to Drive-only capture behavior.

After: Drive sends ui.capture, renders the returned RGBA frame locally, and writes the PNG itself. Named, visible, direct-endpoint, scripted, and restarted instances all resolve screenshots to the correct media generation.

How

  • Removes ui.screenshot from Drive's embedded OpenCode simulation protocol and keeps it as a Drive-level command.
  • Adds local captured-frame rendering and a screenshot-specific Effect error.
  • Persists each TUI's media directory in its runtime manifest and resolves CLI screenshots by active UI endpoint.
  • Extends renderer coverage for RGBA alpha, braille glyphs, and heavy vertical box continuity.

Scope

  • No historical screenshot RPC wire compatibility is retained.
  • Release target selection (latest, next, exact versions/tags, and --dev) remains separate work.

Testing

  • bun run check
  • bun run test
  • bun run release:validate
  • CLI integration coverage for named, nameless visible, direct endpoint, scripted, and post-restart screenshots

Flow

sequenceDiagram
  participant Caller
  participant Drive
  participant OpenCode
  participant Media
  Caller->>Drive: ui.screenshot(name)
  Drive->>OpenCode: ui.capture
  OpenCode-->>Drive: captured RGBA frame
  Drive->>Drive: render PNG
  Drive->>Media: write active generation/name.png
  Media-->>Caller: screenshot path
Loading

@kitlangton
kitlangton merged commit 30cbc47 into main Aug 14, 2026
1 check passed
@kitlangton
kitlangton deleted the finish-extraction branch August 14, 2026 16:41
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.

1 participant