feat(mobile): add React Native (Expo) companion app - #217
Conversation
Starting point for a phone companion app that consumes the existing Socket.IO shot stream from server.py, reusing the React/TypeScript stack already used by ui/src/.
Connects to the existing Socket.IO server, renders incoming shots (club / ball speed / carry) with a header row, and exposes a Simulate Shot control for testing against --mock backends.
The server URL field opened the keyboard with no way to close it except the return key. Wrap the screen in TouchableWithoutFeedback -> Keyboard.dismiss, make the shot ScrollView dismiss on drag and persist taps (so buttons still register), and set the URL field's return key to "done" with an explicit dismiss on submit.
|
Thanks for this! Would love for the community to test this out and provide some feedback before merging |
Yeah no problem! Let me add some instructions for running the dev build connected to the mock server |
| setConnectionState('disconnected'); | ||
| }, []); | ||
|
|
||
| const connect = useCallback(() => { |
There was a problem hiding this comment.
When a connection attempt has failed you are not able to connect again. App has to be reloaded to allow a new connection after an error state
There was a problem hiding this comment.
That's a good call. I have another branch with more features that this bug is fixed on. I wanted to get a quick PR up to discuss whether or not React native was the right path. Here's the phase 0 code if you're curious: dchasepdx#2
|
Closing this — superseded by the repo split. The mobile app now lives in its own repo, open-flight/openflight-mobile, so this no longer targets the right place. The work here isn't lost: I moved it with The |
Summary
Adds a React Native (Expo, SDK 54) mobile companion app under
mobile/. It connects to the existing Flask/Socket.IO server over the LAN and renders live shots.Why was this required?
The README lists a phone app as a wanted contribution. A native app is the foundation for future device-only capabilities (BLE/watch, GPS-based features) a browser can't reach. This PR is the scaffold plus a first useful screen; it does not touch the Python server or the web UI.
Automated tests
None in this PR.
mobile/has no test harness yet, and the repo's "tests included" PR gate only checkssrc/openflight/**andui/src/**, somobile/changes don't trigger it. Standing up jest-expo + React Native Testing Library is planned as a separate follow-up.Manual (human) testing
npx tsc --noEmitclean;npx expo export --platform webbundles clean.--mockserver, used Simulate Shot, and verified the current-shot tiles render — including the conditional Club Path / Spin Axis tiles and the confidence dots.