Skip to content
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

Feat/virtual joystick #2

Closed
wants to merge 2 commits into from
Closed

Feat/virtual joystick #2

wants to merge 2 commits into from

Conversation

JWS-aAI
Copy link
Owner

@JWS-aAI JWS-aAI commented Nov 22, 2023

Feat/virtual joystick
New feature added: Basic Virtual Joystick

Hi, I decide implement this feature because it appears to be in high demand. Hope you find interesting.

Description:

  • Joystick can be activated by button on bottom (see picture)
  • For resolutions less than 650px wide it's active by default
  • When resolution ir less than 650px and chat is active, joystick is hidden because it interferes with the chat

Captura de Pantalla 2023-02-20 a las 1 20 20

For implement this, I use this component: https://github.com/elmarti/react-joystick-component

Note: This feature will conflict with this PR: #.62
I can take care of resolving conflicts

Related issues:

  • #.23
  • #.60

@JWS-aAI
Copy link
Owner Author

JWS-aAI commented Nov 22, 2023

Hi there,

Thank you for submitting the pull request for the new virtual joystick feature in the SkyOffice application. It's great to see contributions that enhance user experience, especially for mobile users. I've reviewed the changes, and I have some feedback and questions to ensure the feature integrates smoothly with the existing codebase.

General Observations

  • The feature's responsiveness to screen size and chat visibility is a thoughtful touch. It's good to see that you've considered different user scenarios.
  • The use of react-joystick-component seems appropriate for this feature. However, we need to ensure that adding this dependency aligns with the project's overall dependency management strategy.

Specific Feedback

Dependency Management

  • You've added react-joystick-component version ^6.0.0. Please confirm that this version is compatible with the current React version used in the project and that it doesn't introduce any breaking changes or conflicts with other dependencies.

Code Organization and Quality

  • The new file Joystick.jsx uses a .jsx extension, while the rest of the project seems to be using TypeScript (.tsx). For consistency and type safety, consider converting this to a TypeScript file.
  • In MyPlayer.ts, you've added a joystickMovement property and a handleJoystickMovement method. Ensure that these are integrated properly with the existing movement logic and that there are no conflicts or redundant code paths.
  • For PlayerSelector.ts, similar to MyPlayer.ts, ensure that the joystick input is handled in a way that doesn't conflict with existing input methods.

UI/UX Considerations

  • You've made several adjustments to styled components to accommodate the joystick. Please ensure that these changes do not negatively impact the layout or usability of other UI elements, especially on different screen sizes or orientations.
  • The toggle button for the joystick is a great addition. However, consider adding an accessible label or aria-label for screen readers to ensure the feature is accessible to all users.

Code Compatibility and Conflicts

  • You've mentioned that this feature will conflict with PR #.62. It's important to outline the specific areas of conflict and propose a plan for resolution. If possible, coordinate with the author of the other PR to minimize integration issues.
  • Ensure that the new setShowJoystick action in UserStore.ts is properly integrated with the rest of the Redux store and that it doesn't introduce any state management issues.

Testing and Documentation

  • Please provide unit tests for the new functionality to ensure that it works as expected and to prevent regressions in the future.
  • Update any relevant documentation, including the readme.md, to reflect the addition of the virtual joystick feature and any new controls or interactions it introduces.

Final Thoughts

Overall, the feature seems promising and could significantly improve the mobile user experience. However, it's crucial to maintain consistency with the existing codebase and ensure that the new feature is well-integrated, tested, and documented. Please address the points mentioned above, and feel free to reach out if you need any clarification or further discussion on any of the feedback provided.

Looking forward to seeing the refined implementation of the virtual joystick!

Best regards,
[Your Name]

Comment on lines 13 to 14
import { pushPlayerJoinedMessage } from '../stores/ChatStore'
import { ItemType } from '../../../types/Items'
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's good to see that you've added support for joystick movement in the MyPlayer class. However, please ensure that the handleJoystickMovement method is being called from the appropriate place in the code, such as from an event listener that responds to joystick movement events.

Comment on lines 24 to 25

// update player selection box position so that it's always in front of the player
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The integration of joystick movement into the PlayerSelector update method is well done. Just make sure to test this thoroughly to ensure that the player selection box behaves correctly with both keyboard and joystick inputs.

Comment on lines 20 to 21

const Backdrop = styled.div`
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please ensure that the change in the Backdrop styled component's bottom property from 0 to 60px does not cause any unintended layout issues, especially when the virtual joystick is not visible. Also, the change in max-width from 50% to 100% should be tested across different screen sizes to confirm that it does not negatively impact the chat UI on larger screens.

Comment on lines 32 to 33

.close {
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adjusting the close button position in the ComputerDialog to the top right corner with no offset is a good UI practice. However, please verify that this change does not overlap with any other UI elements and that it remains accessible across different screen sizes and resolutions.

Comment on lines 13 to 14
import ArrowRightIcon from '@mui/icons-material/ArrowRight'
import GitHubIcon from '@mui/icons-material/GitHub'
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding buttons to toggle the virtual joystick visibility is a user-friendly feature. However, please ensure that the tooltip text changes dynamically based on the joystick's visibility state and that the button is tested for accessibility, such as keyboard navigation and screen reader compatibility.

Comment on lines 14 to 15
height: 100vh;
overflow: hidden;
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes to the Backdrop and Wrapper styled components in WhiteboardDialog to take full width and height are appropriate for a full-screen modal. However, ensure that the min-width: max-content; style does not cause any horizontal scrolling or layout issues on smaller screens. Also, verify that the adjusted margin and close button position do not interfere with the whiteboard's usability or other UI elements.

Comment on lines 18 to 19
videoConnected: false,
loggedIn: false,
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The addition of the showJoystick state and the setShowJoystick reducer in the UserStore is well implemented. Please ensure that the initial state of showJoystick is set correctly across all platforms and that the state is updated appropriately when the window is resized.

@JWS-aAI JWS-aAI closed this Nov 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants