ui: Add a Desktop surface for the sandbox's Computer Use desktop (VNC) - #48
Merged
Merged
Conversation
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
Author
Desktop and Browser surfaces both landed additive changes in the same spots (ConversationAction, RightSurface, picker/plus rows, icon map). Desktop now uses the laptop icon since Browser took the monitor.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
A new right-pane surface, Desktop, that shows and drives the Keiki conversation sandbox's graphical desktop (Daytona Computer Use). Pairs with Mail-0/sms-kit#978, which mints the noVNC preview link.
Data path — no frames go through the platform:
crates/ui/src/desktop.rs(new, self-contained):connect()upgrades the preview URL towss, sets the token header, and bridges the tungstenite socket to atokio::io::duplexsovnc-rs'sVncConnectorsees a plain async stream.run_session()on the Tokio runtime: negotiatesZrle/CopyRect/Raw/DesktopSizewithPixelFormat::bgra(), pollsVncEvents into a sharedFramebuffer(BGRA, opaque), sendsX11Event::Refreshon a ~60 Hz cadence, and drains an input channel so pointer/key events stay ordered.Desktopentity: oneSignal::Frameper burst → newRenderImage, previous one evicted viawindow.drop_image(otherwise the atlas leaks). Pointer positions map through theObjectFit::Containletterbox; wheel ticks are RFB buttons 4–7; keys go out asheld modifiers ↓, key ↓↑, modifiers ↑using the typed char's keysym (Latin‑1 direct, otherwise0x01000000 + codepoint) or a named-key table.DesktopEvent::Gonewhen the open returns 404.keiki-api:ConversationAction::Desktop+Client::open_desktop(...) -> Result<Option<DesktopViewer>, _>— 404 isOk(None), the provider's word that the sandbox is gone.shell.rs:RightSurface::Desktop(u64)wired into the picker,+menu, tab strip (icons::MONITOR), close, and render. Gated bydesktop_offered()= Keiki chat and cached terminal availability (same sandbox record as the Terminal; no new availability endpoint). OnGonethe shell drops the tab and flips the cached availability tofalse, so the picker stops offering it.Deps:
vnc-rs 0.5,image 0.25(same major as gpui's, so itsFrameis the oneRenderImage::newtakes),tokio-tungstenite(already in workspace).Not touched: terminal transport, browser-view code, local-chat surfaces.
Verified:
cargo fmt --check,clippy --workspace --all-targets(no new warnings),cargo test --workspacegreen. Not yet exercised against a live sandbox — the noVNC path (/websockify) and no-auth VNC assumption follow Daytona'slaunch.sh --vnc localhost:5901 --listen 6080.Release Notes:
Link to Devin session: https://app.devin.ai/sessions/4bd4a708feed454e9aa48d0b31cc6b4a
Open in Devin Desktop: https://app.devin.ai/desktop/session/4bd4a708feed454e9aa48d0b31cc6b4a?variant=devin
Requested by: @MrgSub