software-mansion / radon-ide

VSCode extension that turns your editor into a fully fledged IDE for React Native and Expo.
https://ide.swmansion.com
Other
867 stars 29 forks source link

Use touchX command with extra args to dispatch touch events to sim-server #543

Closed kmagiera closed 1 week ago

kmagiera commented 2 weeks ago

This PR builds on top of changes from https://github.com/software-mansion-labs/simulator-server/pull/173 where we add support for multitouch events to be dispatched to device (Android for the time being).

This change restructures the multitouch handling code both on the front-end and in extension code such that we follow the new protocol. Now, instead of having separate command for multitouch, we allow for the dispatchTouch method to take an array of touches (typically one or two). Then, we send touchDown or similar command with additional coordinates after the x and y of the first pointer are added.

The main change on the frontend was that we don't send leading point and anchor points but instead send two concrete touch points,. This removes coupling because sim-server and frontend code as otherwise we'd need to have code that calculates touch points on both sides (including logic related to rounding etc)

This PR also updates some parts of the rpc code that I needed for one stage of the changes since we werent handling null value correctly (which apparently has typeof = 'object' in JS)

Test plan

This has been tested on custom sim-server build that includes https://github.com/software-mansion-labs/simulator-server/pull/173 by opening an app with zoomable control on Android (I used photo gallery)

vercel[bot] commented 2 weeks ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
react-native-ide ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 17, 2024 0:45am