-
Notifications
You must be signed in to change notification settings - Fork 156
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Address getGamepads changes #72
Conversation
- Added dashboardWarningMessage to Status state - Display dashboardWarningMessage in OpModeView - Prevent app from crashing if navigator.getGamepads is not defined - Display dashboard warning if navigator.getGamepads is not defined
Thanks for the patch! Well done, especially considering your lack of React experience. The whole middleware mania was a bit misguided anyway. I like the explicitness of the sticky warning, but I worry that its persistence will annoy users and distract from normal RC errors.. I gather (perhaps incorrectly) that there are few gamepad users, and I'm more partial to a subtle indication like slashed gamepad icons with an explanatory tooltip. As always, I'm open to hearing alternate proposals. |
I'll see if I can manage crossing out the gamepads, CSS strikethrough property will probably cover it. When I do so would you like me to keep or discard the dashboardWarning related code. |
Strikethrough may work, though I'd recommend swapping out the normal icon for this one. Let me know if you want further pointers on the icon plumbing.
I'd prefer to keep that code out until a future juncture when a better warning candidate appears. |
I'd love to land this change or something similar in the next few weeks. Were you planning on making progress in that time frame? |
- Removed dashboardWarningMethod logic - Added gamepadsSupported to Status state - gamepad_not_supported.svg is displayed in place of gamepad.svg when gamepads are not supported - (Questionable) Tooltip logic informing the user that the gamepads are not supported.
Successfully implemented. Sorry for the delay! I had some trouble getting your |
For future reference, in case you're learning react, However, both types of components can exist in a tree so the solution to using them would be to create a separate functional component and just stick it in your class render function. Not necessary ofc! Just a hook for managing the tooltip state. |
That was quick! I agree with Noah that the component should be made functional and use the hook at some point in the future. I'm otherwise pretty happy with the implementation. |
* Address getGamepads changes - Added dashboardWarningMessage to Status state - Display dashboardWarningMessage in OpModeView - Prevent app from crashing if navigator.getGamepads is not defined - Display dashboard warning if navigator.getGamepads is not defined * Unsupported Gamepads now conveyed through icons - Removed dashboardWarningMethod logic - Added gamepadsSupported to Status state - gamepad_not_supported.svg is displayed in place of gamepad.svg when gamepads are not supported - (Questionable) Tooltip logic informing the user that the gamepads are not supported. Co-authored-by: Christian7573 <cag4561@gamil.com>
Handle
navigator.getGamepads()
not being defined instead of crashing, and display a warning to the user. Fixes #67. I've tested in Chrome and Firefox.There is a
setTimeout
ingamepadMiddleware.ts
that I'm not proud of, but it told me I couldn't dispatch while constructing the middleware. I've never touched React before, so I wouldn't know if there's a better way of achieving that ¯_(ツ)_/¯