Skip to content

fix(web): stabilize device streaming, recording handoff, and panel lifecycle - #1069

Merged
badcuban merged 1 commit into
mainfrom
fix/device-client-web-audit
Nov 23, 2026
Merged

badcuban merged 1 commit into
mainfrom
fix/device-client-web-audit

Conversation

@badcuban

Copy link
Copy Markdown
Collaborator

Problem

Auditing the merged Device panel across packages/client-runtime and apps/web surfaced streaming reconnect loops, Android WebCodecs and AVD boot edge cases, React ref/keying lifecycle bugs, recording handoff data-loss paths, and a few UI gaps (including no way to reopen device setup from the picker on linked computers or the phone app).

Fix

Client runtime (packages/client-runtime/src/device/)

  • Stop reconnecting idle iOS streams every 16 seconds by arming the 15-second read watchdog only while waiting for the first frame.
  • Fall back to polled Android stills when WebCodecs rejects H.264, buffer and decode Android's first keyframe while configuring, throttle reset-video requests to 1 second, and reset cached screen/mode state on stop().
  • Harden hub transport against synchronous send/credit throws, malformed base64, mixed text/binary frames, and spurious 1006 errors during intentional close; add a zero-copy single-part binary path.
  • Fix split \r\n across chunks in the iOS event log SSE parser, filter Android accessibility nodes before applying the 500-element limit, propagate AbortError instead of swallowing it, cap iOS sendText at 256 characters, shrink MJPEG/AVCC buffers after spikes, cache the 2D canvas context, and add a 5-second timeout on iOS /foreground polling.

Web UI (apps/web/)

  • Key DevicePanel, DeviceWorkspace, and FloatingDevice by thread and device, clear per-environment device state on disconnect and unsubscribe, and avoid auto-opening the mobile right-panel sheet when an agent opens a device.
  • Select the booted emulator serial returned by openDevice when starting an Android AVD, await closeDevice before removing a chip, and add a Device settings button in DevicePicker to reopen setup.
  • Memoize canvas and container ref callbacks in DeviceStreamView so React 19 does not detach live canvases on rerender, add Shift+Escape blur escape, release held iOS keys on blur, guard zero-size coordinates, and send Duo visual coordinates for recording.
  • Pass deviceId, model, and physical into floating streams, keep floating drag state synchronous on pointer end, and keep the right edge anchored during left-edge resize near the margin.
  • Hide the iOS-only Shake button on Android, poll iOS /foreground only while Tools is open, fix touch keyboard IME composition and Android Backspace, use elevate-overlay and Escape close on the narrow Tools drawer, use text-destructive-foreground in DevicesSettings, and keep unselected chip menus visible on keyboard focus.
  • Add fast discard() on DeviceRecorder, propagate abort signals into screenshot capture, preserve recording files for download whenever they are not in persistedAttachments, and deduplicate concurrent saveComposerDraftAttachments calls for the same list without blocking newer edits behind stale reads.

Verification

  • vp fmt and vp lint (0 errors)
  • vp run --cache '@threadlines/client-runtime#typecheck' and vp run --cache '@threadlines/web#typecheck'
  • vp run --cache '@threadlines/client-runtime#test' (63/63)
  • vp run --cache '@threadlines/web#test' device (26/26) and composerDraft (93/93)
  • vp run --cache '@threadlines/web#test:browser' (118 files, 1,203/1,203 tests)
  • Visual polish screenshot check of DevicePicker and destructive error text in light and dark themes with bundled fonts loaded

…fecycle

Fixes client-runtime device transport and streaming issues (idle iOS 16-second reconnect loop, Android WebCodecs fallback and initial keyframe buffering, split CRLF SSE parsing, Android accessibility cap ordering, and transport error/close handling) along with web Device tab lifecycle, Android AVD boot selection, floating window coordinates, recording handoff preservation, and UI polish.
@vercel

vercel Bot commented Nov 23, 2026 •

Copy link
Copy Markdown

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

1 Skipped Deployment
Project Deployment Actions Updated
threadlines Skipped Skipped Nov 23, 2026 11:03pm UTC

Request Review

@badcuban
badcuban added this pull request to the merge queue Nov 23, 2026
Merged via the queue into main with commit 400b639 Nov 23, 2026
23 checks passed
@badcuban
badcuban deleted the fix/device-client-web-audit branch November 23, 2026 23:23

This branch was previously deployed

1 inactive deployment
Preview — 223f41dc Deployed Nov 23, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant