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

55 aligning animation and validation feedback for input components #60

Merged

Conversation

cheesea3
Copy link
Contributor

Pull Request: Enhanced Visual Feedback and Animations for Input Component

Overview

This pull request was originally to just reduce a series of enhancements to the Input component to improve the user experience by providing immediate and understandable feedback based on schema-driven validations. We ended up making additional changes align with the proposed task of refining animations and colors based on validation results, ensuring a more dynamic and cohesive user experience. This pull request introduces several key updates and enhancements across various components and configurations, aimed at improving functionality, user experience, and code maintainability.

Changes Made

  1. Environment Variables Update:

    • File: .env.example
    • Changes: Added GA_TRACKING_ID and MS_CLARITY_ID for Google Analytics and Microsoft Clarity integration.
    • Reason: To enable analytics tracking and user behavior insights.
  2. Authentication Enhancements:

    • File: app/auth/authenticator.server.ts
    • Changes: Added statusCode to the response object in registerUser function.
    • Reason: To provide more detailed feedback on registration status.
  3. Enhanced Animation and Styling Based on Validation Status:

    • File: Input.tsx
    • Details:
      • The Input component has been refactored to dynamically reflect validation status with refined animations and colors. This was achieved by defining variant types (default, error, success) and adjusting the component's styling based on these variants.
      • Benefits: Provides users with clear, instant feedback on their inputs, improving the overall usability of forms across the application.
  4. Standardization of Input Feedback:

    • File: InputField.tsx
    • Details:
      • A new InputField component was created to ensure consistent validation feedback across various forms such as sign-up and settings.
      • The component includes dynamic features like clear icons, password visibility toggles, and tooltip messages for improved user interaction.
      • Benefits: Ensures a uniform experience for users, regardless of which form they interact with, enhancing overall usability.
  5. Creation of InputProps.tsx:

    • File: InputProps.tsx
    • Details:
      • Input properties were abstracted into a separate file to enhance modularity and reusability. This file defines all input variants and states such as error, success, and warning, with corresponding styles.
      • Benefits: Facilitates easier maintenance and updates, allowing for scalable and consistent input component management.
  6. Button Component Updates:

    • Files: app/components/atoms/Button/Button.tsx, app/components/atoms/Button/ButtonProps.tsx
    • Changes: Introduced a disabled state with visual feedback (shake effect), updated CSS classes, and modified event handling.
    • Reason: To enhance user interaction by visually indicating disabled buttons and providing feedback on invalid actions.
  7. Heading Component Styling:

    • File: app/components/atoms/Heading/Heading.tsx
    • Changes: Updated the class names and added a fragment for improved styling.
    • Reason: To align the component's appearance with the overall UI design.
  8. New Logo Components:

    • Files: app/components/atoms/ImperfectAndCompanyLogo.tsx, app/components/atoms/ImperfectGamersLogo.tsx
    • Changes: Added new logo components with specific styles and animations.
    • Reason: To visually represent the Imperfect Gamers and Imperfect and Company brands.
  9. Input Component Refactor:

    • Files: app/components/atoms/Input/Input.tsx, app/components/atoms/Input/InputBase.tsx, app/components/atoms/Input/InputContainer.tsx
    • Changes: Refactored the Input component into smaller, reusable components and updated styles.
    • Reason: To improve maintainability and reuse across the project.
  10. Lottie Animation Integration:

    • File: app/components/atoms/LottieAnimation.tsx
    • Changes: Added a new component for rendering Lottie animations with support for looping.
    • Reason: To enhance the visual appeal with animated elements.
  11. Modal Component Enhancement:

    • File: app/components/atoms/Modal/Modal.tsx
    • Changes: Added support for responsive behavior and updated event handling.
    • Reason: To improve the modal's adaptability to different screen sizes and interaction scenarios.
  12. Styling Constants:

    • Files: Various styles files under app/components/atoms/styles/
    • Changes: Introduced style constants for animations, input borders, hover effects, and more.
    • Reason: To centralize styling and ensure consistency across components.
  13. Checkout Process Components:

    • Files: app/components/molecules/CheckoutProcess/*
    • Changes: Added components for managing the checkout process, including basket creation, package addition, and initiating the checkout flow.
    • Reason: To implement a structured and efficient checkout process for users.
  14. Password Field Enhancement:

    • File: app/components/molecules/ConfirmPasswordField/ConfirmPasswordField.tsx
    • Changes: Introduced a new component for handling password confirmation with enhanced styling and error messages.
    • Reason: To improve the user experience during password input and validation.
  15. Error Message Component:

    • File: app/components/molecules/ErrorMessage/ErrorMessage.tsx
    • Changes: Added a new component to display error messages with specific styles.
    • Reason: To provide clear and consistent feedback on form errors.
  16. Enhanced Login Form:

    • Files: app/components/molecules/LoginForm.tsx, app/components/molecules/LoginForm.1.tsx
    • Changes: Refactored the login form with better state management, form validation, and visual feedback.
    • Reason: To streamline the login process and provide a better user experience.

Technical Considerations

  • Backward Compatibility: Ensured that changes are backward compatible and do not affect existing functionalities where the new features are not necessary.
  • Extensive Testing: Conducted thorough testing to validate the new input behaviors across different user flows and form types, ensuring no regressions were introduced.

Conclusion

These enhancements significantly improve the user experience by providing immediate and dynamic feedback on input fields, ensuring consistent validation feedback, and enhancing the overall usability of the application.

cheesea3 added 30 commits May 9, 2024 17:03
future improvements => debounce, caching, screen-reader,
…tment

setup button disabled animation and accessible typography colors for form
Added custom lottie animation for successful registration and updated 'registered' state
next step - proper integration
additionally cleaned the modal title styling and added company related imprints
Stable and categorized by sequence. Poised for integrating inside separate components.
This commit refactors the checkout process into separate components for better code organization, reusability, and maintainability. The following changes have been made:

1. Created a new `BasketManager` component to handle basket creation and package addition logic.
2. Created a new `PackageManager` component to handle package-related operations, such as checking if a specific package is present in the basket.
3. Created a new `TebexCheckout` component to encapsulate the logic related to the Tebex checkout process, including initialization, event handling, and launching the checkout.
4. Refactored the `CheckoutProcess` component to act as the main container for the checkout process flow, orchestrating the interactions between the other components.
5. Updated the import statements and component usage throughout the codebase to reflect the new component structure.

This refactoring improves code organization by separating concerns into individual components, making the codebase more modular and easier to maintain. Each component has a well-defined responsibility, facilitating code reuse and testability.

While the overall functionality remains the same, the code is now more readable, maintainable, and extensible, making it easier to enhance or refactor specific parts of the checkout process without affecting the entire codebase.
additionally refactored dispatcher
Optimize button behavior with useCallback and state-driven animations

Implemented useCallback to optimize button click handling, ensuring that the click event is only redefined when necessary dependencies change. Introduced state management for the shake animation effect to dynamically update based on the button's disabled state. These changes enhance UI responsiveness and reduce unnecessary re-renders, improving overall performance and user experience in form interactions.

UserCard Enhancements:

Implemented hover animation functionality for the UserCard component to enrich user experience with interactive visual cues.
Added a new state variable isHovered to manage the hover state and integrated handleMouseEnter and handleMouseLeave event handlers to update this state.
Modified the LottieAnimation component to conditionally render animations based on the isHovered state, ensuring a dynamic response to user interactions.
Improved event handling by stopping propagation in hover event handlers to prevent glitches and unintended animation triggers when interacting with nested elements.
This commit improves the user interaction with the input field. It includes changes to move the cursor to the end of the input field when it is focused. This is particularly useful when the user interacts with the clear, visibility, or redo buttons. The commit also includes a fix for a timing issue that could prevent the cursor from being correctly positioned at the end of the input field.
This commit integrates Microsoft Clarity and Google Analytics into our application.

- Added Microsoft Clarity and Google Analytics initialization in `utils/msclarity.client.ts` and `utils/gtags.client.ts` respectively.
- Utilized the tracking IDs in `root.tsx`.
- Updated Privacy Policy and Terms of Service to include disclosures for Microsoft Clarity and Google Analytics.
- Added Microsoft Clarity ID and Google Analytics Tracking ID to the .env.example file.
- Updated Privacy Policy and Terms of Service to include disclosures for Microsoft Clarity and Google Analytics on main imperfectgamers.org site
fixed subsequent issue where back required 2 invokes on logout to return to welcome page from logout.
Detailed changes include:
- Fixed an issue in the useEffect hook handling fetcher responses to properly differentiate between success and error scenarios, ensuring the registrationSuccess state is only set true when registration is genuinely successful.
- Implemented conditional rendering to display a success view upon successful registration, enhancing user feedback and experience.
- Moved the handleClick function inside the SignUpForm component to improve encapsulation and maintainability of the event handling logic.
- Updated the main return logic to conditionally render the success view if the registrationSuccess state is true, ensuring that users see this screen only after a successful registration.
- Added logic to reset the form fields (email, password, and confirm password) upon successful registration, helping maintain a clean state for new interactions.
- Updated useEffect dependencies to trigger updateCloseInterceptReason when registrationSuccess changes, ensuring the reason for closing the modal is accurately updated in response to state changes.
- Added disabled support for field inputs
- Commented flash error messaging for future implementation refactor
Fix registration error handling to prevent previous errors from flashing before showing the success screen. Ensure error messages are cleared on successful registration and conditionally render errors only when not submitting.
this also resulted in finishing the task this branch was created from. Added minor details such as roles and added disabled testing kit flag switches. Refined colors for better contrast on imprints. Added autocomplete to inputfield. removed extra clarity loader issue.
need to consider linting each commit to avoid this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend Server-side development tasks dependencies Package version relevancy design UI/UX design tasks and improvements documentation Improvements or additions to documentation enhancement New feature or request frontend Tasks related to the client-side development performance Performance optimization and issues security Issues and improvements related to security
Projects
1 participant