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

Feature/ Major Refactor, Feature Enhancements, and UI/UX Improvements #99

Merged
merged 30 commits into from
Oct 22, 2024

Conversation

egenerse
Copy link
Contributor

@egenerse egenerse commented Oct 1, 2024

Summary

In this pull request, I undertook a large refactor of the project, transitioning from class components to functional components, updating the state management approach, and removing outdated packages. Additionally, I fixed several issues and improved the user experience.

Key Changes

  • Removed Class Components:
    All class components have been replaced with functional components using React hooks, improving the overall maintainability and readability of the codebase.
  • Updated Redux State Management:
    • Removed redux (4.2.1) and redux-observable (2.0.0), which previously added complexity through observable dispatch actions.
    • Installed @reduxjs/toolkit (2.2.7) to simplify the store setup and streamline state management, reducing boilerplate code.
  • Custom Hooks Implementation:
    Introduced new custom hooks to encapsulate complex logic, making the code easier to follow, particularly in user interactions like button clicks.

Feature Enhancements

  • GIVE_FEEDBACK and SEE_FEEDBACK fix:
    Give and see feedback was not working and fixed. Users can see their given feedback instantly.
  • Fixed Share and New Diagram Issues:
    Resolved bugs related to sharing, loading and creating new diagrams during share with any view to improve functionality.
  • Updated Create New Diagram Modal:
    Made the modal easier to use, enabling selection of new elements with double clicks for a smoother user experience.
  • Collaboration Modal Improvement:
    Added support for using the Enter key to submit inputs in the collaboration modal, improving accessibility and usability.

Motivation

  • Code Simplicity and Readability:
    The previous state management with redux-observable made it difficult for developers to trace the flow of actions and state changes. By moving to Redux Toolkit and functional components, the code is now more predictable and easier for new contributors to understand.
  • Future Scalability:
    This refactor prepares the codebase for easier implementation of future features. The adoption of hooks and Redux Toolkit offers a cleaner, more modern development experience.
  • Developer Experience:
    With a simpler structure, developers will find it easier to maintain and contribute to the project, enabling faster iterations and clearer separation of concerns.

UI/UX Improvements

  • Improved UI/UX:
    General improvements to the user interface and experience, including better element selection, modal updates, and input handling.

quick demo

Screen.Recording.2024-10-18.at.22.34.28.mov

@egenerse egenerse self-assigned this Oct 1, 2024
@egenerse egenerse marked this pull request as ready for review October 18, 2024 20:42
Copy link
Member

@farisd16 farisd16 left a comment

Choose a reason for hiding this comment

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

after fixing minor bugs found during testing, retested all functionality and everything worked as expected

Copy link
Contributor

@FelixTJDietrich FelixTJDietrich left a comment

Choose a reason for hiding this comment

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

It's a lot of code but looks really good. Thank you for migrating away from class components :) Really good job, also the simplification of state management looks good.

I found two issues, see below. Functionality wise it works great. Thanks for the additional fixes!

packages/webapp/src/main/components/.DS_Store Outdated Show resolved Hide resolved
packages/webapp/src/main/components/store/hooks.ts Outdated Show resolved Hide resolved
@egenerse egenerse changed the title Feature/redux toolkit migration Feature/Major Refactor and Migration to Redux Toolkit Oct 22, 2024
@egenerse egenerse changed the title Feature/Major Refactor and Migration to Redux Toolkit Feature/ Major Refactor, Feature Enhancements, and UI/UX Improvements Oct 22, 2024
@FelixTJDietrich FelixTJDietrich added the ready for merge PR is ready to be merged label Oct 22, 2024
Copy link
Contributor

@FelixTJDietrich FelixTJDietrich left a comment

Choose a reason for hiding this comment

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

I tested the functionality extensively now myself and can verify that everything worked as expected. I think this can be merged now.

Now even the "Give Feedback" and "See Feedback" is also not useless since it keeps the feedback in sync with the server. Great job!

@FelixTJDietrich FelixTJDietrich merged commit bb43939 into main Oct 22, 2024
2 checks passed
@FelixTJDietrich FelixTJDietrich deleted the feature/redux-toolkit-migration branch October 22, 2024 20:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready for merge PR is ready to be merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants