Repository navigation
feat(native): device panel first slice: setup, device list, iOS stream with touch and keys - #61
Merged
Merged
Conversation
…m with touch and keys
…d environments, probe on first load
Owner
Author
|
Review round 1, fixed in 18646fd:
Rebased on fork/native (no new commits). clippy (plain and snapshot) passes, and |
This was referenced Nov 2, 2026
Open
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.
Closes #59 (first slice).
Problem
The native client had no Device panel: no way to set up the device hub, list simulators and emulators, or watch and drive one from the right panel.
Approach
Follows the server-streamed Browser tab (#53): wire types and reducers in
crates/core, the stream incrates/client, views in a newcrates/app/src/device/.device.rs:DeviceServiceState(EAS and Simlock hosts merged intohosts, bad entries dropped, unknown statuses decode asUnknown), the selectors ofDeviceSetup.tsx,DevicePanel.tsxandDeviceHostUpdates.tsxwith their copy, and the hub URLs (/api/device-hub, mediawsTicketandhostId).device/stream.rsports the iOS half ofclient-runtime/src/device/stream.ts(serve-sim touch/button/key/orientation framing, screen config,rawPoint, rotation cycle, HID usages, close handling) plus an MJPEG multipart parser,screenAspect,screenRotationandfitDeviceFrame.right_panel.rsgains thedevicesurface andopenDevice.device_stream.rs: mints a media ticket, reads serve-sim's MJPEG feed (the web'spreferMjpegpath) and opens the HID socket once capture runs. Newest frame only through awatch, repeated stills skipped, a refused ticket re-mints at most 3 times in a row, and a refused or silent feed fails with the web's error and a Reconnect.device/: theDevicescontroller (subscribeDeviceStateper connection,device.listwhen the tab shows, per-thread open and power-off operations,settings:writegating),DevicePane(warnings, host updates, booting, errors, loading view, list with Open/Start),DeviceScreen(frame decoded and rotated upright off the UI thread, left-drag touches, HID keys and Shift/Control/Option, rail with Home, Rotate and More → Close device panel / Power off device, input-disconnected bar), andDeviceSetupDialog(three-step wizard rendered from the workspace).addDeviceSurfacedoes. A device tab that needs setup shows the wizard over it, and dismissing it closes the tab and keeps the panel open (onDismissSetup). Done from the launcher opens the device list.SurfaceKind, a launcher entry, a pane list, and a content arm. Thefiles/match gets the new arm, andworkspace.rsmounts the dialog. Two snapshot-only labels (launcher,device:list) make the evidence below reproducible.Ledger
PN-DEVICE →
partial, Nativecrates/app/src/device, crates/core/src/device.rs, crates/client/src/device_stream.rs, Issue #59. Not yet: Android, Simlock and EAS video (they stream H.264 or WebRTC; Android shows the web's no-decoder error), 3D phone, Duo and fold controls, device tools, appearance, text size and screenshot, float over chat, agent-opened device tabs, tab rename and platform tab icons.Evidence
The smoke server has the hub disabled and no simulators. Per the brief, I did not enable the hub, install anything or boot a simulator. I did not open the panel against the real-data server, because its tab probe (
device.list) may start helpers there. That means I could not capture the list and stream states in a window. Tests cover them instead.Screenshots (scratchpad):
/private/tmp/claude-501/-Volumes-DevSSD-t3code-native/3ca997f3-68be-482e-8fff-7893917dbe2a/scratchpad/nw59/real-setup.png/private/tmp/claude-501/-Volumes-DevSSD-t3code-native/3ca997f3-68be-482e-8fff-7893917dbe2a/scratchpad/nw59/device-launcher.png/private/tmp/claude-501/-Volumes-DevSSD-t3code-native/3ca997f3-68be-482e-8fff-7893917dbe2a/scratchpad/nw59/device-setup-dark.png,/private/tmp/claude-501/-Volumes-DevSSD-t3code-native/3ca997f3-68be-482e-8fff-7893917dbe2a/scratchpad/nw59/device-setup-light.pngTests:
t3-coredevice::tests(12): wire decoding, readiness, platform setup copy, grouping and messages, warnings and host updates, setup statuses, payloads and hub URLs, serve-sim framing and remap, socket messages and closes, transports, frame fitting and rotation, and the MJPEG parser (byte by byte, coalesced, no length, oversize resync).right_panel::tests::an_opened_device_takes_the_placeholder_tab_or_fronts_its_own(also covers dismiss keeping the panel open).t3-clientdevice_stream::tests::streams_newest_frames_and_sends_input_once_admittedanda_refused_feed_mints_new_access_then_gives_up, against an in-process fake hub (ticket, MJPEG feed, HID socket).Probe (
cargo run -p t3-client --example device_probe, smoke server, read-only):Gates:
cargo clippy --workspace --all-targets -- -D warnings(and with--features snapshot),cargo test --workspace(749 passed),node scripts/gen-theme.ts --check,node --test parity/sync.test.ts,node ../../apps/native/conformance/generate.ts --check,node apps/native/scripts/vendor-icons.ts --check.