-
Notifications
You must be signed in to change notification settings - Fork 19k
feat(agent): similar to the start node of workflow, agent variables also support drag-and-drop #26899
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(agent): similar to the start node of workflow, agent variables also support drag-and-drop #26899
Conversation
…lso support drag-and-drop
Summary of ChangesHello @yangzheli, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly improves the usability of agent variable management by implementing drag-and-drop reordering. This feature provides a more intuitive way for users to organize their variables, aligning the experience with similar functionalities found in workflow start nodes and contributing to a more flexible and user-friendly configuration interface. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request introduces drag-and-drop functionality for agent variables, which is a great usability improvement. The implementation uses react-sortablejs. However, I've found a couple of critical issues in how it's being used in web/app/components/app/configuration/config-var/index.tsx that would lead to incorrect behavior after reordering variables. Specifically, the use of unstable IDs for sortable items and an incorrect rendering loop will cause event handlers for editing or removing variables to target the wrong items. A similar pre-existing issue was identified in web/app/components/workflow/nodes/start/components/var-list.tsx, which was refactored in this PR. I've provided detailed comments and code suggestions to address these critical problems.
web/app/components/workflow/nodes/start/components/var-list.tsx
Outdated
Show resolved
Hide resolved
|
/gemini review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request introduces drag-and-drop reordering for agent variables, making it consistent with the behavior of start node variables in a workflow. The implementation uses react-sortablejs and includes related UI changes for the drag handle. Additionally, there are some beneficial refactorings in the start node's variable list component, such as using more stable keys for list items.
My review focuses on the choice of keys for the sortable list items. While the change from using an index to a variable name as a key is an improvement for reordering, it can cause issues when the variable name itself is editable, which appears to be the case. I've provided two comments with suggestions on how to address this to ensure stable component identity during edits.
…lso support drag-and-drop (#26899)
…lso support drag-and-drop (langgenius#26899)
Important
Fixes #<issue number>.Summary
fix #26507
refer to #22150
Screenshots
agent.mov
Checklist
dev/reformat(backend) andcd web && npx lint-staged(frontend) to appease the lint gods