Commit graph

5,805 commits

Author SHA1 Message Date
Cristhian Zanforlin Lousa
b1d09eaebd
feat: Add DataFrame color mapping and rose variables (#5587)
📝 (index.css): add new color variables for datatype rose and its foreground to improve design consistency
📝 (styleUtils.ts): add DataFrame color to nodeColorsName object for better visualization of dataframes in the frontend
2025-01-08 17:19:15 +00:00
Lucas Oliveira
723a31051e
feat: add ctrl+shift+z alternative shortcut for redoing actions (#5536)
* Added alternative for redo

* Added redo alternative on hotkeys

* added redo alternative type

---------

Co-authored-by: anovazzi1 <otavio2204@gmail.com>
2025-01-08 16:03:46 +00:00
Cristhian Zanforlin Lousa
f080049526
fix: add tests and adjustments to Chroma component (#5571)
* Refactor: Update EditNodeComponent to hide table options and block hide

* 🐛 (model.py): fix issue with search_documents method not returning empty list when search_query is empty
♻️ (model.py): refactor search_documents method to handle search_query logic more efficiently
📝 (chroma.py): add typing_extensions override import for build_vector_store method to improve code readability

*  (tests): add unit tests for ChromaVectorStoreComponent

- Introduced new test suite for ChromaVectorStoreComponent, covering various functionalities including database creation, collection management, similarity and MMR searches, and duplicate handling.
- Implemented tests for creating collections with and without data, ensuring proper functionality and data integrity.
- Verified search capabilities with different query types and result limits, enhancing overall test coverage for the component.

* fix: remove unnecessary whitespace in model.py and add missing import in chroma.py

* fix: mypy error module has no attribute "timeout"

* ♻️ (async_helpers.py): Remove unnecessary type hint ignore comment from timeout_context function

* 📝 (async_helpers.py): add a comment with issue reference PGH003 to document the reason for ignoring type checking in timeout_context function

* ♻️ (async_helpers.py): Remove unnecessary type hint comment to improve code readability and maintainability

* ♻️ (async_helpers.py): Add type ignore comment to suppress miscellaneous type error for timeout_context function

* ♻️ (async_helpers.py): refactor timeout_context function to remove unnecessary type ignore comments and improve code readability

* [autofix.ci] apply automated fixes

* 📝 (async_helpers.py): add a blank line for better code readability and consistency

* fix: mypy error: incompatible redefinition

---------

Co-authored-by: anovazzi1 <otavio2204@gmail.com>
Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
Co-authored-by: italojohnny <italojohnnydosanjos@gmail.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-01-08 13:01:39 +00:00
anovazzi1
19a18a090c
Fix: update viewBox dimensions in Langwatch component (#5560)
refactor: Update viewBox dimensions in Langwatch component
2025-01-07 16:44:08 +00:00
anovazzi1
f253246714
Refactor: update selectors in outdated message test (#5079)
* fix: add missing imports and update selectors in outdated message test

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-01-07 16:42:03 +00:00
Cristhian Zanforlin Lousa
af4fb3774e
feat: Revamp GlobalVariableModal (#5512)
* 📝 (GlobalVariableModal.tsx): Refactor GlobalVariableModal component to use Tabs component instead of Select for type selection and improve layout and styling of input fields and labels
🔧 (index.tsx): Add popoverWidth prop to InputComponent to allow setting the width of the popover in CustomInputPopover component
🔧 (index.tsx): Add popoverWidth prop to InputComponent in InputGlobalComponent to set the width of the popover to 315px

 (tabs-button.tsx): introduce new TabsButton component to handle tab functionality in UI components
📝 (tabs-button.tsx): add documentation for Tabs, TabsContent, TabsList, TabsTrigger components
📝 (components/index.ts): add popoverWidth property to InputComponentType to control the width of the popover in UI components

*  (GlobalVariableModal.tsx): Add ForwardedIconComponent to display an icon next to the modal header text for better visual representation
📝 (GlobalVariableModal.tsx): Update TabsTrigger components to include data-testid attribute for testing purposes

 (index.tsx): Introduce new components OptionBadge, CommandItemContent, and SelectionIndicator to improve code organization and reusability
♻️ (index.tsx): Refactor handleRemoveOption function to have a more descriptive parameter signature and improve readability
📝 (index.tsx): Add comments to clarify the purpose of handleOptionSelect function and improve code documentation
📝 (index.tsx): Add comments to describe the purpose of getInputClassName and getAnchorClassName functions for better code understanding

 (globalVariables.spec.ts): improve placeholder text for variable name and value fields for better user understanding and experience

* 🐛 (GlobalVariableModal.tsx): Fix disabled state logic for TabsTrigger components to correctly reflect initialData type
📝 (GlobalVariableModal.tsx): Update label for submit button to dynamically change based on the presence of initialData

* 🐛 (index.tsx): Fix issue where options were not being correctly memoized as a Set to prevent unnecessary re-renders. Update memoizedOptions to correctly memoize options as a Set.

* 📝 (userSettings.spec.ts): Update placeholder text for variable name and value fields to improve clarity and user experience.
2025-01-07 12:07:08 +00:00
anovazzi1
a57a49d48d
refactor: prevent tool mode on group component (#5522)
* Refactor nodeToolbarComponent to conditionally show tool mode button based on isGroup variable

* add toolModeGroup.spec.ts test

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-01-06 20:20:37 +00:00
Cristhian Zanforlin Lousa
2ed0b10679
fix(nightly): refactor freeze-path feature test (#5557) 2025-01-06 10:59:29 -08:00
Sebastián Estévez
63d649b0f4
feat: add anthropic mcp endpoint (#5148)
* mcp WIP

* [autofix.ci] apply automated fixes

* logging and flow user check

* mcp stdio client component

* handle disconnect better

* initialization

* session fix and type fix

* [autofix.ci] apply automated fixes

* defensive against mcp server bugs

* [autofix.ci] apply automated fixes

* notifications and sse component

* enabled flags and resource support

* remove unneeded print

* extract json schema util

* [autofix.ci] apply automated fixes

* ruff

* fix tools [] bug and db asysnc session api change

* Tool instead of StructuredTool

* ruff fixes

* ruff

* validation optimization

* fix frontend test

* another playwright fix

* Update src/frontend/tests/extended/features/notifications.spec.ts

Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>

* mcp component descriptions

* mypy fixes

* fix setup_database_url test

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
2025-01-03 04:45:54 +00:00
anovazzi1
bf7d089847
Refactor: Remove unused API functions (#5488)
* refactor: Remove unused api functions

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-01-01 03:37:13 +00:00
anovazzi1
52b2913abe
fix: Update dimensions of SvgLangwatch component (#5424)
refactor: update dimensions of SvgLangwatch component
2024-12-30 20:48:08 +00:00
Cristhian Zanforlin Lousa
eb120c116e
feat: enhance UX with clickable items and simplified structure (#5387)
🔧 (dropdownComponent/index.tsx): refactor dropdownComponent to improve code readability and remove unnecessary ShadTooltip component
2024-12-30 19:39:14 +00:00
Rogério Chaves
2ce33d41a8
fix(LangWatch): make current trace available for custom code to hook on to, allow to override input/output, fix icon (#5484)
* Call __enter__ to make current langwatch trace available globally so users can more easily add more context to it, like final input and output. This means also skipping setting the root_span input and output if already set

* Update LangWatch logo
2024-12-30 17:59:01 +00:00
Cristhian Zanforlin Lousa
86b3aefe89
fix: Prevent template value from overriding user input on tab switch (#5369)
* 🐛 (newChatView.tsx): fix issue where chat value was not being cleared when tab is hidden

* 🔧 (newChatView.tsx): refactor setting chat value to handle additional condition for better logic clarity
2024-12-30 13:40:01 +00:00
Gabriel Luiz Freitas Almeida
0118e98b5c
fix: adjust mouse actions in regression test for proper drag-and-drop (#5462) 2024-12-26 14:28:05 -08:00
Gabriel Luiz Freitas Almeida
5fd601bb77
tests: fix tests that use Chat Input (#5461) 2024-12-26 13:46:20 -08:00
Gabriel Luiz Freitas Almeida
d31be29245
fix: Update import path for IOModal to new naming convention (#5423) 2024-12-24 04:34:43 -08:00
Cristhian Zanforlin Lousa
4fec41fcce
perf: add useMemo to chatHistory to avoid unecessary renders on Playground (#5376)
* fix uncessary renders on chat

* 📝 (chat-view.tsx): optimize rendering performance by memoizing ChatMessage component and using memoized version for chat history items

* ♻️ (chat-view.tsx): refactor memoized ChatMessage component to include additional props for improved performance and accuracy
2024-12-24 01:16:36 +00:00
Lucas Oliveira
ca8f3cad62
feat: add generic handle that inherits colors for multiple types (#5414)
* Fixed HandleTooltipComponent to use the type instead of passed color

* Fixed handle colors to use the connected edge color

* Changed color of generic handle

* Fixed edge color when clicking for generic handles

* Updated sidebar filter to contain more than one type

* fixed gradient generalBugs
2024-12-23 22:18:11 +00:00
Lucas Oliveira
bd7f913d28
fix: add minimized attribute to components and make chatinput and chatoutput start minimized by default (#5374)
* Added Minimized field to backend to make component start as minimized

* Added minimized as true to chat components

* Added showNode default value as the opposite of minimized

* Changed starter projects to new components

* [autofix.ci] apply automated fixes

* [autofix.ci] apply automated fixes (attempt 2/3)

* Fixed Freeze and DecisionFlow tests

* Fixed other tests that involved chatoutput and chatinput

* Restored tests that didnt fail

* Fixed stop playground test

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-12-23 22:09:22 +00:00
Cristhian Zanforlin Lousa
b4673d3656
refactor(sidebar): Optimize FlowSidebarComponent with improved search and performance (#5411)
*  (flowSidebarComponent/index.tsx): reorganize imports and remove unnecessary comments for better code readability and maintainability
♻️ (flowSidebarComponent/index.tsx): refactor filtering logic to improve performance and readability
🔧 (flowSidebarComponent/index.tsx): update variable names and state management for better clarity and consistency
💡 (flowSidebarComponent/index.tsx): add comments and organize code structure for easier understanding and future development

📝 (flowSidebarComponent/index.tsx): refactor useEffect hooks to improve code readability and maintainability
📝 (flowSidebarComponent/index.tsx): refactor drag handling function to use useCallback for better performance
📝 (flowSidebarComponent/index.tsx): refactor bundle and category checks to use useMemo for better performance

* ♻️ (flowSidebarComponent/index.tsx): Remove unnecessary comments and optimize code readability by removing redundant comments and improving code structure.

* package-lock
2024-12-23 20:16:33 +00:00
Cristhian Zanforlin Lousa
c227a9b58d
refactor: update GlobalVariableModal description text (#5405)
📝 (GlobalVariableModal.tsx): update description text to remove incorrect information about encryption for better clarity
2024-12-23 18:55:43 +00:00
Cristhian Zanforlin Lousa
01c1d47ff5
refactor: Enhance error handling, message editing and prompt display (#5310)
* 📝 (newChatMessage.tsx): add event listener to handle tab visibility change and update state accordingly
📝 (newChatMessage.tsx): remove event listener when component unmounts to prevent memory leaks

*  (use-tab-visibility.tsx): introduce custom hook useTabVisibility to track tab visibility changes in the browser
📝 (newChatMessage.tsx, newChatView.tsx): import and use useTabVisibility hook to handle tab visibility changes and update chat behavior accordingly

* 📝 (newChatMessage.tsx): remove duplicate import of useTabVisibility and update import path
📝 (newChatView.tsx): remove duplicate import of useTabVisibility and update import path
 (use-tab-visibility.tsx): create a new custom hook to track tab visibility changes in the browser

* reducing to smaller components

* 📝 (frontend): remove unused imports and clean up code in various files to improve code readability and maintainability

* 📝 (editMessage/index.tsx): Rename EditMessage component to MarkdownField for better clarity and consistency
📝 (newChatMessage.tsx): Replace EditMessage component with MarkdownField component for rendering chat messages with markdown support
📝 (newChatView.tsx): Add conditional rendering to display a message when no chat messages are fetched

 (chatViewWrapper/index.tsx): Add messageFetched prop to ChatView component to handle messages fetching status and improve component functionality.

* prompt viedw

* Refactor chat view component and remove unused prop

* [autofix.ci] apply automated fixes

---------

Co-authored-by: anovazzi1 <otavio2204@gmail.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-12-19 19:50:05 +00:00
Raphael Valdetaro
9a8f721515
feat: Add OpenRouter component for multi-provider model access (#5271)
* feat: add OpenRouter component for multi-provider model access

- Add OpenRouter integration with provider-based model selection
- Support dynamic model fetching from OpenRouter API
- Implement temperature and max tokens controls
- Add site URL and app name for rankings
- Include model tooltips with context length and descriptions

* fix: restore SambaNova component in models __init__.py

* refactor: simplify OpenRouter build_model method

* [autofix.ci] apply automated fixes

* [autofix.ci] apply automated fixes (attempt 2/3)

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-12-19 19:29:45 +00:00
Cristhian Zanforlin Lousa
435d86067c
refactor: improve conditional rendering on panel buttons (#5365)
add render condition on modal buttons
2024-12-19 18:35:11 +00:00
VICTOR CORREA GOMES
81da524375
feat(components): add LangWatch evaluator component - New Bundle (#4722)
* feat(components): add LangWatch evaluator component

* feat(langwatch): add tracing integration and custom endpoint support

* style(langwatch): update component name and svg icon

* [autofix.ci] apply automated fixes

* Clean code with code formatting styles

* Add contexts and expected_output also as dynamic fields

* refactor(langwatch): remove redundant logging and improve type hinting

- Removed unnecessary logger exception calls in error handling sections to streamline the code.
- Added type hinting for the trace_id assignment to enhance code clarity and maintainability.

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Rogério Chaves <rogeriochaves@users.noreply.github.com>
Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
2024-12-19 18:26:10 +00:00
Cristhian Zanforlin Lousa
fa46786f47
fix: remove redundant memoization from parameter render components to fix input cursor position (#5347)
 (parameterRenderComponent/index.tsx): Refactor ParameterRenderComponent to improve code readability and maintainability. Remove unnecessary memoization and useCallback hooks, simplify component rendering logic, and optimize component structure.
2024-12-19 18:19:18 +00:00
Lucas Oliveira
c0ffb86c13
fix: make search on sidebar shortcut not be triggered inside inputs (#5345)
* added search components on sidebar shortcut

* Implemented search components sidebar shortcut on flow sidebar component

---------

Co-authored-by: Cristhian Zanforlin Lousa <cristhian.lousa@gmail.com>
2024-12-19 17:27:03 +00:00
Gabriel Luiz Freitas Almeida
be612eb6d3
test: Update test descriptions to indicate requirement for store API key (#5359)
* test: update test descriptions to indicate requirement for store API key

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-12-19 16:37:28 +00:00
Cristhian Zanforlin Lousa
ba7380824c
test: Enhance tool mode spec with zoom controls and drag-drop functionality (#5363)
 (tool-mode.spec.ts): add zoomOut utility function to enable zooming out on the page
📝 (tool-mode.spec.ts): update test case to include zooming out functionality using the new zoomOut utility function
2024-12-19 06:19:17 -08:00
Ítalo Johnny
2db5f93bd4
feat!: rename the type BaseChatMessageHistory to Memory (#5190)
* chore: rename the type BaseChatMessageHistory to Memory

* Added Memory type with same color as BaseChatMessageHistory

* [autofix.ci] apply automated fixes

---------

Co-authored-by: Lucas Oliveira <lucas.edu.oli@hotmail.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-12-18 22:10:01 +00:00
VICTOR CORREA GOMES
e79b1649a5
feat: add tool_mode parameter to MessageTextInput in ID Generator Component (#5311)
* feat: add tool_mode parameter to MessageTextInput for enhanced functionality

* fix: update tool mode test to ensure correct functionality and response handling

- Adjusted test to wait for the "Toolset" element to appear before asserting its count.
- Modified code handling to replace "tool_mode=True" with "tool_mode=False" and verified the updated code is different.
- Added response check for the custom component to ensure a successful status (200) after submission.

---------

Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
2024-12-18 21:54:13 +00:00
Lucas Oliveira
7d6d41aa87
refactor: update ReactFlow to v12 (#5317)
* Added xyflow and updated imports

* Fix changing node.width to node.measured.width

* Updated NodeType to follow new API

* Fixed note node data type

* Created AllNodeType to contain note node type

* Changed flow types to follow new type from reactflow 12

* Updated flowStore to work with new types

* Updated flowStore and reactFlowUtils to work with custom edge type

* Updated updateAllNodes to use new type

* Updated PageComponent to follow new names for node dragging and edge reconnect

* Made selected prop be optional

* Changed reactFlowInstance to have nodes and edges type

* Updated updateAllComponent to follow new types

* Updated ReactFlowUtils with new types

* Updated reactFlowUtils type

* Updated all reactFlowUtils to be generic

* Updated handleRenderComponent with Connection type

* Updated node description and name with null checks for names

* Added check if node is genericNode on nodeOutputField

* Updated note node type

* Updated nodestatus with selected null check

* Updated notenode with new node type

* Update NodeType imports to be AllNodeType

* Fix more lint issues

* Fixed react flow button css

*  (freeze.spec.ts): add zoomOut utility function to handle zooming out in tests for better code reusability and readability
📝 (decisionFlow.spec.ts): import zoomOut utility function to handle zooming out in tests for better code reusability and readability
📝 (zoom-out.ts): create zoomOut utility function to handle zooming out in tests for better code reusability and readability

* 🐛 (generalBugs-shard-10.spec.ts): fix test to wait for the element with class "border-ring-frozen" to be visible before asserting its count

* 📝 (generalBugs-shard-10.spec.ts): remove unnecessary locator click on element with id 'react-flow-id' to improve test reliability and maintainability

* 📝 (SelectionMenuComponent): add data-testid attribute to differentiate error-group-node and group-node components
📝 (similarity.spec.ts): refactor dragTo calls to use targetPosition for better accuracy, replace zoom_out clicks with zoomOut function, updateOldComponents function to handle outdated components
📝 (generalBugs-shard-5.spec.ts): replace zoom_out clicks with zoomOut function, add waitForSelector for group-node before clicking, remove unnecessary mouse interactions
📝 (intComponent.spec.ts): replace zoom_out clicks with zoomOut function, click on div-generic-node component
📝 (keyPairListComponent.spec.ts): click on div-generic-node component, adjustScreenView function call
📝 (nestedComponent.spec.ts): remove unnecessary click on react-flow-id element
📝 (generalBugs-shard-7.spec.ts): replace zoom_out clicks with zoomOut function

*  (stop-building.spec.ts): Add new utility functions to improve code modularity and readability
🔧 (stop-building.spec.ts): Refactor drag and drop operations to use utility functions for better maintainability
🔧 (stop-building.spec.ts): Refactor zoom out operations to use utility function for consistency
🔧 (stop-building.spec.ts): Refactor component positioning operations to use utility functions for clarity
🔧 (stop-building.spec.ts): Refactor outdated components and filled API keys handling to use utility functions for reusability
🔧 (stop-building.spec.ts): Refactor fit view operation to use utility function for consistency

*  (generalBugs-shard-9.spec.ts): refactor test to use initialGPTsetup function for GPT setup instead of manual steps to improve code readability and maintainability

*  (store-shard-2.spec.ts): Increase timeout for clicking "api-key-button-store" to 200000ms for better test stability
 (deleteComponents.spec.ts, deleteFlows.spec.ts, store-shard-1.spec.ts, store-shard-3.spec.ts): Increase timeout for clicking "api-key-button-store" to 200000ms for better test stability
 (store-shard-1.spec.ts, store-shard-3.spec.ts): Remove unnecessary waitForSelector and add timeout of 200000ms for clicking "api-key-button-store" for better test stability

*  (fileUploadComponent.spec.ts): update dragTo method calls with targetPosition option to specify the position of the drag action

*  (decisionFlow.spec.ts): add explicit wait for an element to be attached before interacting with it to improve test reliability
🐛 (sticky-notes.spec.ts): fix test by adding keyboard press to simulate pressing the Escape key to close a modal before checking text length

*  (sticky-notes.spec.ts): update assertion to use 'toHaveCount' matcher for improved test readability and reliability

* Added function to make controls horizontal

*  (sticky-notes.spec.ts): update selector for textMarkdown to improve test reliability and readability

---------

Co-authored-by: cristhianzl <cristhian.lousa@gmail.com>
2024-12-18 19:40:13 +00:00
Gabriel Luiz Freitas Almeida
1cda13d833
tests: Update tool mode test to use URL component instead of Astra DB (#5329)
fix: update tool mode test to use URL component instead of Astra DB
2024-12-18 04:58:47 -08:00
Cristhian Zanforlin Lousa
201d6c7639
fix: Fix tool mode switch state persistence in NodeToolbarComponent (#5316)
 (toggleShadComponent/index.tsx): Refactor ToggleShadComponent to wrap Switch component in a div to prevent event propagation
📝 (nodeToolbarComponent/index.tsx): Add ShortcutDisplay component to display keyboard shortcuts for tool mode button
📝 (nodeToolbarComponent/index.tsx): Remove unused imports (CodeAreaModal, ConfirmationModal, EditNodeModal, ShareModal) from NodeToolbarComponent
📝 (nodeToolbarComponent/index.tsx): Remove duplicated declaration of updateNodeInternals function in NodeToolbarComponent
📝 (nodeToolbarComponent/index.tsx): Refactor handleActivateToolMode function to update tool mode value and node data more efficiently
📝 (nodeToolbarComponent/index.tsx): Refactor handleNodeClass function to handle node class changes more efficiently
📝 (nodeToolbarComponent/index.tsx): Refactor postToolModeValue function to post tool mode value to API more efficiently
📝 (nodeToolbarComponent/index.tsx): Refactor renderToolbarButtons to include ShortcutDisplay component for tool mode button and improve button functionality

 (tool-mode.spec.ts): Add test for user interaction with components as tools in the application to ensure proper functionality and user experience.
2024-12-17 22:00:37 +00:00
Cristhian Zanforlin Lousa
b3b5290598
feat: introduce BundleItem component and memoize sidebar groups for performance (#5312)
 (index.tsx): introduce MemoizedSidebarGroup component to improve performance by memoizing sorted bundles calculation and rendering
📝 (bundleItems/index.tsx): add BundleItem component to render individual bundle items in the sidebar with collapsible functionality
2024-12-17 21:43:03 +00:00
Cristhian Zanforlin Lousa
5aa87ee41e
feat: improve chat scroll behavior during tab switches (#5308)
* 📝 (newChatMessage.tsx): add event listener to handle tab visibility change and update state accordingly
📝 (newChatMessage.tsx): remove event listener when component unmounts to prevent memory leaks

*  (use-tab-visibility.tsx): introduce custom hook useTabVisibility to track tab visibility changes in the browser
📝 (newChatMessage.tsx, newChatView.tsx): import and use useTabVisibility hook to handle tab visibility changes and update chat behavior accordingly

* 📝 (newChatMessage.tsx): remove duplicate import of useTabVisibility and update import path
📝 (newChatView.tsx): remove duplicate import of useTabVisibility and update import path
 (use-tab-visibility.tsx): create a new custom hook to track tab visibility changes in the browser

* refactor: Update logic to clear chat value when tab is hidden

The code changes in newChatView.tsx refactor the logic for clearing the chat value when the tab is hidden. Previously, the chat value was only cleared when there were no messages and the chat was not locked. Now, the chat value will also be cleared if the tab is hidden. This ensures that the chat input is empty when the user switches tabs.

---------

Co-authored-by: anovazzi1 <otavio2204@gmail.com>
2024-12-17 21:20:38 +00:00
anovazzi1
02fbb450db
feature: Add message feedback and update frontend interface (#5022)
* add style for message feedback

* add backend suprot to new feature

* update frontend interface and add handle function

* [autofix.ci] apply automated fixes

* Update tooltip content for bot messages

* Update evaluation icons styling

* Add custom thumb icons for thumbs up and thumbs down

* Add custom thumb icons for thumbs up and thumbs down

* Update thumb icons based on evaluation value

* [autofix.ci] apply automated fixes

* Update property name for positive feedback

* Update property name for positive feedback

* feat: Add data-testid attributes to helpful and not helpful buttons and update test of playground to include new functionality

* update test to include new message features
2024-12-17 19:09:06 +00:00
Lucas Oliveira
e15730173f
fix: update font size of prompt when validated (#5214)
Fixed prompt after validation not showing up correctly

Co-authored-by: Eric Hare <ericrhare@gmail.com>
2024-12-17 09:10:42 -08:00
Cristhian Zanforlin Lousa
2a95b52e06
perf: Optimize component with memoization and selective store subscriptions (#5296)
*  (NodeOutputfield/index.tsx): Introduce memoization for IconComponent, Button components, and OutputComponent for performance optimization
🔧 (NodeOutputfield/index.tsx): Change the import of 'useEffect' to 'useCallback' for better performance and to prevent unnecessary re-renders
🔧 (NodeOutputfield/index.tsx): Refactor the 'NodeOutputField' component to use useMemo for selective store subscriptions and computed values to improve performance and avoid unnecessary recalculations
🔧 (NodeOutputfield/index.tsx): Refactor the 'handleUpdateOutputHide' function to use useCallback for better performance and to prevent unnecessary re-renders
🔧 (NodeOutputfield/index.tsx): Refactor the 'useEffect' hook to include dependencies and prevent unnecessary re-renders
🔧 (NodeOutputfield/index.tsx): Refactor the 'Handle' component to use useMemo for memoization and performance optimization

 (NodeOutputfield/index.tsx): Refactor NodeOutputField component to improve readability and maintainability by extracting button and tooltip components into separate reusable components, and optimizing the structure of the output field rendering.

📝 (RenderInputParameters/index.tsx): Move sortToolModeFields import to the top of the file for better organization and readability.

 (GenericNode/index.tsx): Introduce memoization to optimize rendering performance by memoizing components and values
🔧 (GenericNode/index.tsx): Add useCallback to handleUpdateCode and handleUpdateCodeWShortcut functions for better performance and prevent unnecessary re-renders

📝 (GenericNode/index.tsx): Refactor code to use useEffect and useCallback hooks for better performance and readability
📝 (GenericNode/index.tsx): Refactor code to improve component structure and readability by extracting repeated logic into separate functions using useCallback
📝 (GenericNode/index.tsx): Refactor code to optimize rendering logic and improve maintainability by using memoization with React.memo

 (sort-tool-mode-field.ts): introduce a new helper function sortToolModeFields to sort fields based on tool mode status and field order array

* 📝 (NodeOutputfield/index.tsx): add missing newline before ShadTooltip component for better code readability

 (handleRenderComponent/index.tsx): Add memoization to HandleContent component for performance optimization
♻️ (handleRenderComponent/index.tsx): Refactor HandleContent component to use useCallback and useMemo hooks for better code readability and maintainability

🔧 (handleRenderComponent/index.tsx): Refactor code to improve readability and maintainability by updating function signatures, using hooks more efficiently, and organizing code structure.

 (file.ts): refactor handleMouseDown function to use useCallback hook for better performance and memoization
♻️ (file.ts): refactor handleClick function to use useCallback hook for better performance and memoization

♻️ (handleRenderComponent/index.tsx): Refactor handleRenderComponent to improve code readability and maintainability by extracting callback functions into separate useCallback hooks and using memoization for validation function.

* improve memo in several components

*  (handleRenderComponent/index.tsx): add data-testid attribute to handle element for improved testing and accessibility

*  (toolbar-button.tsx): add data-testid prop to ToolbarButton component for better testing capabilities
📝 (index.tsx): add data-testid attribute to various ToolbarButton components for better testability

*  (NodeOutputfield/index.tsx): Add onClick event handler to the InspectButton component to trigger a function when the button is clicked.

*  (freeze.spec.ts): add test case for clicking on "Close" button in the modal to ensure proper functionality

* 📝 (nodeToolbarComponent/index.tsx): remove unnecessary dataTestId attribute from freeze-path-button to clean up code and improve readability

* 🐛 (GenericNode/index.tsx): Fix potential error when outputs is null or undefined by adding optional chaining
🐛 (auto-save-off.spec.ts): Update selector for "Saved" text to target the last occurrence
🐛 (auto-save-off.spec.ts): Update selector for "Unsaved changes will be permanently lost." text to handle dynamic rendering
🐛 (auto-save-off.spec.ts): Update selector for "NVIDIA" text to ensure it is not visible
🐛 (auto-save-off.spec.ts): Update drag and drop logic for NVIDIA model to ensure correct behavior
🐛 (auto-save-off.spec.ts): Update hover logic and add component button handling for NVIDIA model to ensure correct behavior

*  (parameterRenderComponent/index.tsx): Refactor ParameterRenderComponent to improve performance by memoizing components and props, and using useCallback and useMemo for better optimization.

📝 (ui/disclosure.tsx): Update imports and add new React hooks for better code organization and performance
📝 (ui/disclosure.tsx): Refactor DisclosureProvider component to use useCallback and useMemo for better performance
📝 (ui/disclosure.tsx): Refactor DisclosureTrigger component to use useCallback and useMemo for better performance
📝 (ui/disclosure.tsx): Refactor DisclosureContent component to use useCallback and useMemo for better performance
📝 (ui/disclosure.tsx): Refactor Disclosure component to use memo for better performance
📝 (ui/disclosure.tsx): Refactor DisclosureTrigger component to use memo for better performance
📝 (ui/disclosure.tsx): Refactor DisclosureContent component to use memo for better performance
📝 (ui/disclosure.tsx): Refactor DisclosureProvider component to use memo for better performance
📝 (nodeToolbarComponent/index.tsx): Refactor NodeToolbarComponent to use useCallback and useMemo for better performance

*  (use-handle-new-value.tsx): Memoize postTemplateValue and updateNodeState functions to prevent unnecessary re-renders and improve performance
📝 (use-handle-new-value.tsx): Memoize handleOnNewValue function to optimize performance by preventing unnecessary re-renders and improve code readability

---------

Co-authored-by: Lucas Oliveira <62335616+lucaseduoli@users.noreply.github.com>
2024-12-17 14:05:13 +00:00
Cristhian Zanforlin Lousa
3fdb4e87ba
chore: remove console logs and unused imports (#5299) 2024-12-17 13:52:12 +00:00
anovazzi1
ba75a15548
Refactor: update selectItem component and remove unused imports (#5124) 2024-12-17 02:12:03 +00:00
Gabriel Luiz Freitas Almeida
ac356ec32f
chore: Fix audit vulnerabilities and update dependencies (#5257)
chore: fix audit vulnerabilities

- Updated "shadcn-ui" from version 0.8.0 to 0.9.4.
- Upgraded "@swc/cli" from version 0.3.12 to 0.5.2.
- Various other dependency updates and removals in package-lock.json to ensure compatibility and improve performance.

These changes enhance the project's dependency management and ensure the latest features and fixes are included.
2024-12-16 22:19:53 +00:00
dhlidongming
1ec63800b2
feat: implement pagination for transaction log queries (#5281)
* Add pagination support for transaction logs.

* [autofix.ci] apply automated fixes

* [autofix.ci] apply automated fixes (attempt 2/3)

* Replace 'TransactionData' with 'data' variable.

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-12-16 21:04:30 +00:00
anovazzi1
dffc2d51cd
feature: Improve Table customization to enhance ux on tool mode (#5216)
* refactor: Add field validation options to TableOptions

* refactor: Add field validation options and trigger text/icon to TableMixin

* refactor: Add field validation options and trigger text/icon to TableMixin

* refactor: Add field validation options and trigger text/icon to TableMixin

* update table trigger for toolmode usage

* Refactor table trigger and field validation options

- Updated the table trigger for toolmode usage
- Added field validation options and trigger text/icon to TableMixin
- Modified TableOptions to block certain actions and hide options

* Refactor TableOptionsTypeAPI field names for blocking actions

* Refactor TableOptions default values for blocking actions

* Refactor TableOptions default values for blocking actions

* Refactor TableOptions component to include tableOptions prop

* Refactor table selection and pagination options

* Refactor TOOL_TABLE_SCHEMA to disable sorting and filtering for the "name" and "description" fields

* Refactor TableOptions to allow blocking hiding of fields

* Refactor TableModal and TableNodeComponent to include support for block hiding columns

* Refactor Column model to include support for different edit modes

* Refactor TableOptions to include support for field parsers

* Refactor TableOptions to include support for field parsers and blocking hiding of fields

* Refactor TableOptions to include support for inline editing of fields

* Refactor App.css to style large text inputs and text areas in AgGrid

* update types

* Update table modal to prevent closing the the modal while editing cell

* Refactor string manipulation utilities to support parsing and transforming strings based on specified field parsers

* add inline input support

* Refactor TextModal component to remove close button in the footer

* add field parser in context

* format code

* format code

* Add disable_edit field to Column class

* Refactor TableNodeComponent to exclude columns with disable_edit field from being editable

* [autofix.ci] apply automated fixes

* Fix casing in selector text for "Open table" in tableInputComponent tests

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
2024-12-16 17:50:00 +00:00
Lucas Oliveira
f9c2c270da
fix: update hidden secret_str load_from_db when adding flow (#5289)
* Added updateGlobalVariables again to update the hidden secretstr parameters

* Fixed updateGroupRecursion calls
2024-12-16 15:45:48 +00:00
Jan Heimes
e8667009b7
feat: add needle as custom component (#4657)
* init: add needle as custom component

* [autofix.ci] apply automated fixes

* [autofix.ci] apply automated fixes (attempt 2/3)

* stage changes

* upgrate: langchain-community

* lint

* [autofix.ci] apply automated fixes

* techdebt: package-lock.json

* [autofix.ci] apply automated fixes

* techdebt: lint with working needle

* techdebt: use Component class and Integrate with other components

* techdebt: adjust needle component

* [autofix.ci] apply automated fixes

* lint

* fix: package json & lock not in sync

* chore: remove outdated dependencies from pyproject.toml

* Removed pyautogen and several langchain-related packages to streamline dependencies and reduce potential conflicts.

* [autofix.ci] apply automated fixes

* refactor: simplify needle component API key handling and clean up imports

* Streamlined API key retrieval by removing unnecessary SecretStr usage, defaulting to empty strings if keys are not provided.
* Consolidated import statements for better readability and organization.

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
2024-12-16 15:11:31 +00:00
Cristhian Zanforlin Lousa
0bdf317fe0
fix: add notifications UI and add integration test (#5286)
 (appHeaderComponent/index.tsx): Refactor AppHeader component to use AlertDropdown for notifications and improve user interaction with notifications tab
 (notifications.spec.ts): Add end-to-end test for user interaction with notifications tab in the frontend application
2024-12-16 14:30:01 +00:00
Cristhian Zanforlin Lousa
b50b6e2adb
fix: enhance confirmation modal with new UI properties (#5283)
 (nodeToolbarComponent/index.tsx): add new props 'cancelText', 'confirmationText', 'size', 'icon', and 'index' to enhance customization and functionality of the NodeToolbarComponent
2024-12-16 05:13:50 -08:00
Cristhian Zanforlin Lousa
d147a73c43
style: convert SVG attributes to React camelCase format (#5284)
📝 (AgentQL.jsx): Update attribute names from camelCase to PascalCase for consistency and better readability.
2024-12-16 05:12:09 -08:00