Conversation
…ze it for refreshing node data refactor: Enhance parameter selection logging in Node component for better debugging style: Fix SCSS formatting issues in Settings.module.scss
…gic for chat data
…d improve attachment handling in DefaultChatInterface
…Interface and DefaultChatInterface for enhanced workflow execution
There was a problem hiding this comment.
Pull Request Overview
This PR removes chat functionality and replaces it with node refresh capabilities, while enhancing workflow execution with collection support and improving Node component parameter handling. Key changes include removing chat-related components, APIs, and references while adding new node refresh functionality and better logging.
- Removed all chat-related components, APIs, and UI elements
- Added node refresh functionality to replace chat features
- Enhanced workflow execution with optional collection parameter support
Reviewed Changes
Copilot reviewed 9 out of 10 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| DefaultChatInterface.tsx | Enhanced with collection modal, attachment menu, and updated to use workflow API instead of chat API |
| ChatInterface.tsx | Simplified by removing chat API dependency and using only workflow execution |
| ChatPanel.tsx | Completely removed chat panel component |
| SideMenu.tsx | Commented out chat menu item and removed ChatPanel import |
| Node.tsx | Added boolean parameter support, enhanced logging, and default placeholder for dropdowns |
| workflowAPI.js | Added selectedCollection parameter to executeWorkflowById function |
| nodeAPI.js | Added refreshNodes function for node list refresh functionality |
| chatAPI.js | Completely removed chat API file |
| nodeHook.ts | Updated to use refreshNodes instead of exportNodes |
|
|
||
| const attachmentButtonRef = useRef<HTMLDivElement>(null); | ||
|
|
||
| // localStorage에서 선택된 컬렉션 정보 가져오기 |
There was a problem hiding this comment.
[nitpick] Comments should be in English to maintain consistency with the codebase. Consider translating Korean comments to English.
| // localStorage에서 선택된 컬렉션 정보 가져오기 | |
| // Retrieve selected collection information from localStorage |
| const checkSelectedCollection = () => { | ||
| try { | ||
| const storedCollection = localStorage.getItem('selectedCollection'); | ||
| if (storedCollection) { | ||
| const collectionData = JSON.parse(storedCollection); | ||
| setSelectedCollection(collectionData.name); | ||
| } else { | ||
| setSelectedCollection(null); | ||
| } | ||
| } catch (err) { | ||
| console.error('Failed to load selected collection:', err); | ||
| setSelectedCollection(null); | ||
| } | ||
| }; |
There was a problem hiding this comment.
The collection checking logic is duplicated in two useEffect hooks (lines 54-83 and 85-103). Consider extracting this into a single reusable function to reduce code duplication.
| const checkSelectedCollection = () => { | |
| try { | |
| const storedCollection = localStorage.getItem('selectedCollection'); | |
| if (storedCollection) { | |
| const collectionData = JSON.parse(storedCollection); | |
| setSelectedCollection(collectionData.name); | |
| } else { | |
| setSelectedCollection(null); | |
| } | |
| } catch (err) { | |
| console.error('Failed to load selected collection:', err); | |
| setSelectedCollection(null); | |
| } | |
| }; |
| } | ||
| }, [showCollectionModal]); | ||
|
|
||
| // 첨부 메뉴 외부 클릭 시 닫기 |
There was a problem hiding this comment.
[nitpick] Korean comment should be in English for consistency. Consider: '// Close attachment menu when clicking outside'
| // 첨부 메뉴 외부 클릭 시 닫기 | |
| // Close attachment menu when clicking outside |
| if (option === 'collection') { | ||
| setShowCollectionModal(true); | ||
| } | ||
| // TODO: 다른 옵션들에 대한 구현 |
There was a problem hiding this comment.
[nitpick] TODO comment should be in English for consistency. Consider: '// TODO: Implementation for other options'
| // TODO: 다른 옵션들에 대한 구현 | |
| // TODO: Implementation for other options |
| }} | ||
| className={`${styles.paramSelect} paramSelect`} | ||
| > | ||
| <option value="" disabled>-- Select --</option> |
There was a problem hiding this comment.
The default placeholder option is duplicated in both the regular select (line 128) and boolean select (line 170). Consider extracting this into a constant or component to maintain consistency.
| <option value="" disabled>-- Select --</option> | |
| <PlaceholderOption /> |
…on to const for better clarity
…for improved readability and maintainability
This pull request introduces several changes, focusing on replacing the chat functionality with a node refresh feature, improving workflow execution, and enhancing the Node component with better logging and support for boolean parameters. Additionally, unused chat-related components and APIs have been removed to streamline the codebase.
Removal of Chat Functionality:
ChatPanelcomponent and its associated logic, including thesendMessageandexecuteChatMessagefunctions fromsrc/app/api/chatAPI.js. This also involved removing references to chat functionality inSideMenu.tsxandChatInterface.tsx. [1] [2] [3] [4] [5] [6]Addition of Node Refresh Feature:
refreshNodesfunction insrc/app/api/nodeAPI.js, which fetches the latest node list after a forced refresh. Updated theuseNodeshook innodeHook.tsto use this new function instead ofapiExportNodes. [1] [2] [3]Workflow Execution Enhancements:
executeWorkflowByIdfunction insrc/app/api/workflowAPI.jsto optionally include aselectedCollectionparameter for better customization during workflow execution. [1] [2]Node Component Improvements:
Nodecomponent (Node.tsx) by adding detailed logs for parameter changes, including support for boolean parameters. Introduced a default placeholder option for dropdowns. [1] [2] [3]Code Cleanup:
ChatPanelcomponent and its styles, along with related imports and dependencies in various files. This simplifies the codebase and removes unnecessary functionality. [1] [2] [3] [4]