Skip to content

Drag timeline images out into other apps - #3

Merged
kitlangton merged 1 commit into
mainfrom
drag-images-out
Nov 7, 2026
Merged

kitlangton merged 1 commit into
mainfrom
drag-images-out

Conversation

@kitlangton

Copy link
Copy Markdown
Collaborator

Images in a session couldn't be dragged out: pulling a tool's screenshot toward Finder did nothing.

Before: a thumbnail only opened the viewer on a press.
After: drag any image past a few points and it drops as its own file (PNG/JPEG, named for the attachment or the markdown source) into Finder, Messages, Slack or any app that takes files. A press still opens the viewer.

Covers prompt attachments and tool-result images (gallery/opens, which also covers composer chips), markdown images in replies, and the open full-size viewer. The drag uses Rune's El::drag_out; on drag start the original bytes are written once to $TMPDIR/opencode-drag/<hash>/<name>. media: refs and markdown images now keep their encoded bytes beside the decoded image so the file can be written.

Check Result
cargo test -p session-view images 12 passed (4 new, incl. a timeline thumbnail carrying drag-out with its file)
cargo test -p opencode-desktop same 67 failures as main on the same worker, none new
cargo check -p session-view --examples ok

Read: crates/session-view/src/images/drag.rs.

@github-actions

github-actions Bot commented Nov 7, 2026 •

Copy link
Copy Markdown

PR test build retired — merged into main. Install or auto-update OpenCode (Rune) from https://anoma.ly/release/opencode-rune/desktop/dev/macos-arm64-dmg.

@kitlangton
kitlangton merged commit 067685b into main Nov 7, 2026
6 checks passed
Hona added a commit that referenced this pull request Nov 21, 2026
Hona added a commit that referenced this pull request Nov 21, 2026
Hona added a commit that referenced this pull request Nov 21, 2026
…ffset hit test and focused-frame walk (#444)

* feat(browser): add serialized per-tab InputGuard with scroll-offset hit test and focused-frame walk

* fix(browser): address all 5 READER-12 #444 blockers, 3 should-fix items, scoped revisions, and paired mouseReleased

* fix(browser): close READER-10 Critical #3/#7 in InputGuard, PointResolver, DropFiles, and start_drag
jlongster added a commit that referenced this pull request Dec 1, 2026
A key shared by several nodes becomes <nearest uniquely keyed ancestor>/<key>, else the path; a
clash left over gets #2, #3. Drive's SemanticSnapshot decode requires unique ids.

User decisions:
- Fix the Carbon review findings on gui-rune
jlongster added a commit that referenced this pull request Dec 1, 2026
…he image surface (#1904)

* feat(drive): serve OpenCode Drive's simulation UI endpoint headless

With OPENCODE_DRIVE set, the desktop app runs without a window in a host of its own (crates/rune-drive): a Rune runtime on the wall clock that answers the simulation protocol's ui.* requests over WebSocket, feeds keys and pointer input into Rune's routing, reads ui.state and ui.snapshot from the element tree, and renders ui.capture.image offscreen to PNG. It connects to Drive's server with --server and OPENCODE_SERVER_PASSWORD and opens a new session in Drive's project (--directory). Normal launches are unchanged.

User decisions:
- Add a gui-rune launch mode to OpenCode Drive that drives the Rune desktop app, headless

* feat(drive): declare the image surface and serve ui.captureImage

OpenCode's simulation protocol is now a core plus one module per surface. The Rune endpoint declares
the image surface and serves the core plus ui.captureImage (was ui.capture.image). It drops the
terminal-shaped ui.capture text approximation and no longer advertises ui.recording.finish, which
belong to the terminal surface.

User decisions:
- Per-surface simulation protocol extensions, defined in OpenCode's protocol package (one module per surface)
- Redo before merging

* fix(drive): scroll the right way, keep wakes flowing, and tighten ui.press and ui.click

- ui.mouse scroll: wheel_xy's positive deltas move content right and down, so Up is +dy and Down -dy
- the host loop handles a Wake taken between requests: it clears pending and frames before the next
  request (or at the end), instead of discarding it and muting the app's wakes for up to a second
- ui.mouse applies its modifiers (held as PhysicalInput::Modifiers, and on the wheel event)
- ui.press: " " and space stay Text(" ") with modifiers; arrowup/del/pgup/pgdn/ins aliases;
  unknown multi-character names are refused rather than typed
- ui.click refuses an offset outside the element instead of clamping onto its edge
- run takes a TurnScope that wraps each frame and request turn

User decisions:
- Fix the Carbon review findings on gui-rune

* fix(drive): make semantic ids unique and steadier

A key shared by several nodes becomes <nearest uniquely keyed ancestor>/<key>, else the path; a
clash left over gets #2, #3. Drive's SemanticSnapshot decode requires unique ids.

User decisions:
- Fix the Carbon review findings on gui-rune

* fix(drive): answer a missing GPU with an error, refuse browser origins, forbid unsafe

- Pixels::new uses Gpu::try_new, so no adapter is a JSON-RPC error and the app keeps serving
- WebSocket upgrades with an Origin header are refused (403): browsers always send one, Drive's
  Bun client sends none
- #![forbid(unsafe_code)]; PNG Compression::Fast

User decisions:
- Fix the Carbon review findings on gui-rune

* fix(drive): run Drive's host in the app's turn scope, before window startup hooks

- each drive turn enters and leaves servers::runtime's scope, as a window's turn_scope does, so the
  ServerPeer goes back between turns
- the drive branch returns before the Mac launch, notification identity, GPU prewarm and app icon
- one Phase state machine replaces the ACTIVE/OPENED flags
- correct the module comment: RUNE_DIRS_ROOT is what isolates the profile

User decisions:
- Fix the Carbon review findings on gui-rune

* fix(drive): hold ui.mouse modifiers through the event's frames; exact arrow names

- ui.mouse released its modifiers before the frame that runs the queued press and drag
  handlers, so they saw none (a Ctrl-click on a session row or Shift-click on a button read as
  plain). The host now releases them after the frames that dispatch the event.
- keys: arrow names are matched exactly (up, arrow_up, arrowup, ...) rather than by stripping an
  "arrow" prefix, which let "arrowenter" through as Enter.
- inspect: a duplicated key on an element with an empty path falls back to a non-empty id.
- capture: Renderer::try_new, so a renderer that can't be made answers with an error.
- The waker's pending flag uses SeqCst on both sides.

User decisions:
- Fix the Carbon re-review findings on gui-rune

This branch was previously deployed

1 inactive deployment
release — fba1a470 Deployed Nov 7, 2026 by kitlangton via sign-macos #4
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