Skip to content

feat: Canvas toolbar update and enhancement#9239

Merged
deon-sanchez merged 133 commits into
mainfrom
lfoss-1889
Aug 25, 2025
Merged

feat: Canvas toolbar update and enhancement#9239
deon-sanchez merged 133 commits into
mainfrom
lfoss-1889

Conversation

@deon-sanchez
Copy link
Copy Markdown
Collaborator

@deon-sanchez deon-sanchez commented Jul 29, 2025

This pull request introduces a new modular canvas controls system for the application's flow editor, significantly improving both user experience and code maintainability. The changes add a dedicated set of components for canvas controls, including dropdowns for zoom and help actions, keyboard shortcut support, and smart guides toggling. Comprehensive unit tests are also provided for these components. Additionally, the flow menu UI is enhanced to visually indicate locked flows and streamline the settings display.

Canvas Controls System

  • Added new CanvasControls, CanvasControlsDropdown, DropdownControlButton, and HelpDropdown components to modularize and enhance the canvas controls area, supporting zoom, fit view, reset, help, docs, bug report, desktop download, and smart guides toggle actions. Keyboard shortcuts for canvas operations are now supported. (src/frontend/src/components/core/canvasControlsComponent/CanvasControls.tsx, CanvasControlsDropdown.tsx, DropdownControlButton.tsx, HelpDropdown.tsx) [1] [2] [3] [4]
  • Added tests for CanvasControls and CanvasControlsDropdown to ensure correct rendering, interaction, and event management, including keyboard shortcuts and dynamic zoom display. (__tests__/CanvasControls.test.tsx, __tests__/CanvasControlsDropdown.test.tsx) [1] [2]

Flow Lock Integration

  • Canvas controls now respond to flow lock status: when a flow is locked, node dragging, connecting, and selection are disabled for improved UX and data integrity. (CanvasControls.tsx)
  • The flow menu UI now displays a lock icon next to the flow name when the current flow is locked, providing a clear visual indicator to users. (FlowMenu/index.tsx) [1] [2]

UI/UX Improvements

  • The flow menu's settings panel display is streamlined by removing the redundant "Flow Details" label for a cleaner appearance. (FlowMenu/index.tsx)

These updates collectively make the flow editor more intuitive, visually informative, and easier to maintain.

Images

Updated Canvas Controls

Screenshot 2025-08-18 at 1 34 59 PM

Updated Zoom Controls

Screenshot 2025-08-18 at 1 35 05 PM

New Lock Placement

Screenshot 2025-08-18 at 1 35 18 PM

Full Screen

Screenshot 2025-08-18 at 1 35 25 PM

…t code formatting

- Introduced .editorconfig to enforce coding styles across various file types.
- Added .prettierrc for Prettier configuration to standardize code formatting.
- Updated settings.json to define tab sizes and formatting options for different languages.
- Enhanced canvasControlsComponent with a new dropdown for control buttons, improving UI interaction.
- Refactored logCanvasControlsComponent and MemoizedComponents for better structure and consistency.
@SonicDMG SonicDMG temporarily deployed to lfoss-1889 - langflow-manual-install PR #9239 July 29, 2025 19:33 — with Render Destroyed
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Jul 29, 2025

Important

Review skipped

Auto incremental reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Walkthrough

This update introduces a comprehensive overhaul of code formatting and editor configuration files, including the addition of .editorconfig and .prettierrc, and a major expansion of .cursor/settings.json. In the frontend, the canvas controls UI is refactored: individual zoom/fit buttons are replaced by a dropdown menu, with layout and styling changes. Related component and import adjustments are made across several frontend files.

Changes

Cohort / File(s) Change Summary
Editor & Formatting Configuration
.cursor/settings.json, .editorconfig, src/frontend/.prettierrc
Expanded .cursor/settings.json with detailed editor and language-specific settings; added .editorconfig for cross-editor consistency; introduced .prettierrc in frontend for code formatting rules. No code entities affected.
Canvas Controls Refactor
src/frontend/src/components/core/canvasControlsComponent/index.tsx
Refactored canvas controls UI: replaced individual zoom/fit buttons with a dropdown menu, added new DropdownControlButton component, adjusted CustomControlButton, modified main panel layout and styling, added help icon, and introduced OS-specific shortcut display logic. Exported entities updated.
Log Canvas Controls Panel Position
src/frontend/src/components/core/logCanvasControlsComponent/index.tsx
Changed the position of the log canvas controls panel from bottom-right to bottom-left and updated CSS class for positioning. No exported/public entity changes.
Memoized Canvas Controls Import & Usage
src/frontend/src/pages/FlowPage/components/PageComponent/MemoizedComponents.tsx
Updated imports for icon and canvas controls; replaced CustomControlButton with a UI library Button in MemoizedCanvasControls, adjusted JSX and styling, and removed unused props. No exported/public entity signature changes.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant CanvasControls (Dropdown)
    participant Canvas
    participant Help

    User->>CanvasControls: Click dropdown toggle
    CanvasControls->>CanvasControls: Open dropdown menu

    User->>CanvasControls: Select "Zoom In"/"Zoom Out"/"Zoom 100%"/"Fit"
    CanvasControls->>Canvas: Perform zoom/fit action
    CanvasControls->>CanvasControls: Close dropdown menu

    User->>CanvasControls: Click help icon
    CanvasControls->>Help: Show help modal/popup
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~15–20 minutes

Possibly related PRs

Suggested labels

size:L, lgtm, refactor

Suggested reviewers

  • deon-sanchez
  • mfortman11
  • Cristhianzl
✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch lfoss-1889

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.

❤️ 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>, please review it.
    • 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.
  • 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 gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • 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 enhancement New feature or request label Jul 29, 2025
Copy link
Copy Markdown
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: 3

🧹 Nitpick comments (4)
src/frontend/.prettierrc (1)

1-14: Add final newline for EditorConfig consistency.

The Prettier configuration is well-structured and aligns with project standards. However, the file should end with a newline to match the insert_final_newline = true setting in the EditorConfig file.

   "printWidth": 80,
   "proseWrap": "preserve"
-} 
+}
src/frontend/src/pages/FlowPage/components/PageComponent/MemoizedComponents.tsx (1)

3-6: Simplify the dual import to avoid confusion.

Importing the same component twice with different aliases is unnecessary and can be confusing for maintainability.

-import {
-  default as ForwardedIconComponent,
-  default as IconComponent,
-} from "@/components/common/genericIconComponent";
+import ForwardedIconComponent from "@/components/common/genericIconComponent";

Then update the usage on line 48:

-        <IconComponent
+        <ForwardedIconComponent
src/frontend/src/components/core/canvasControlsComponent/index.tsx (2)

107-107: Remove duplicate CSS class.

The text-muted-foreground class is applied twice in the same className string.

-        <span className="text-muted-foreground text-sm mr-2 text-muted-foreground">
+        <span className="text-muted-foreground text-sm mr-2">

272-291: Remove commented code or implement the functionality.

The commented lock/unlock and helper line controls should either be implemented or removed entirely to keep the code clean.

If these features are not ready for this release, remove the commented code:

-          {/* <DropdownControlButton
-            iconName={isInteractive ? "LockOpen" : "Lock"}
-            tooltipText={isInteractive ? "Lock" : "Unlock"}
-            onClick={onToggleInteractivity}
-            backgroundClasses={isInteractive ? "" : "bg-destructive"}
-            iconClasses={
-              isInteractive ? "" : "text-primary-foreground dark:text-primary"
-            }
-            testId="lock_unlock_dropdown"
-          /> */}
-          {/* <DropdownControlButton
-            iconName={helperLineEnabled ? "FoldHorizontal" : "UnfoldHorizontal"}
-            tooltipText={
-              helperLineEnabled ? "Hide Helper Lines" : "Show Helper Lines"
-            }
-            onClick={onToggleHelperLines}
-            backgroundClasses={cn(helperLineEnabled && "bg-muted")}
-            iconClasses={cn(helperLineEnabled && "text-muted-foreground")}
-            testId="helper_lines_dropdown"
-          /> */}
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 96b35e0 and 49f5883.

📒 Files selected for processing (6)
  • .cursor/settings.json (1 hunks)
  • .editorconfig (1 hunks)
  • src/frontend/.prettierrc (1 hunks)
  • src/frontend/src/components/core/canvasControlsComponent/index.tsx (5 hunks)
  • src/frontend/src/components/core/logCanvasControlsComponent/index.tsx (1 hunks)
  • src/frontend/src/pages/FlowPage/components/PageComponent/MemoizedComponents.tsx (3 hunks)
🧰 Additional context used
📓 Path-based instructions (3)
src/frontend/src/**/*.{ts,tsx,js,jsx}

📄 CodeRabbit Inference Engine (.cursor/rules/frontend_development.mdc)

src/frontend/src/**/*.{ts,tsx,js,jsx}: All frontend TypeScript and JavaScript code should be located under src/frontend/src/ and organized into components, pages, icons, stores, types, utils, hooks, services, and assets directories as per the specified directory layout.
Use React 18 with TypeScript for all UI components in the frontend.
Format all TypeScript and JavaScript code using the make format_frontend command.
Lint all TypeScript and JavaScript code using the make lint command.

Files:

  • src/frontend/src/components/core/logCanvasControlsComponent/index.tsx
  • src/frontend/src/pages/FlowPage/components/PageComponent/MemoizedComponents.tsx
  • src/frontend/src/components/core/canvasControlsComponent/index.tsx
src/frontend/src/components/**/*.{ts,tsx,js,jsx}

📄 CodeRabbit Inference Engine (.cursor/rules/frontend_development.mdc)

All components should be styled using Tailwind CSS utility classes.

Files:

  • src/frontend/src/components/core/logCanvasControlsComponent/index.tsx
  • src/frontend/src/components/core/canvasControlsComponent/index.tsx
src/frontend/src/@(components|hooks)/**/*.{ts,tsx,js,jsx}

📄 CodeRabbit Inference Engine (.cursor/rules/frontend_development.mdc)

Implement dark mode support in components and hooks where needed.

Files:

  • src/frontend/src/components/core/logCanvasControlsComponent/index.tsx
  • src/frontend/src/components/core/canvasControlsComponent/index.tsx
🧠 Learnings (7)
📓 Common learnings
Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.486Z
Learning: Starter project files auto-format after langflow run; these formatting changes can be committed or ignored
Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/frontend_development.mdc:0-0
Timestamp: 2025-07-18T18:27:12.609Z
Learning: Applies to src/frontend/@(package*.json|tsconfig.json|tailwind.config.*|vite.config.*) : Frontend configuration files such as package.json, tsconfig.json, and Tailwind/Vite configs must be maintained and updated as needed.
Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/frontend_development.mdc:0-0
Timestamp: 2025-07-18T18:27:12.609Z
Learning: Applies to src/frontend/src/**/*.{ts,tsx,js,jsx} : Format all TypeScript and JavaScript code using the make format_frontend command.
Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/frontend_development.mdc:0-0
Timestamp: 2025-06-23T12:46:42.048Z
Learning: Frontend code must be formatted using the make format_frontend command and linted with make lint before committing changes.
src/frontend/src/components/core/logCanvasControlsComponent/index.tsx (5)

Learnt from: namastex888
PR: #9018
File: src/frontend/src/modals/apiModal/codeTabs/code-tabs.tsx:244-244
Timestamp: 2025-07-11T22:12:46.255Z
Learning: In src/frontend/src/modals/apiModal/codeTabs/code-tabs.tsx, the inconsistent showLineNumbers setting between Step 1 (false) and Step 2 (true) in the API modal is intentional to prevent breaking the modal height. Step 1 uses showLineNumbers={false} to save vertical space while Step 2 uses showLineNumbers={true} for better readability of longer code.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/frontend_development.mdc:0-0
Timestamp: 2025-07-18T18:27:12.609Z
Learning: Applies to src/frontend/src/@(components|hooks)/**/*.{ts,tsx,js,jsx} : Implement dark mode support in components and hooks where needed.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/frontend_development.mdc:0-0
Timestamp: 2025-06-23T12:46:42.048Z
Learning: Custom React Flow node types should be implemented as memoized components, using Handle components for connection points and supporting optional icons and labels.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/frontend_development.mdc:0-0
Timestamp: 2025-06-23T12:46:42.048Z
Learning: React Flow should be used for flow graph visualization, with nodes and edges passed as props, and changes handled via onNodesChange and onEdgesChange callbacks.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/frontend_development.mdc:0-0
Timestamp: 2025-07-18T18:27:12.609Z
Learning: Applies to src/frontend/src/components//@(FlowGraph|nodes)//*.{ts,tsx,js,jsx} : Use React Flow for flow graph visualization components.

src/frontend/.prettierrc (10)

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/frontend_development.mdc:0-0
Timestamp: 2025-07-18T18:27:12.609Z
Learning: Applies to src/frontend/@(package*.json|tsconfig.json|tailwind.config.|vite.config.) : Frontend configuration files such as package.json, tsconfig.json, and Tailwind/Vite configs must be maintained and updated as needed.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/frontend_development.mdc:0-0
Timestamp: 2025-07-18T18:27:12.609Z
Learning: Applies to src/frontend/src/**/*.{ts,tsx,js,jsx} : All frontend TypeScript and JavaScript code should be located under src/frontend/src/ and organized into components, pages, icons, stores, types, utils, hooks, services, and assets directories as per the specified directory layout.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/testing.mdc:0-0
Timestamp: 2025-07-21T14:16:14.125Z
Learning: Applies to src/frontend/**/*.@(test|spec).{ts,tsx,js,jsx} : Frontend test files should be located in 'src/frontend/' and use '.test.{ts,tsx,js,jsx}' or '.spec.{ts,tsx,js,jsx}' extensions.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/frontend_development.mdc:0-0
Timestamp: 2025-07-18T18:27:12.609Z
Learning: Applies to src/frontend/src/**/*.{ts,tsx,js,jsx} : Format all TypeScript and JavaScript code using the make format_frontend command.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/frontend_development.mdc:0-0
Timestamp: 2025-06-23T12:46:42.048Z
Learning: Frontend code must be formatted using the make format_frontend command and linted with make lint before committing changes.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/testing.mdc:0-0
Timestamp: 2025-07-21T14:16:14.125Z
Learning: Applies to src/frontend/**/*.@(test|spec).{ts,tsx,js,jsx} : Validate input/output behavior and test component initialization and configuration in frontend test files.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/frontend_development.mdc:0-0
Timestamp: 2025-07-18T18:27:12.609Z
Learning: Applies to src/frontend/tailwind.config.* : Use Tailwind CSS for styling all frontend components.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/frontend_development.mdc:0-0
Timestamp: 2025-07-18T18:27:12.609Z
Learning: Applies to src/frontend/src/**/*.{ts,tsx,js,jsx} : Use React 18 with TypeScript for all UI components in the frontend.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/frontend_development.mdc:0-0
Timestamp: 2025-07-18T18:27:12.609Z
Learning: Applies to src/frontend/src/types/**/*.{ts,tsx} : All TypeScript type definitions should be placed in the types directory.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/testing.mdc:0-0
Timestamp: 2025-07-21T14:16:14.125Z
Learning: Applies to src/frontend/**/*.@(test|spec).{ts,tsx,js,jsx} : Mock external dependencies appropriately in frontend test files to isolate unit tests from external services.

.editorconfig (2)

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/backend_development.mdc:0-0
Timestamp: 2025-07-18T18:25:54.486Z
Learning: Starter project files auto-format after langflow run; these formatting changes can be committed or ignored

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/frontend_development.mdc:0-0
Timestamp: 2025-07-18T18:27:12.609Z
Learning: Applies to src/frontend/@(package*.json|tsconfig.json|tailwind.config.|vite.config.) : Frontend configuration files such as package.json, tsconfig.json, and Tailwind/Vite configs must be maintained and updated as needed.

.cursor/settings.json (3)

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/frontend_development.mdc:0-0
Timestamp: 2025-07-18T18:27:12.609Z
Learning: Applies to src/frontend/@(package*.json|tsconfig.json|tailwind.config.|vite.config.) : Frontend configuration files such as package.json, tsconfig.json, and Tailwind/Vite configs must be maintained and updated as needed.

Learnt from: namastex888
PR: #9018
File: src/frontend/src/modals/apiModal/codeTabs/code-tabs.tsx:244-244
Timestamp: 2025-07-11T22:12:46.255Z
Learning: In src/frontend/src/modals/apiModal/codeTabs/code-tabs.tsx, the inconsistent showLineNumbers setting between Step 1 (false) and Step 2 (true) in the API modal is intentional to prevent breaking the modal height. Step 1 uses showLineNumbers={false} to save vertical space while Step 2 uses showLineNumbers={true} for better readability of longer code.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/docs_development.mdc:0-0
Timestamp: 2025-07-18T18:26:42.027Z
Learning: Applies to docs/docusaurus.config.js : Site configuration such as title, tagline, URL, and navbar items must be managed in docs/docusaurus.config.js.

src/frontend/src/pages/FlowPage/components/PageComponent/MemoizedComponents.tsx (13)

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/frontend_development.mdc:0-0
Timestamp: 2025-06-23T12:46:42.048Z
Learning: Custom React Flow node types should be implemented as memoized components, using Handle components for connection points and supporting optional icons and labels.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/icons.mdc:0-0
Timestamp: 2025-06-23T12:46:52.420Z
Learning: Export custom icon components in React using React.forwardRef to ensure proper ref forwarding and compatibility with parent components.

Learnt from: dolfim-ibm
PR: #8394
File: src/frontend/src/icons/Docling/index.tsx:4-6
Timestamp: 2025-06-16T11:14:04.200Z
Learning: The Langflow codebase consistently uses React.PropsWithChildren<{}> as the prop type for all icon components using forwardRef, rather than React.SVGProps<SVGSVGElement>. This is an established pattern across hundreds of icon files in src/frontend/src/icons/.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/frontend_development.mdc:0-0
Timestamp: 2025-07-18T18:27:12.609Z
Learning: Applies to src/frontend/src/components//@(FlowGraph|nodes)//*.{ts,tsx,js,jsx} : Use React Flow for flow graph visualization components.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/icons.mdc:0-0
Timestamp: 2025-07-28T15:56:47.865Z
Learning: Applies to src/frontend/src/icons/*/index.tsx : Create an index.tsx in your icon directory that exports your icon using forwardRef and passes the isDark prop.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/frontend_development.mdc:0-0
Timestamp: 2025-07-18T18:27:12.609Z
Learning: Applies to src/frontend/src/icons/**/*.{ts,tsx,js,jsx} : Use Lucide React for icons in the frontend.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/frontend_development.mdc:0-0
Timestamp: 2025-07-18T18:27:12.609Z
Learning: Applies to src/frontend/src/**/*.{ts,tsx,js,jsx} : Use React 18 with TypeScript for all UI components in the frontend.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/frontend_development.mdc:0-0
Timestamp: 2025-07-18T18:27:12.609Z
Learning: Applies to src/frontend/src/@(components|hooks)/**/*.{ts,tsx,js,jsx} : Implement dark mode support in components and hooks where needed.

Learnt from: ogabrielluiz
PR: langflow-ai/langflow#0
File: :0-0
Timestamp: 2025-06-26T19:43:18.260Z
Learning: In langflow custom components, the module_name parameter is now propagated through template building functions to add module metadata and code hashes to frontend nodes for better component tracking and debugging.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/icons.mdc:0-0
Timestamp: 2025-06-23T12:46:52.420Z
Learning: When implementing a new component icon in Langflow, ensure the icon name is clear, recognizable, and used consistently across both backend (Python 'icon' attribute) and frontend (React/TypeScript mapping).

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/frontend_development.mdc:0-0
Timestamp: 2025-06-23T12:46:42.048Z
Learning: React Flow should be used for flow graph visualization, with nodes and edges passed as props, and changes handled via onNodesChange and onEdgesChange callbacks.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/icons.mdc:0-0
Timestamp: 2025-06-23T12:46:52.420Z
Learning: Custom SVG icon components in React should always support both light and dark mode by accepting an 'isdark' prop and adjusting colors accordingly.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/icons.mdc:0-0
Timestamp: 2025-07-28T15:56:47.865Z
Learning: Applies to src/frontend/src/icons//.@(js|jsx|ts|tsx) : Create a new directory for your icon in src/frontend/src/icons/YourIconName/ and add your SVG as a React component (e.g., YourIconName.jsx). The SVG component must use the isDark prop to support both light and dark mode.

src/frontend/src/components/core/canvasControlsComponent/index.tsx (13)

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/frontend_development.mdc:0-0
Timestamp: 2025-07-18T18:27:12.609Z
Learning: Applies to src/frontend/src/@(components|hooks)/**/*.{ts,tsx,js,jsx} : Implement dark mode support in components and hooks where needed.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/frontend_development.mdc:0-0
Timestamp: 2025-07-18T18:27:12.609Z
Learning: Applies to src/frontend/src/**/*.{ts,tsx,js,jsx} : Use React 18 with TypeScript for all UI components in the frontend.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/frontend_development.mdc:0-0
Timestamp: 2025-06-23T12:46:42.048Z
Learning: Custom React Flow node types should be implemented as memoized components, using Handle components for connection points and supporting optional icons and labels.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/icons.mdc:0-0
Timestamp: 2025-06-23T12:46:52.420Z
Learning: Export custom icon components in React using React.forwardRef to ensure proper ref forwarding and compatibility with parent components.

Learnt from: dolfim-ibm
PR: #8394
File: src/frontend/src/icons/Docling/index.tsx:4-6
Timestamp: 2025-06-16T11:14:04.200Z
Learning: The Langflow codebase consistently uses React.PropsWithChildren<{}> as the prop type for all icon components using forwardRef, rather than React.SVGProps<SVGSVGElement>. This is an established pattern across hundreds of icon files in src/frontend/src/icons/.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/icons.mdc:0-0
Timestamp: 2025-06-23T12:46:52.420Z
Learning: When implementing a new component icon in Langflow, ensure the icon name is clear, recognizable, and used consistently across both backend (Python 'icon' attribute) and frontend (React/TypeScript mapping).

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/frontend_development.mdc:0-0
Timestamp: 2025-06-23T12:46:42.048Z
Learning: Use Zustand for state management in React components within the frontend; stores should expose both state and setter functions, and be imported via hooks (e.g., useMyStore).

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/frontend_development.mdc:0-0
Timestamp: 2025-07-18T18:27:12.609Z
Learning: Applies to src/frontend/src/components//@(FlowGraph|nodes)//*.{ts,tsx,js,jsx} : Use React Flow for flow graph visualization components.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/frontend_development.mdc:0-0
Timestamp: 2025-07-18T18:27:12.609Z
Learning: Applies to src/frontend/src/icons/**/*.{ts,tsx,js,jsx} : Use Lucide React for icons in the frontend.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/icons.mdc:0-0
Timestamp: 2025-06-23T12:46:52.420Z
Learning: Custom SVG icon components in React should always support both light and dark mode by accepting an 'isdark' prop and adjusting colors accordingly.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/icons.mdc:0-0
Timestamp: 2025-07-28T15:56:47.865Z
Learning: Applies to src/frontend/src/icons/*/index.tsx : Create an index.tsx in your icon directory that exports your icon using forwardRef and passes the isDark prop.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/icons.mdc:0-0
Timestamp: 2025-07-28T15:56:47.865Z
Learning: Applies to src/frontend/src/icons//.@(js|jsx|ts|tsx) : Create a new directory for your icon in src/frontend/src/icons/YourIconName/ and add your SVG as a React component (e.g., YourIconName.jsx). The SVG component must use the isDark prop to support both light and dark mode.

Learnt from: CR
PR: langflow-ai/langflow#0
File: .cursor/rules/frontend_development.mdc:0-0
Timestamp: 2025-06-23T12:46:42.048Z
Learning: React Flow should be used for flow graph visualization, with nodes and edges passed as props, and changes handled via onNodesChange and onEdgesChange callbacks.

🔇 Additional comments (11)
.editorconfig (1)

1-53: LGTM! Comprehensive EditorConfig setup.

The configuration is well-structured with appropriate settings for each file type. The indentation rules (2 spaces for most files, 4 for Python, tabs for Makefiles) follow standard conventions, and disabling trailing whitespace trimming for Markdown files is a good practice.

src/frontend/src/components/core/logCanvasControlsComponent/index.tsx (1)

10-11: LGTM! Panel repositioning is clean and purposeful.

The position change from "bottom-right" to "bottom-left" with the !left-auto class override is a straightforward adjustment that aligns with the broader canvas controls layout restructuring.

.cursor/settings.json (1)

2-46: LGTM! Comprehensive editor configuration with consistent formatting rules.

The expanded settings provide excellent consistency across the codebase. The tab sizes align with EditorConfig (2 spaces for most languages, 4 for Python), and the biomejs.biome formatter integration with format-on-save will maintain code quality automatically.

src/frontend/src/pages/FlowPage/components/PageComponent/MemoizedComponents.tsx (1)

34-52: LGTM! Button replacement maintains functionality while improving consistency.

The replacement of CustomControlButton with the standard Button component is well-executed. The styling, functionality, and accessibility are preserved while aligning with the broader canvas controls refactoring.

src/frontend/src/components/core/canvasControlsComponent/index.tsx (7)

10-10: LGTM: Import additions support new dropdown functionality.

The new imports for React hooks, UI components (Button, DropdownMenu, Separator), and OS utility function are appropriate for the dropdown-based canvas controls refactoring.

Also applies to: 15-21, 25-25


28-37: LGTM: Type definition updates support new dropdown interface.

Making iconName optional and adding name and shortcut properties appropriately extends the interface for the new dropdown controls while maintaining backward compatibility.


39-75: LGTM: CustomControlButton updates maintain functionality with improved styling.

The component properly handles the optional iconName with a default value and includes appropriate hover states with the "group" className. The styling updates align with the new design system.


78-117: LGTM: DropdownControlButton implementation is well-structured.

The component properly implements the dropdown control interface with appropriate styling, accessibility attributes, and keyboard shortcut display. The layout logic correctly positions the control name and modifier key combination.


120-123: LGTM: OS-specific modifier key detection is well-implemented.

The helper function correctly detects the operating system and returns appropriate modifier key symbols (⌘ for macOS, Ctrl for others). This enhances user experience by showing OS-appropriate keyboard shortcuts.


185-198: LGTM: Zoom callback handlers properly manage dropdown state.

The new callback handlers correctly wrap the zoom operations and close the dropdown after each action, providing good UX by preventing the dropdown from staying open after use.


204-238: LGTM: Panel restructure improves layout and accessibility.

The canvas controls panel has been properly restructured with:

  • Appropriate positioning (bottom-right)
  • Proper flex layout and spacing
  • Good separation between elements with dividers
  • Accessible dropdown trigger with tooltip

Comment thread src/frontend/src/components/core/canvasControlsComponent/index.tsx Outdated
Comment thread src/frontend/src/components/core/canvasControlsComponent/index.tsx Outdated
Comment thread src/frontend/src/components/core/canvasControlsComponent/index.tsx Outdated
…nctionality

- Introduced keyboard shortcuts for zooming in, zooming out, fitting view, and resetting zoom.
- Refactored DropdownControlButton to improve accessibility and usability.
- Updated CanvasControls to handle keyboard events for enhanced user interaction.
- Added helper function to format zoom percentage for better display.
- Improved structure and readability of the canvas controls component.
@SonicDMG SonicDMG temporarily deployed to lfoss-1889 - langflow-manual-install PR #9239 July 29, 2025 20:04 — with Render Destroyed
@github-actions github-actions Bot added enhancement New feature or request and removed enhancement New feature or request labels Jul 29, 2025
@SonicDMG SonicDMG temporarily deployed to lfoss-1889 - langflow-manual-install PR #9239 July 29, 2025 20:05 — with Render Destroyed
@github-actions github-actions Bot added enhancement New feature or request and removed enhancement New feature or request labels Jul 29, 2025
@ogabrielluiz
Copy link
Copy Markdown
Contributor

Since we are using biome for for Martins do we need prettier config?

@deon-sanchez deon-sanchez changed the title feat: Add EditorConfig and Prettier configuration files for consisten… refactor: Canvas Update Jul 30, 2025
@github-actions github-actions Bot removed the enhancement New feature or request label Jul 30, 2025
@deon-sanchez deon-sanchez self-assigned this Jul 30, 2025
@github-actions github-actions Bot added enhancement New feature or request refactor Maintenance tasks and housekeeping and removed enhancement New feature or request labels Jul 30, 2025
@deon-sanchez deon-sanchez added the DO NOT MERGE Don't Merge this PR label Jul 30, 2025
@github-actions github-actions Bot removed the refactor Maintenance tasks and housekeeping label Aug 11, 2025
autofix-ci Bot and others added 29 commits August 22, 2025 21:53
…ojects.spec.ts

- Simplified arrow function syntax by removing parentheses where not needed.
- Enhanced conditional logic for handling visibility of elements in the test flow.
- Improved overall code organization for better maintainability.
- Updated test selectors for consistency and improved readability.
- Replaced keyboard interaction with direct click for enabling the lock switch to reduce flakiness.
- Added conditional check for the save button to ensure it is enabled before clicking.
- Improved wait times for UI elements to enhance test stability.
- Cleaned up code structure for better maintainability.
- Added a conditional check to ensure the lock switch is in the correct state after clicking.
- Enhanced test stability by incorporating an additional click if the state is not as expected.
…ency

- Removed unnecessary wait for the fit_view selector to streamline the test flow.
- Simplified the logic for clicking the fit_view button, enhancing readability and reducing redundancy.
…dability

- Simplified arrow function syntax by removing unnecessary parentheses.
- Enhanced code clarity by standardizing the structure of test assertions and interactions.
- Improved overall test flow by ensuring consistent formatting and reducing redundancy.
… and Text Sentiment Analysis.spec.ts

- Simplified arrow function syntax by removing unnecessary parentheses.
- Standardized test assertions and interactions for improved clarity.
- Adjusted text analysis assertion to ensure it checks for a minimum length of 50 characters.
- Added a wait for selector in the starter-projects.spec.ts to ensure proper element visibility before interaction.
@sonarqubecloud
Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request feature New features and enhancements lgtm This PR has been approved by a maintainer

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants