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

refactor: simplify hover controls, use CSS instead of react states, fix node flickering #82

Merged
merged 3 commits into from
Jan 7, 2025

Conversation

srijanpatel
Copy link
Collaborator

@srijanpatel srijanpatel commented Jan 7, 2025

This pull request includes significant changes to the BaseNode component in frontend/src/components/nodes/BaseNode.tsx. The primary focus is on removing state and event handlers related to hover effects and replacing them with CSS-based hover effects. This simplifies the component and reduces the amount of state management required.

The most important changes include:

Removal of State and Event Handlers:

  • Removed state variables isHovered, showControls, and isTooltipHovered which were used to manage hover effects.
  • Removed event handlers handleMouseEnter, handleMouseLeave, handleControlsMouseEnter, and handleControlsMouseLeave which were used to manage hover effects.

Simplification of Styles:

  • Updated the dynamic border width logic to remove dependencies on hover state and used CSS classes for hover effects instead.
  • Added the group class to the container div to enable group-based hover effects.
  • Updated Card component to use CSS-based hover effects for controls visibility, removing the need for hover state management.

Code Cleanup:

  • Converted single quotes to double quotes for consistency in class names.

@srijanpatel srijanpatel marked this pull request as ready for review January 7, 2025 21:24
Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

👍 Looks good to me! Reviewed everything up to 1712002 in 23 seconds

More details
  • Looked at 249 lines of code in 1 files
  • Skipped 0 files when reviewing.
  • Skipped posting 3 drafted comments based on config settings.
1. frontend/src/components/nodes/BaseNode.tsx:148
  • Draft comment:
    Remove unused import 'memo'.
  • Reason this comment was not posted:
    Confidence changes required: 50%
    The import statement for 'memo' is not used in the code. Unused imports should be removed to keep the code clean and efficient.
2. frontend/src/components/nodes/BaseNode.tsx:329
  • Draft comment:
    Remove the 'isHoverable' prop as hover effects are now handled by CSS.
  • Reason this comment was not posted:
    Confidence changes required: 50%
    The 'isHoverable' prop in the Card component is no longer necessary since hover effects are now handled by CSS. Removing it will clean up the code.
3. frontend/src/components/nodes/BaseNode.tsx:330
  • Draft comment:
    Remove the 'isHoverable' prop as hover effects are now handled by CSS.
  • Reason this comment was not posted:
    Confidence changes required: 50%
    The 'isHoverable' prop in the Card component is no longer necessary since hover effects are now handled by CSS. Removing it will clean up the code.

Workflow ID: wflow_2gETPIakkvUj6sUb


You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

👍 Looks good to me! Incremental review on 66a177c in 17 seconds

More details
  • Looked at 29 lines of code in 1 files
  • Skipped 0 files when reviewing.
  • Skipped posting 1 drafted comments based on config settings.
1. frontend/src/components/nodes/BaseNode.tsx:331
  • Draft comment:
    Consider moving group-hover:border-[3px] to a CSS file for consistency with CSS-based hover effects.
  • Reason this comment was not posted:
    Confidence changes required: 50%
    The use of group-hover:border-[3px] in the classNames prop of the Card component is inconsistent with the CSS-based hover effect approach. It should be moved to the CSS file for consistency and maintainability.

Workflow ID: wflow_nQwWFKvhgeMoR44x


You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

@srijanpatel srijanpatel changed the title refactor: simplify hover controls, use CSS instead of react states refactor: simplify hover controls, use CSS instead of react states, fix node flickering Jan 7, 2025
@JeanKaddour JeanKaddour merged commit affc72d into main Jan 7, 2025
@JeanKaddour JeanKaddour deleted the refactor/drop-hover-state-from-base-node branch January 7, 2025 22:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants