fix: Implement LanguageModel connection flow#9768
Conversation
…ing utility store state 🔧 (frontend): add useShallow hook to use-add-component for optimizing zustand store updates 🔧 (frontend): add useUtilityStore hook to use-add-component for managing awaitInputAgentModel state 🔧 (frontend): add useShallow hook to flowSidebarComponent for optimizing zustand store updates 🔧 (frontend): add useUtilityStore hook to flowSidebarComponent for managing awaitInputAgentModel state 🔧 (frontend): add useShallow hook to utilityStore for optimizing zustand store updates 🔧 (frontend): add awaitInputAgentModel state and setAwaitInputAgentModel function to utilityStore 🔧 (frontend): add awaitInputAgentModel state and setAwaitInputAgentModel function to utilityStore types in zustand folder
|
Note Other AI code review bot(s) detectedCodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review. Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the ✨ Finishing Touches🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Pull Request Overview
This pull request implements a new LanguageModel connection flow to streamline how users add and connect LanguageModel components. The changes introduce a coordinated workflow between the dropdown component and add component hook to automatically configure LanguageModel outputs when connecting models.
- Adds
awaitInputAgentModelstate to coordinate UI highlighting and automatic component configuration - Implements automatic LanguageModel output selection and filter reset in the add component hook
- Includes code consistency improvements with trailing comma cleanup and formatting standardization
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/frontend/src/types/zustand/utility/index.ts | Adds type definition for new awaitInputAgentModel state flag |
| src/frontend/src/stores/utilityStore.ts | Implements the awaitInputAgentModel state and setter in utility store |
| src/frontend/src/hooks/use-add-component.ts | Adds logic to automatically select LanguageModel output and reset filters when adding components |
| src/frontend/src/components/core/dropdownComponent/index.tsx | Integrates awaitInputAgentModel state into dropdown for "connect_other_models" workflow |
| src/frontend/src/pages/FlowPage/components/flowSidebarComponent/index.tsx | Code cleanup with trailing comma removal and filter name logic improvements |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
lucaseduoli
left a comment
There was a problem hiding this comment.
Can we make this more generic, allowing for other components to be selected depending on the component that has the Dropdown, not just the Agent?
…ing utility store state 🔧 (frontend): Add useUtilityStore hook to use-add-component for managing utility store state 🔧 (frontend): Add useUtilityStore hook to flowSidebarComponent for managing utility store state 🔧 (frontend): Add WaitForConnectionConfig interface to utilityStore types 🔧 (frontend): Update utilityStore to use WaitForConnectionConfig for awaitConnectionConfig
…ment to handle empty inputTypes array
done! thanks!! |
…cessary dependencies in useMemo and useCallback hooks ♻️ (dropdownComponent/index.tsx): Refactor code to remove redundant code and improve readability 📝 (dropdownComponent/index.tsx): Add missing import statement for useUtilityStore in dropdownComponent 🔧 (PageComponent/index.tsx): Update the usage of setAwaitConnectionConfig, setFilterType, and setHandleDragging to improve code structure and maintainability
…flow into cz/fix-llm-filter-agent
|
|
follow this PR #9787 |



This pull request introduces improvements to the dropdown component and the add component hook, primarily to support a new "connect other models" workflow that streamlines how users add LanguageModel components. The changes add a new state flag to coordinate UI and logic when connecting models, reset filters appropriately, and ensure consistent behavior across the dropdown and sidebar components. Additionally, there are minor code cleanups for consistency.
Dropdown and Add Component enhancements for LanguageModel workflow:
awaitInputAgentModelstate toutilityStore, and integrated its usage into the dropdown component (index.tsx) to trigger UI and logic changes when the "connect_other_models" option is selected. This ensures the UI highlights compatible handles and prepares for adding a LanguageModel component. [1] [2] [3]use-add-componenthook to check for theawaitInputAgentModelflag when adding components. If set, it automatically selects the LanguageModel output, resets all filters, and clears the flag after the component is added. This creates a seamless workflow for connecting models. [1] [2]Code consistency and cleanup:
Dropdown component logic refinements:
Sidebar component minor improvements:
These changes collectively improve the user experience when connecting LanguageModel components and ensure the codebase remains clean and consistent.
https://www.loom.com/share/51c4ff1c893b4ed7bddcbc7c22573c8c?sid=70e3f05d-f641-42e7-91d4-d7aab2471853