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

chore(ui): upgrade deps and fix issues around nodes #337

Merged
merged 5 commits into from
Jul 16, 2024

Conversation

KaWaite
Copy link
Member

@KaWaite KaWaite commented Jul 16, 2024

Overview

What I've done

What I haven't done

How I tested

Screenshot

Which point I want you to review particularly

Memo

Summary by CodeRabbit

  • New Features

    • Enhanced route definitions with new properties like id and fullPath for better navigation.
  • Bug Fixes

    • Fixed node dragging issues in the editor by updating node handling logic.
    • Corrected initialization of editProject state in the dashboard.
  • Performance Improvements

    • Upgraded multiple dependencies to improve overall app performance and stability.
  • Refactor

    • Renamed and updated internal variable references in CustomHandle component.
    • Changed property name from parentNode to parentId for consistency in node data.
  • Chores

    • Routine dependency updates for various libraries and packages.

Copy link
Contributor

coderabbitai bot commented Jul 16, 2024

Walkthrough

The recent updates in the ui package focus on dependency upgrades to enhance features, fix bugs, and potentially improve performance. Notable changes include modifications to React components, hooks, route definitions, and handling of nodes and edges within the Editor feature. These updates aim to streamline operations, optimize rendering, and ensure better code maintainability.

Changes

Files Change Summary
ui/package.json Upgraded various dependencies like @phosphor-icons/react, @radix-ui, @tanstack, and others
ui/src/features/Dashboard/components/... Removed useEffect for generating sample workflows; changed editProject initialization
ui/src/features/Editor/components/Canvas/... Modified node dragging logic and position updates in useBatch.ts
ui/src/features/Editor/components/Canvas/... Introduced XYPosition type, adjusted parent-relative positions in useNodes.ts
ui/src/features/Editor/components/Nodes/... Renamed nodeInternals to nodeLookup in CustomHandle.tsx
ui/src/mock_data/nodeEdgeData.ts Renamed parentNode to parentId in Edge interface
ui/src/routeTree.gen.ts Added id and fullPath properties to routes, updated routeTree export

Poem

In the land of code, updates flow,
Dependencies rise, so our features glow.
Nodes align with precise position,
Handling edges with newfound precision.
Routes now travel with full paths clear,
A smoother journey for all to cheer.
🎉🛠️✨


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@github-actions github-actions bot added the ui label Jul 16, 2024
Copy link

netlify bot commented Jul 16, 2024

Deploy Preview for reearth-flow ready!

Name Link
🔨 Latest commit bfce91a
🔍 Latest deploy log https://app.netlify.com/sites/reearth-flow/deploys/6696143f6d45d20008233d53
😎 Deploy Preview https://deploy-preview-337--reearth-flow.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@KaWaite KaWaite self-assigned this Jul 16, 2024
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 9e0c8c2 and bfce91a.

Files ignored due to path filters (1)
  • ui/yarn.lock is excluded by !**/yarn.lock, !**/*.lock, !**/*.lock
Files selected for processing (7)
  • ui/package.json (1 hunks)
  • ui/src/features/Dashboard/components/MainSection.tsx (4 hunks)
  • ui/src/features/Editor/components/Canvas/useBatch.ts (1 hunks)
  • ui/src/features/Editor/components/Canvas/useNodes.ts (2 hunks)
  • ui/src/features/Editor/components/Nodes/GeneralNode/components/CustomHandle/CustomHandle.tsx (2 hunks)
  • ui/src/mock_data/nodeEdgeData.ts (1 hunks)
  • ui/src/routeTree.gen.ts (2 hunks)
Files skipped from review due to trivial changes (1)
  • ui/src/mock_data/nodeEdgeData.ts
Additional comments not posted (9)
ui/src/features/Editor/components/Nodes/GeneralNode/components/CustomHandle/CustomHandle.tsx (2)

12-12: Renaming variable for clarity.

The renaming of nodeInternals to nodeLookup improves the clarity and specificity of the variable name.


22-22: Update to handle connectability logic.

The changes ensure that the handle's connectability is dynamically determined based on the number of connected edges relative to a specified threshold. This is a sensible enhancement for functionality.

Also applies to: 27-27, 33-33

ui/src/features/Editor/components/Canvas/useBatch.ts (1)

13-13: Enhanced node handling logic in batch operations.

The modifications to the node handling logic, including setting a parentId and adjusting node positions relative to the hovered node, enhance the interactivity and accuracy of node placement on the canvas.

Also applies to: 14-15, 17-17, 22-26

ui/package.json (1)

33-71: Dependency updates reviewed.

All the dependencies have been updated to newer versions. It's important to ensure that these updates are tested thoroughly to catch any potential compatibility issues.

ui/src/routeTree.gen.ts (2)

88-125: Routing configuration enhancements.

The addition of id, path, and fullPath properties to route definitions enhances the clarity and manageability of the routing structure.


134-141: Update to route tree definition.

The routeTree has been updated to use rootRoute.addChildren({...}) instead of the previous array-based approach. This change likely improves the manageability and scalability of the route definitions.

ui/src/features/Editor/components/Canvas/useNodes.ts (2)

4-4: Addition of XYPosition import.

This addition supports the new feature of handling node positions more accurately, which is crucial for the changes made in the handleNodeDropOnEdge function.


111-115: Update to getBezierPath function parameters.

The update to use the newly calculated positions for sourceX, sourceY, targetX, and targetY is a logical follow-up to the changes in node position handling. This ensures that the visual representation of edges between nodes is accurate and consistent with their actual positions.

ui/src/features/Dashboard/components/MainSection.tsx (1)

46-46: Change in state initialization for editProject.

Initializing editProject to undefined is a thoughtful change that enhances user control over project selection. This prevents any project from being auto-selected on dashboard load, which could be crucial for user experience, especially in environments with many projects.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant