Skip to content

Conversation

@lucaseduoli
Copy link
Collaborator

@lucaseduoli lucaseduoli commented Jan 9, 2026

This pull request introduces a major refactor to the node input editing experience by adding a dedicated, modern Inspection Panel for editing node parameters. The changes separate the editing of node inputs from the main canvas and streamline the user interface for inspecting and modifying node properties. Key updates include new Inspection Panel components, conditional rendering logic, and adjustments to input field visibility.

Inspection Panel feature and UI refactor:

  • Added new InspectionPanel, InspectionPanelHeader, and InspectionPanelFields components to provide a dedicated, animated side panel for node inspection and editing. The panel displays when a single genericNode is selected and includes a header, code modal trigger, and a list of editable fields. [1] [2] [3]
  • Integrated the InspectionPanel into the main flow page (PageComponent), including logic to determine when the panel should be visible and to fetch the correct node data from the store. [1] [2] [3]

Input field visibility and editing logic:

  • Updated NodeInputField to hide input components if the field has a handle, as these fields are now edited exclusively in the Inspection Panel.
  • Modified RenderInputParameters to only show fields with handles and to apply stricter filtering for visibility, ensuring that only relevant parameters are displayed in the node UI.

Component abstraction and maintainability:

  • Refactored input field rendering logic into new, reusable components (InspectionPanelField, InspectionPanelFields, InspectionPanelHeader) for improved maintainability and clarity. [1] [2] [3]

These changes collectively modernize the node parameter editing workflow, improve UX, and lay the groundwork for future extensibility.

image

Summary by CodeRabbit

Release Notes

  • New Features

    • Added Inspection Panel in the flow editor for viewing and editing component settings of selected nodes.
  • Refactor

    • Improved field visibility logic for input parameters with enhanced guards to more accurately determine which fields should display.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 9, 2026

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

The changes introduce an Inspection Panel feature to the Flow Page that displays configurable template fields for selected nodes. Additionally, visibility logic is refined in input field rendering components to include stricter guards for optional handles and input type requirements.

Changes

Cohort / File(s) Summary
Input field visibility refinements
src/frontend/src/CustomNodes/GenericNode/components/NodeInputField/index.tsx, src/frontend/src/CustomNodes/GenericNode/components/RenderInputParameters/index.tsx
Guard conditions updated to check for absence of optionalHandle and presence of input_types handles; control flow made more explicit with early returns for visibility checks
InspectionPanel core components
src/frontend/src/pages/FlowPage/components/InspectionPanel/index.tsx, src/frontend/src/pages/FlowPage/components/InspectionPanel/components/InspectionPanelHeader.tsx, src/frontend/src/pages/FlowPage/components/InspectionPanel/components/InspectionPanelFields.tsx, src/frontend/src/pages/FlowPage/components/InspectionPanel/components/InspectionPanelField.tsx
New memoized panel component with animated entry/exit; renders header with node icon and code editing; lists filtered template fields with metadata; individual field component integrating auth, flow context, parameter rendering, and agentic features
Flow page integration
src/frontend/src/pages/FlowPage/components/PageComponent/index.tsx
InspectionPanel conditionally rendered when single genericNode is selected; retrieves fresh selectedNode reference from store

Sequence Diagram

sequenceDiagram
    participant User
    participant PageComponent
    participant Store
    participant InspectionPanel
    participant InspectionPanelFields
    participant InspectionPanelField

    User->>PageComponent: Select node (genericNode)
    PageComponent->>Store: Retrieve selectedNode
    Store-->>PageComponent: Return selectedNode
    PageComponent->>InspectionPanel: Render with selectedNode & isVisible
    activate InspectionPanel
    InspectionPanel->>InspectionPanelHeader: Render header with node info
    InspectionPanel->>InspectionPanelFields: Render fields with template data
    activate InspectionPanelFields
    InspectionPanelFields->>InspectionPanelFields: Filter & sort template fields
    InspectionPanelFields->>InspectionPanelField: Render field for each template item
    activate InspectionPanelField
    InspectionPanelField->>Store: Fetch auth & flow context
    InspectionPanelField->>InspectionPanelField: Render parameter component with metadata
    deactivate InspectionPanelField
    deactivate InspectionPanelFields
    deactivate InspectionPanel
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~75 minutes


Important

Pre-merge checks failed

Please resolve all errors before merging. Addressing warnings is optional.

❌ Failed checks (1 error, 3 warnings)
Check name Status Explanation Resolution
Test Coverage For New Implementations ❌ Error PR introduces four new React components and modifies two existing components without corresponding test files in the well-established testing infrastructure. Create test files following project conventions for all new InspectionPanel components and modified components using Jest and React Testing Library.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Test Quality And Coverage ⚠️ Warning No test files were added for the five new React components (InspectionPanel, InspectionPanelHeader, InspectionPanelFields, InspectionPanelField) despite significant functional additions. Add comprehensive test coverage for all new InspectionPanel components including rendering, state management, modal interactions, and field filtering logic with integration tests.
Test File Naming And Structure ⚠️ Warning PR introduces 344+ lines of new frontend components and modifications without corresponding test files for new InspectionPanel components or modified NodeInputField/RenderInputParameters/PageComponent. Add .test.tsx files for InspectionPanel, InspectionPanelHeader, InspectionPanelFields, InspectionPanelField and test modifications to NodeInputField, RenderInputParameters, PageComponent.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: adding an inspection panel for editing node inputs, which aligns with the primary objective and the substantial new components introduced.
Excessive Mock Usage Warning ✅ Passed The PR does not add or modify any test files, so the custom check for excessive mock usage in tests is not applicable and passes.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/inspection_panel

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

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions bot added the enhancement New feature or request label Jan 9, 2026
@github-actions
Copy link
Contributor

github-actions bot commented Jan 9, 2026

Frontend Unit Test Coverage Report

Coverage Summary

Lines Statements Branches Functions
Coverage: 17%
17.36% (4980/28671) 10.62% (2363/22240) 11.51% (722/6271)

Unit Test Results

Tests Skipped Failures Errors Time
1999 0 💤 0 ❌ 0 🔥 25.982s ⏱️

@codecov
Copy link

codecov bot commented Jan 9, 2026

Codecov Report

❌ Patch coverage is 0.57471% with 173 lines in your changes missing coverage. Please review.
✅ Project coverage is 33.95%. Comparing base (3006b13) to head (f541e1c).
⚠️ Report is 19 commits behind head on main.

Files with missing lines Patch % Lines
...nspectionPanel/components/InspectionPanelField.tsx 0.00% 62 Missing ⚠️
...spectionPanel/components/InspectionPanelHeader.tsx 0.00% 40 Missing ⚠️
...spectionPanel/components/InspectionPanelFields.tsx 0.00% 23 Missing ⚠️
...ricNode/components/RenderInputParameters/index.tsx 0.00% 15 Missing ⚠️
...ages/FlowPage/components/InspectionPanel/index.tsx 0.00% 13 Missing ⚠️
.../pages/FlowPage/components/PageComponent/index.tsx 0.00% 10 Missing ⚠️
...es/GenericNode/components/NodeInputField/index.tsx 0.00% 7 Missing ⚠️
...FlowPage/components/nodeToolbarComponent/index.tsx 0.00% 3 Missing ⚠️

❌ Your patch check has failed because the patch coverage (0.57%) is below the target coverage (40.00%). You can increase the patch coverage or adjust the target coverage.
❌ Your project check has failed because the head coverage (40.62%) is below the target coverage (60.00%). You can increase the head coverage or adjust the target coverage.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main   #11263      +/-   ##
==========================================
- Coverage   34.03%   33.95%   -0.09%     
==========================================
  Files        1407     1411       +4     
  Lines       66661    66833     +172     
  Branches     9839     9903      +64     
==========================================
+ Hits        22689    22692       +3     
- Misses      42787    42956     +169     
  Partials     1185     1185              
Flag Coverage Δ
frontend 15.90% <0.57%> (-0.10%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
src/frontend/src/customization/feature-flags.ts 100.00% <100.00%> (ø)
...FlowPage/components/nodeToolbarComponent/index.tsx 0.00% <0.00%> (ø)
...es/GenericNode/components/NodeInputField/index.tsx 0.00% <0.00%> (ø)
.../pages/FlowPage/components/PageComponent/index.tsx 0.00% <0.00%> (ø)
...ages/FlowPage/components/InspectionPanel/index.tsx 0.00% <0.00%> (ø)
...ricNode/components/RenderInputParameters/index.tsx 0.00% <0.00%> (ø)
...spectionPanel/components/InspectionPanelFields.tsx 0.00% <0.00%> (ø)
...spectionPanel/components/InspectionPanelHeader.tsx 0.00% <0.00%> (ø)
...nspectionPanel/components/InspectionPanelField.tsx 0.00% <0.00%> (ø)

... and 3 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions github-actions bot added enhancement New feature or request and removed enhancement New feature or request labels Jan 9, 2026
Copy link
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: 6

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
src/frontend/src/CustomNodes/GenericNode/components/NodeInputField/index.tsx (1)

99-118: Fix “empty input_types” handling — current logic can hide both handle and input (non-editable field).

Right now !optionalHandle is used to decide whether to render CustomParameterComponent (Line 230), but an empty array ([]) is truthy, so fields with input_types: [] will hide the input. Meanwhile, displayHandle may also be false (e.g., ModelInput with empty input_types, or other conditions), leaving the row with no handle and no editor.

Also, mutating optionalHandle inside useEffect (Line 99-103) won’t fix this reliably and is an anti-pattern for props.

Proposed fix
@@
-  useEffect(() => {
-    if (optionalHandle && optionalHandle.length === 0) {
-      optionalHandle = null;
-    }
-  }, [optionalHandle]);
+  const hasHandle =
+    Array.isArray(optionalHandle) && optionalHandle.length > 0;
@@
   const hasInputTypes =
-    optionalHandle &&
-    Array.isArray(optionalHandle) &&
-    optionalHandle.length > 0;
+    hasHandle;
@@
   const displayHandle =
     (!LANGFLOW_SUPPORTED_TYPES.has(type ?? "") ||
-      (optionalHandle && optionalHandle.length > 0)) &&
+      hasHandle) &&
     !isToolMode &&
     (!hasRefreshButton || isModelInput) &&
     (!isModelInput || hasInputTypes); // Hide handle for ModelInput when input_types is empty
@@
-        {!optionalHandle && data.node?.template[name] !== undefined && (
+        {!hasHandle && data.node?.template[name] !== undefined && (
           <CustomParameterComponent
             handleOnNewValue={handleOnNewValue}
             name={name}
             nodeId={data.id}
             inputId={id}
             templateData={data.node?.template[name]!}
             templateValue={data.node?.template[name].value ?? ""}
             editNode={false}
             handleNodeClass={handleNodeClass}
             nodeClass={data.node!}
             placeholder={
               isToolMode
                 ? DEFAULT_TOOLSET_PLACEHOLDER
                 : data.node?.template[name].placeholder
             }
             isToolMode={isToolMode}
             nodeInformationMetadata={nodeInformationMetadata}
             proxy={proxy}
           />
         )}

Also applies to: 229-250

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

748-777: Avoid unsafe cast: nodes.find(...) as AllNodeType can yield undefined (and hides real bugs).

This is a small correctness/maintainability improvement: compute selectedNode as AllNodeType | null without casting.

Proposed fix
@@
   const selectedNodeId = showInspectionPanel ? lastSelection.nodes[0].id : null;
-  const selectedNode = selectedNodeId
-    ? (nodes.find((n) => n.id === selectedNodeId) as AllNodeType)
-    : null;
+  const selectedNode: AllNodeType | null = selectedNodeId
+    ? (nodes.find((n) => n.id === selectedNodeId) ?? null)
+    : null;
🤖 Fix all issues with AI agents
In
@src/frontend/src/CustomNodes/GenericNode/components/RenderInputParameters/index.tsx:
- Around line 35-50: The current visibility filter returns true for any template
with input_types, but that can produce a blank row when NodeInputField hides its
editor due to optionalHandle and also hides the handle when refresh_button is
true on non-model inputs; update the check in the renderer (the hasHandle logic
around template.input_types) to first use Array.isArray(template.input_types) &&
template.input_types.length > 0 and then exclude templates where
template.refresh_button === true && template.type !== "model" (or otherwise
ensure such templates render a visible editor/handle); locate the template
checks in this function and adjust the boolean logic so fields that would end up
with neither editor nor handle are filtered out (or alternatively, ensure
NodeInputField/optionalHandle logic is changed to prevent blank rows
consistently).

In
@src/frontend/src/pages/FlowPage/components/InspectionPanel/components/InspectionPanelField.tsx:
- Around line 71-80: The useMemo for nodeInformationMetadata is missing
dependencies and can produce stale values; update the dependency array of the
useMemo that defines nodeInformationMetadata to include currentFlowId,
currentFlowName, and data?.type in addition to the existing shouldDisplayApiKey
and name (and optionally keep data?.node?.id if you still need it) so the memo
recalculates when currentFlowId, currentFlowName, or data.type change.
- Around line 94-101: The name matching is too broad: replace the substring
check `name.includes("code")` with a precise check so unrelated fields like
"encode" aren't hidden; update the condition in InspectionPanelField.tsx so the
hidden branch only triggers for an explicit code field (e.g., keep `(name ===
"code" && type === "code")` and change the proxy case to check the proxy's
declared field like `proxy?.field === "code"` or `proxy && proxy.field ===
"code"`) so only actual proxy fields that target "code" hide the element.

In
@src/frontend/src/pages/FlowPage/components/InspectionPanel/components/InspectionPanelFields.tsx:
- Line 81: Remove the stray comment line containing "Made with Bob" from the
InspectionPanelFields.tsx file: locate the comment in the InspectionPanelFields
component (or nearby top-level file header) and delete that line so no stray
comment remains; then run the project's lint/format step to ensure no trailing
whitespace or formatting issues.
- Around line 52-77: The render loop over allFields can crash if
data.node?.template[templateField] is undefined; modify the map in
InspectionPanelFields to guard against missing template entries by checking that
const template = data.node?.template?.[templateField] exists before returning an
<InspectionPanelField/>; if template is undefined, either skip rendering that
iteration (return null) or render a safe fallback with defaults, and ensure
getFieldTitle is only called when template is present; reference the map over
allFields, the template variable, getFieldTitle, and the InspectionPanelField
component when making the change.

In
@src/frontend/src/pages/FlowPage/components/InspectionPanel/components/InspectionPanelHeader.tsx:
- Around line 60-91: The "View Code" icon-only Button in InspectionPanelHeader
should include an accessible label: add an aria-label (e.g., aria-label="View
code") to the Button that currently calls handleOpenCode so screen readers can
identify it (the ShadTooltip is visual-only). Also remove the unnecessary
surrounding <div className="hidden"> that wraps CodeAreaModal (the modal
controls visibility via its open prop) and delete the stray comment "// Made
with Bob" in this component; keep all existing props on CodeAreaModal
(setOpen={setOpenCodeModal}, open={openCodeModal}, setValue={handleSetValue},
nodeClass={data.node}, etc.) unchanged.
🧹 Nitpick comments (2)
src/frontend/src/pages/FlowPage/components/InspectionPanel/index.tsx (1)

14-47: Panel component looks solid; remove stray comment and sanity-check layering/positioning.

Memoization + animation composition looks fine (based on learnings re: avoiding unnecessary rerenders). Please remove the trailing “Made with Bob” comment.

If you’ve seen any overlap issues with menus/toolbars, consider verifying Panel stacking context (z-index) in the Flow page layout.

Also applies to: 53-53

src/frontend/src/pages/FlowPage/components/InspectionPanel/components/InspectionPanelField.tsx (1)

28-38: Ensure name is never empty for this component (hook call depends on it).

name = "" + unconditional useFetchDataOnMount(...) makes it easy to accidentally trigger fetch/update logic with an empty parameter id if this component is ever reused incorrectly. Consider making name required (no default) or adding an invariant at the call sites.

Also applies to: 81-87

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a59ade4 and b6bb0d4.

📒 Files selected for processing (7)
  • src/frontend/src/CustomNodes/GenericNode/components/NodeInputField/index.tsx
  • src/frontend/src/CustomNodes/GenericNode/components/RenderInputParameters/index.tsx
  • src/frontend/src/pages/FlowPage/components/InspectionPanel/components/InspectionPanelField.tsx
  • src/frontend/src/pages/FlowPage/components/InspectionPanel/components/InspectionPanelFields.tsx
  • src/frontend/src/pages/FlowPage/components/InspectionPanel/components/InspectionPanelHeader.tsx
  • src/frontend/src/pages/FlowPage/components/InspectionPanel/index.tsx
  • src/frontend/src/pages/FlowPage/components/PageComponent/index.tsx
🧰 Additional context used
📓 Path-based instructions (3)
src/frontend/src/**/*.{ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/frontend_development.mdc)

src/frontend/src/**/*.{ts,tsx}: Use React 18 with TypeScript for frontend development
Use Zustand for state management

Files:

  • src/frontend/src/pages/FlowPage/components/InspectionPanel/index.tsx
  • src/frontend/src/pages/FlowPage/components/InspectionPanel/components/InspectionPanelHeader.tsx
  • src/frontend/src/pages/FlowPage/components/InspectionPanel/components/InspectionPanelFields.tsx
  • src/frontend/src/pages/FlowPage/components/InspectionPanel/components/InspectionPanelField.tsx
  • src/frontend/src/CustomNodes/GenericNode/components/NodeInputField/index.tsx
  • src/frontend/src/CustomNodes/GenericNode/components/RenderInputParameters/index.tsx
  • src/frontend/src/pages/FlowPage/components/PageComponent/index.tsx
src/frontend/src/**/*.{tsx,jsx,css,scss}

📄 CodeRabbit inference engine (.cursor/rules/frontend_development.mdc)

Use Tailwind CSS for styling

Files:

  • src/frontend/src/pages/FlowPage/components/InspectionPanel/index.tsx
  • src/frontend/src/pages/FlowPage/components/InspectionPanel/components/InspectionPanelHeader.tsx
  • src/frontend/src/pages/FlowPage/components/InspectionPanel/components/InspectionPanelFields.tsx
  • src/frontend/src/pages/FlowPage/components/InspectionPanel/components/InspectionPanelField.tsx
  • src/frontend/src/CustomNodes/GenericNode/components/NodeInputField/index.tsx
  • src/frontend/src/CustomNodes/GenericNode/components/RenderInputParameters/index.tsx
  • src/frontend/src/pages/FlowPage/components/PageComponent/index.tsx
src/frontend/src/**/*.{tsx,jsx}

📄 CodeRabbit inference engine (.cursor/rules/frontend_development.mdc)

src/frontend/src/**/*.{tsx,jsx}: Implement dark mode support using the useDarkMode hook and dark store
Use Lucide React for icon components in the application

Files:

  • src/frontend/src/pages/FlowPage/components/InspectionPanel/index.tsx
  • src/frontend/src/pages/FlowPage/components/InspectionPanel/components/InspectionPanelHeader.tsx
  • src/frontend/src/pages/FlowPage/components/InspectionPanel/components/InspectionPanelFields.tsx
  • src/frontend/src/pages/FlowPage/components/InspectionPanel/components/InspectionPanelField.tsx
  • src/frontend/src/CustomNodes/GenericNode/components/NodeInputField/index.tsx
  • src/frontend/src/CustomNodes/GenericNode/components/RenderInputParameters/index.tsx
  • src/frontend/src/pages/FlowPage/components/PageComponent/index.tsx
🧠 Learnings (5)
📓 Common learnings
Learnt from: ogabrielluiz
Repo: langflow-ai/langflow PR: 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
Repo: langflow-ai/langflow PR: 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.
📚 Learning: 2025-11-24T19:46:45.790Z
Learnt from: CR
Repo: langflow-ai/langflow PR: 0
File: .cursor/rules/frontend_development.mdc:0-0
Timestamp: 2025-11-24T19:46:45.790Z
Learning: Applies to src/frontend/src/components/**/*.{tsx,jsx} : Use React Flow for flow graph visualization with Node, Edge, Controls, and Background components

Applied to files:

  • src/frontend/src/pages/FlowPage/components/InspectionPanel/index.tsx
  • src/frontend/src/pages/FlowPage/components/InspectionPanel/components/InspectionPanelHeader.tsx
  • src/frontend/src/pages/FlowPage/components/InspectionPanel/components/InspectionPanelFields.tsx
  • src/frontend/src/pages/FlowPage/components/InspectionPanel/components/InspectionPanelField.tsx
  • src/frontend/src/pages/FlowPage/components/PageComponent/index.tsx
📚 Learning: 2025-11-24T19:46:45.790Z
Learnt from: CR
Repo: langflow-ai/langflow PR: 0
File: .cursor/rules/frontend_development.mdc:0-0
Timestamp: 2025-11-24T19:46:45.790Z
Learning: Applies to src/frontend/src/components/nodes/**/*.{tsx,jsx} : Memoize custom React Flow node components using memo() to prevent unnecessary re-renders

Applied to files:

  • src/frontend/src/pages/FlowPage/components/InspectionPanel/index.tsx
  • src/frontend/src/pages/FlowPage/components/InspectionPanel/components/InspectionPanelHeader.tsx
  • src/frontend/src/pages/FlowPage/components/InspectionPanel/components/InspectionPanelFields.tsx
  • src/frontend/src/pages/FlowPage/components/PageComponent/index.tsx
📚 Learning: 2025-06-23T12:46:42.048Z
Learnt from: CR
Repo: langflow-ai/langflow PR: 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.

Applied to files:

  • src/frontend/src/pages/FlowPage/components/InspectionPanel/index.tsx
  • src/frontend/src/pages/FlowPage/components/InspectionPanel/components/InspectionPanelHeader.tsx
  • src/frontend/src/CustomNodes/GenericNode/components/NodeInputField/index.tsx
  • src/frontend/src/pages/FlowPage/components/PageComponent/index.tsx
📚 Learning: 2025-06-23T12:46:42.048Z
Learnt from: CR
Repo: langflow-ai/langflow PR: 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.

Applied to files:

  • src/frontend/src/pages/FlowPage/components/PageComponent/index.tsx
🧬 Code graph analysis (4)
src/frontend/src/pages/FlowPage/components/InspectionPanel/index.tsx (4)
src/frontend/src/types/flow/index.ts (1)
  • AllNodeType (42-42)
src/frontend/src/utils/utils.ts (1)
  • cn (38-40)
src/frontend/src/pages/FlowPage/components/InspectionPanel/components/InspectionPanelHeader.tsx (1)
  • InspectionPanelHeader (15-94)
src/frontend/src/pages/FlowPage/components/InspectionPanel/components/InspectionPanelFields.tsx (1)
  • InspectionPanelFields (12-79)
src/frontend/src/pages/FlowPage/components/InspectionPanel/components/InspectionPanelHeader.tsx (3)
src/frontend/src/types/flow/index.ts (1)
  • NodeDataType (63-72)
src/frontend/src/CustomNodes/GenericNode/components/nodeIcon/index.tsx (1)
  • NodeIcon (9-49)
src/frontend/src/modals/codeAreaModal/index.tsx (1)
  • CodeAreaModal (34-292)
src/frontend/src/pages/FlowPage/components/InspectionPanel/components/InspectionPanelFields.tsx (2)
src/frontend/src/types/flow/index.ts (1)
  • NodeDataType (63-72)
src/frontend/src/pages/FlowPage/components/InspectionPanel/components/InspectionPanelField.tsx (1)
  • InspectionPanelField (28-189)
src/frontend/src/pages/FlowPage/components/PageComponent/index.tsx (1)
src/frontend/src/types/flow/index.ts (1)
  • AllNodeType (42-42)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (52)
  • GitHub Check: Run Frontend Tests / Playwright Tests - Shard 37/50
  • GitHub Check: Run Frontend Tests / Playwright Tests - Shard 46/50
  • GitHub Check: Run Frontend Tests / Playwright Tests - Shard 44/50
  • GitHub Check: Run Frontend Tests / Playwright Tests - Shard 25/50
  • GitHub Check: Run Frontend Tests / Playwright Tests - Shard 30/50
  • GitHub Check: Run Frontend Tests / Playwright Tests - Shard 40/50
  • GitHub Check: Run Frontend Tests / Playwright Tests - Shard 50/50
  • GitHub Check: Run Frontend Tests / Playwright Tests - Shard 47/50
  • GitHub Check: Run Frontend Tests / Playwright Tests - Shard 45/50
  • GitHub Check: Run Frontend Tests / Playwright Tests - Shard 38/50
  • GitHub Check: Run Frontend Tests / Playwright Tests - Shard 41/50
  • GitHub Check: Run Frontend Tests / Playwright Tests - Shard 33/50
  • GitHub Check: Run Frontend Tests / Playwright Tests - Shard 39/50
  • GitHub Check: Run Frontend Tests / Playwright Tests - Shard 43/50
  • GitHub Check: Run Frontend Tests / Playwright Tests - Shard 42/50
  • GitHub Check: Run Frontend Tests / Playwright Tests - Shard 36/50
  • GitHub Check: Run Frontend Tests / Playwright Tests - Shard 31/50
  • GitHub Check: Run Frontend Tests / Playwright Tests - Shard 29/50
  • GitHub Check: Run Frontend Tests / Playwright Tests - Shard 49/50
  • GitHub Check: Run Frontend Tests / Playwright Tests - Shard 34/50
  • GitHub Check: Run Frontend Tests / Playwright Tests - Shard 48/50
  • GitHub Check: Run Frontend Tests / Playwright Tests - Shard 35/50
  • GitHub Check: Run Frontend Tests / Playwright Tests - Shard 32/50
  • GitHub Check: Run Frontend Tests / Playwright Tests - Shard 15/50
  • GitHub Check: Run Frontend Tests / Playwright Tests - Shard 28/50
  • GitHub Check: Run Frontend Tests / Playwright Tests - Shard 27/50
  • GitHub Check: Run Frontend Tests / Playwright Tests - Shard 20/50
  • GitHub Check: Run Frontend Tests / Playwright Tests - Shard 18/50
  • GitHub Check: Run Frontend Tests / Playwright Tests - Shard 7/50
  • GitHub Check: Run Frontend Tests / Playwright Tests - Shard 16/50
  • GitHub Check: Run Frontend Tests / Playwright Tests - Shard 10/50
  • GitHub Check: Run Frontend Tests / Playwright Tests - Shard 11/50
  • GitHub Check: Run Frontend Tests / Playwright Tests - Shard 19/50
  • GitHub Check: Run Frontend Tests / Playwright Tests - Shard 14/50
  • GitHub Check: Run Frontend Tests / Playwright Tests - Shard 26/50
  • GitHub Check: Run Frontend Tests / Playwright Tests - Shard 17/50
  • GitHub Check: Run Frontend Tests / Playwright Tests - Shard 12/50
  • GitHub Check: Run Frontend Tests / Playwright Tests - Shard 21/50
  • GitHub Check: Run Frontend Tests / Playwright Tests - Shard 23/50
  • GitHub Check: Run Frontend Tests / Playwright Tests - Shard 1/50
  • GitHub Check: Run Frontend Tests / Playwright Tests - Shard 4/50
  • GitHub Check: Run Frontend Tests / Playwright Tests - Shard 13/50
  • GitHub Check: Run Frontend Tests / Playwright Tests - Shard 6/50
  • GitHub Check: Run Frontend Tests / Playwright Tests - Shard 24/50
  • GitHub Check: Run Frontend Tests / Playwright Tests - Shard 3/50
  • GitHub Check: Run Frontend Tests / Playwright Tests - Shard 9/50
  • GitHub Check: Run Frontend Tests / Playwright Tests - Shard 22/50
  • GitHub Check: Run Frontend Tests / Playwright Tests - Shard 2/50
  • GitHub Check: Run Frontend Tests / Playwright Tests - Shard 5/50
  • GitHub Check: Run Frontend Tests / Playwright Tests - Shard 8/50
  • GitHub Check: Test Docker Images / Test docker images
  • GitHub Check: Test Starter Templates
🔇 Additional comments (1)
src/frontend/src/pages/FlowPage/components/InspectionPanel/components/InspectionPanelFields.tsx (1)

12-43: Solid field list derivation + ordering logic.

The useMemo + filter + sortToolModeFields(...) pipeline reads clean and matches the “show all fields in panel” objective.

Comment on lines +35 to +50
// Basic visibility check
if (
!template?.show ||
template?.advanced ||
(template?.tool_mode && isToolMode)
) {
return false;
}

// Only show fields that have handles (input_types)
const hasHandle = template.input_types && template.input_types.length > 0;
if (!hasHandle) {
return false;
}

return true;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

# First, let's search for templates/definitions that have both refresh_button and input_types
rg -n "refresh_button|input_types" src/frontend/src --type tsx --type ts --type json -A 2 -B 2 | head -100

Repository: langflow-ai/langflow

Length of output: 91


🏁 Script executed:

# Also search more broadly for template definitions and the NodeInputField component
fd -t f "NodeInputField|template" src/frontend/src --type tsx --type ts | head -20

Repository: langflow-ai/langflow

Length of output: 234


🏁 Script executed:

# Look at the actual RenderInputParameters file to see the full context
wc -l src/frontend/src/CustomNodes/GenericNode/components/RenderInputParameters/index.tsx

Repository: langflow-ai/langflow

Length of output: 151


🏁 Script executed:

# Get the full file to understand the context better
cat -n src/frontend/src/CustomNodes/GenericNode/components/RenderInputParameters/index.tsx | head -80

Repository: langflow-ai/langflow

Length of output: 2926


🏁 Script executed:

# Search for NodeInputField usage and displayHandle logic
rg -n "displayHandle|NodeInputField" src/frontend/src -A 3 -B 1 --type tsx --type ts | head -80

Repository: langflow-ai/langflow

Length of output: 91


🏁 Script executed:

# Read the rest of the file to see how shownTemplateFields is used
cat -n src/frontend/src/CustomNodes/GenericNode/components/RenderInputParameters/index.tsx | tail -70

Repository: langflow-ai/langflow

Length of output: 2549


🏁 Script executed:

# Find NodeInputField component
fd -name "NodeInputField*" src/frontend/src

Repository: langflow-ai/langflow

Length of output: 294


🏁 Script executed:

# Search for refresh_button and input_types (without file type filter)
rg -n "refresh_button" src/frontend/src -A 2 -B 2 | head -80

Repository: langflow-ai/langflow

Length of output: 2664


🏁 Script executed:

# Find and read NodeInputField component
find src/frontend/src -name "NodeInputField*" -type f

Repository: langflow-ai/langflow

Length of output: 46


🏁 Script executed:

# Read the NodeInputField component
cat -n src/frontend/src/CustomNodes/GenericNode/components/NodeInputField/index.tsx | head -150

Repository: langflow-ai/langflow

Length of output: 5769


🏁 Script executed:

# Search for template definitions or examples with both refresh_button and input_types
rg -n "input_types" src/frontend/src -B 3 -A 3 | grep -E "(input_types|refresh_button)" | head -50

Repository: langflow-ai/langflow

Length of output: 6099


🏁 Script executed:

# Read the rest of NodeInputField to see the full rendering logic
cat -n src/frontend/src/CustomNodes/GenericNode/components/NodeInputField/index.tsx | sed -n '140,200p'

Repository: langflow-ai/langflow

Length of output: 2347


🏁 Script executed:

# Check if there are any template definitions/examples that show both refresh_button and input_types together
rg -l "refresh_button" src/frontend/src | head -10

Repository: langflow-ai/langflow

Length of output: 404


🏁 Script executed:

# Search for any test data or mock templates with both properties
rg "refresh_button.*input_types|input_types.*refresh_button" src/frontend/src -B 5 -A 5

Repository: langflow-ai/langflow

Length of output: 46


🏁 Script executed:

# Read more of NodeInputField to see what renders the actual editor/input
cat -n src/frontend/src/CustomNodes/GenericNode/components/NodeInputField/index.tsx | sed -n '200,280p'

Repository: langflow-ai/langflow

Length of output: 2371


🏁 Script executed:

# Look for parameterRenderComponent usage within NodeInputField
rg -n "parameterRenderComponent\|ParameterRender" src/frontend/src/CustomNodes/GenericNode/components/NodeInputField/index.tsx -A 3 -B 3

Repository: langflow-ai/langflow

Length of output: 46


🏁 Script executed:

# Check what LANGFLOW_SUPPORTED_TYPES contains
rg -n "LANGFLOW_SUPPORTED_TYPES" src/frontend/src/constants/constants.ts -A 10

Repository: langflow-ai/langflow

Length of output: 268


🏁 Script executed:

# Check types to understand input_types structure better
cat -n src/frontend/src/types/api/index.ts | sed -n '35,95p'

Repository: langflow-ai/langflow

Length of output: 1859


🏁 Script executed:

# Look for any model-type fields with refresh_button to understand the edge case
rg -n "refresh_button" src/frontend/src -B 5 -A 5 | grep -E "(type.*model|refresh_button|input_types)" | head -30

Repository: langflow-ai/langflow

Length of output: 788


Address the "blank row" risk where fields have input_types + refresh_button but no visible editor or handle.

The filter passes any field with input_types, but NodeInputField hides its editor when optionalHandle is present (line 230). If such a field also has refresh_button: true and is not a model type, the condition (!hasRefreshButton || isModelInput) becomes false, hiding the handle as well. This leaves an empty row with neither editor nor connection point.

Verify that no field template combines refresh_button: true, non-empty input_types, and type ≠ "model", or if such fields exist, confirm this blank-row rendering is intentional.

Additionally, harden the input_types check to use Array.isArray() for defensive programming, matching the pattern already used elsewhere in NodeInputField (line 109):

Proposed change
-      const hasHandle = template.input_types && template.input_types.length > 0;
+      const hasHandle =
+        Array.isArray(template.input_types) && template.input_types.length > 0;
       if (!hasHandle) {
         return false;
       }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
// Basic visibility check
if (
!template?.show ||
template?.advanced ||
(template?.tool_mode && isToolMode)
) {
return false;
}
// Only show fields that have handles (input_types)
const hasHandle = template.input_types && template.input_types.length > 0;
if (!hasHandle) {
return false;
}
return true;
// Basic visibility check
if (
!template?.show ||
template?.advanced ||
(template?.tool_mode && isToolMode)
) {
return false;
}
// Only show fields that have handles (input_types)
const hasHandle =
Array.isArray(template.input_types) && template.input_types.length > 0;
if (!hasHandle) {
return false;
}
return true;
🤖 Prompt for AI Agents
In
@src/frontend/src/CustomNodes/GenericNode/components/RenderInputParameters/index.tsx
around lines 35 - 50, The current visibility filter returns true for any
template with input_types, but that can produce a blank row when NodeInputField
hides its editor due to optionalHandle and also hides the handle when
refresh_button is true on non-model inputs; update the check in the renderer
(the hasHandle logic around template.input_types) to first use
Array.isArray(template.input_types) && template.input_types.length > 0 and then
exclude templates where template.refresh_button === true && template.type !==
"model" (or otherwise ensure such templates render a visible editor/handle);
locate the template checks in this function and adjust the boolean logic so
fields that would end up with neither editor nor handle are filtered out (or
alternatively, ensure NodeInputField/optionalHandle logic is changed to prevent
blank rows consistently).

Comment on lines +71 to +80
const nodeInformationMetadata = useMemo(() => {
return {
flowId: currentFlowId ?? "",
nodeType: data?.type?.toLowerCase() ?? "",
flowName: currentFlowName ?? "",
isAuth: shouldDisplayApiKey!,
variableName: name,
};
}, [data?.node?.id, shouldDisplayApiKey, name]);

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Fix useMemo deps to avoid stale nodeInformationMetadata.

nodeInformationMetadata uses currentFlowId, currentFlowName, and data.type, but they’re not in the dependency list, so metadata can silently go stale.

Proposed fix
   const nodeInformationMetadata = useMemo(() => {
     return {
       flowId: currentFlowId ?? "",
       nodeType: data?.type?.toLowerCase() ?? "",
       flowName: currentFlowName ?? "",
       isAuth: shouldDisplayApiKey!,
       variableName: name,
     };
-  }, [data?.node?.id, shouldDisplayApiKey, name]);
+  }, [currentFlowId, currentFlowName, data?.type, shouldDisplayApiKey, name]);
🤖 Prompt for AI Agents
In
@src/frontend/src/pages/FlowPage/components/InspectionPanel/components/InspectionPanelField.tsx
around lines 71 - 80, The useMemo for nodeInformationMetadata is missing
dependencies and can produce stale values; update the dependency array of the
useMemo that defines nodeInformationMetadata to include currentFlowId,
currentFlowName, and data?.type in addition to the existing shouldDisplayApiKey
and name (and optionally keep data?.node?.id if you still need it) so the memo
recalculates when currentFlowId, currentFlowName, or data.type change.

Comment on lines +94 to +101
<div
className={cn(
"relative flex min-h-10 w-full flex-wrap items-center justify-between px-3 py-1.5",
isToolMode && "bg-primary/10",
(name === "code" && type === "code") || (name.includes("code") && proxy)
? "hidden"
: "",
)}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

# First, let's read the file to understand the full context
cat -n "src/frontend/src/pages/FlowPage/components/InspectionPanel/components/InspectionPanelField.tsx" | head -120 | tail -40

Repository: langflow-ai/langflow

Length of output: 1500


🏁 Script executed:

# Get more context around lines 94-101
wc -l "src/frontend/src/pages/FlowPage/components/InspectionPanel/components/InspectionPanelField.tsx"

Repository: langflow-ai/langflow

Length of output: 162


🏁 Script executed:

# Read the entire file to understand the component structure
cat -n "src/frontend/src/pages/FlowPage/components/InspectionPanel/components/InspectionPanelField.tsx"

Repository: langflow-ai/langflow

Length of output: 7409


🏁 Script executed:

# Search for where this component is used and what name values are passed
rg "InspectionPanelField" --type tsx -A 3 -B 1 | head -100

Repository: langflow-ai/langflow

Length of output: 91


🏁 Script executed:

# Look for field names that might contain "code"
rg "name.*code|code.*name" --type tsx -i | head -50

Repository: langflow-ai/langflow

Length of output: 91


🏁 Script executed:

# Search for InspectionPanelField usage with name parameters
rg "InspectionPanelField" -A 5 -B 2 | head -150

Repository: langflow-ai/langflow

Length of output: 5862


🏁 Script executed:

# Search for field definitions that might contain "code" in their names
rg "name.*=.*code|code.*name" --type ts --type tsx -i -A 2 -B 2 | head -100

Repository: langflow-ai/langflow

Length of output: 91


🏁 Script executed:

# Look for template fields that might be passed as name prop
rg "template\[.*code" --type ts --type tsx -A 2 -B 2 | head -50

Repository: langflow-ai/langflow

Length of output: 91


🏁 Script executed:

# Search for what proxy fields might be and their naming patterns
rg "proxy" --type tsx -B 3 -A 3 "InspectionPanel" | head -80

Repository: langflow-ai/langflow

Length of output: 91


🏁 Script executed:

# Find all usages of name.includes pattern in codebase
rg 'name\.includes.*code' --type ts --type tsx

Repository: langflow-ai/langflow

Length of output: 91


🏁 Script executed:

# Look for InspectionPanelFields.tsx to see how fields are iterated
cat -n "src/frontend/src/pages/FlowPage/components/InspectionPanel/components/InspectionPanelFields.tsx"

Repository: langflow-ai/langflow

Length of output: 2970


🏁 Script executed:

# Search for name.includes pattern anywhere in the codebase
rg 'name\.includes' -A 2 -B 2 | head -80

Repository: langflow-ai/langflow

Length of output: 5103


🏁 Script executed:

# Look for proxy-related field names in templates
rg '"code"' src/frontend --max-count 50 | grep -i name

Repository: langflow-ai/langflow

Length of output: 4997


🏁 Script executed:

# Search for field definitions/templates that contain "code" in various files
rg '"[^"]*code[^"]*":\s*{' -A 3 src/frontend --max-count 30

Repository: langflow-ai/langflow

Length of output: 169


🏁 Script executed:

# Look for proxy field definitions with "code" in their names
rg 'proxy.*true' src/backend -A 2 -B 2 | grep -i code | head -50

Repository: langflow-ai/langflow

Length of output: 50376


🏁 Script executed:

# Check NodeInputField to see if it has similar logic
cat -n "src/frontend/src/CustomNodes/GenericNode/components/NodeInputField/index.tsx" | grep -A 10 -B 10 'name.includes.*code'

Repository: langflow-ai/langflow

Length of output: 772


🏁 Script executed:

# Search for proxy field definitions with any field names
rg '"proxy".*"field"' -A 2 -B 2 | head -80

Repository: langflow-ai/langflow

Length of output: 50377


🏁 Script executed:

# Look for any fields that might be code-related with proxy
rg 'includes.*code|encode|decode' src/frontend --type ts -A 3 -B 3 | head -100

Repository: langflow-ai/langflow

Length of output: 6939


🏁 Script executed:

# Check the actual backend to understand what fields exist
find src/backend -name "*.py" -type f | head -20 | xargs rg 'proxy.*=.*True' -A 2 -B 2 | head -80

Repository: langflow-ai/langflow

Length of output: 46


🏁 Script executed:

# Search for actual proxy field patterns and names more carefully
rg '"field"\s*:\s*"[^"]*code' src/backend src/frontend -A 1 -B 1 | head -50

Repository: langflow-ai/langflow

Length of output: 1330


🏁 Script executed:

# Check if there are any Python definitions of fields with "code" in name and proxy=True
find src/backend -name "*.py" -type f -exec grep -l "proxy.*True" {} \; | head -5 | xargs grep -B 5 -A 5 'name.*=.*' | grep -i code

Repository: langflow-ai/langflow

Length of output: 46


🏁 Script executed:

# Let's verify the filtering is indeed redundant by checking if any fields pass both filters
python3 << 'EOF'
# Simulate the logic from InspectionPanelFields
test_fields = [
    ("code", {"show": True, "type": "code"}),
    ("model_kwargs", {"show": True, "type": "code", "proxy": {"id": "x", "field": "y"}}),
    ("my_code_field", {"show": True, "type": "str", "proxy": {"id": "x", "field": "z"}}),
    ("code_handler", {"show": True, "type": "str", "proxy": {"id": "x", "field": "w"}}),
    ("llm", {"show": True, "type": "BaseLanguageModel", "proxy": {"id": "x", "field": "llm"}}),
]

print("Fields that would be filtered (redundantly hidden in InspectionPanelField):")
for field_name, template in test_fields:
    if (field_name == "code" and template.get("type") == "code") or (field_name.includes("code") and template.get("proxy")):
        print(f"  - {field_name}: includes('code')={field_name.includes('code')}, proxy={bool(template.get('proxy'))}")
EOF

Repository: langflow-ai/langflow

Length of output: 150


🏁 Script executed:

# Better approach - check actual field data from real flows
rg -A 15 '"template"\s*:' src/backend/tests/data/grouped_chat.json 2>/dev/null | grep -E '"name"|"type"|"proxy"' | head -40

Repository: langflow-ai/langflow

Length of output: 20337


🏁 Script executed:

# Check if fields filtered in InspectionPanelFields ever reach InspectionPanelField
cat -n "src/frontend/src/pages/FlowPage/components/InspectionPanel/components/InspectionPanelFields.tsx" | head -50

Repository: langflow-ai/langflow

Length of output: 1946


Tighten the field name matching to avoid unintentionally hiding unrelated fields.

The condition name.includes("code") is overly broad and can hide valid fields with names like "encode", "decode", or any field containing "code" as a substring. Since proxy fields with "field": "code" do exist in the codebase, a more precise predicate is warranted.

Suggested fix
-        (name === "code" && type === "code") || (name.includes("code") && proxy)
+        (name === "code" && type === "code") ||
+        (proxy && /(^|_)code($|_)/.test(name))
           ? "hidden"
           : "",
🤖 Prompt for AI Agents
In
@src/frontend/src/pages/FlowPage/components/InspectionPanel/components/InspectionPanelField.tsx
around lines 94 - 101, The name matching is too broad: replace the substring
check `name.includes("code")` with a precise check so unrelated fields like
"encode" aren't hidden; update the condition in InspectionPanelField.tsx so the
hidden branch only triggers for an explicit code field (e.g., keep `(name ===
"code" && type === "code")` and change the proxy case to check the proxy's
declared field like `proxy?.field === "code"` or `proxy && proxy.field ===
"code"`) so only actual proxy fields that target "code" hide the element.

Comment on lines 52 to 77
return (
<div className="space-y-2 p-3">
{allFields.map((templateField: string) => {
const template = data.node?.template[templateField];

return (
<InspectionPanelField
key={`${data.id}-${templateField}`}
data={data}
title={getFieldTitle(data.node?.template!, templateField)}
info={template.info!}
name={templateField}
required={template.required}
id={{
inputTypes: template.input_types,
type: template.type,
id: data.id,
fieldName: templateField,
}}
proxy={template.proxy}
showNode={true}
isToolMode={false}
/>
);
})}
</div>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Add a defensive guard for missing template entries to avoid runtime crashes.

If data.node.template is mutated/updated between allFields computation and render (or if template keys are sparse), template can be undefined and template.* will throw.

Proposed fix
   return (
     <div className="space-y-2 p-3">
       {allFields.map((templateField: string) => {
-        const template = data.node?.template[templateField];
+        const template = data.node?.template?.[templateField];
+        if (!template) return null;

         return (
           <InspectionPanelField
             key={`${data.id}-${templateField}`}
             data={data}
             title={getFieldTitle(data.node?.template!, templateField)}
-            info={template.info!}
+            info={template.info ?? ""}
             name={templateField}
-            required={template.required}
+            required={!!template.required}
             id={{
               inputTypes: template.input_types,
               type: template.type,
               id: data.id,
               fieldName: templateField,
             }}
             proxy={template.proxy}
             showNode={true}
             isToolMode={false}
           />
         );
       })}
     </div>
   );
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
return (
<div className="space-y-2 p-3">
{allFields.map((templateField: string) => {
const template = data.node?.template[templateField];
return (
<InspectionPanelField
key={`${data.id}-${templateField}`}
data={data}
title={getFieldTitle(data.node?.template!, templateField)}
info={template.info!}
name={templateField}
required={template.required}
id={{
inputTypes: template.input_types,
type: template.type,
id: data.id,
fieldName: templateField,
}}
proxy={template.proxy}
showNode={true}
isToolMode={false}
/>
);
})}
</div>
return (
<div className="space-y-2 p-3">
{allFields.map((templateField: string) => {
const template = data.node?.template?.[templateField];
if (!template) return null;
return (
<InspectionPanelField
key={`${data.id}-${templateField}`}
data={data}
title={getFieldTitle(data.node?.template!, templateField)}
info={template.info ?? ""}
name={templateField}
required={!!template.required}
id={{
inputTypes: template.input_types,
type: template.type,
id: data.id,
fieldName: templateField,
}}
proxy={template.proxy}
showNode={true}
isToolMode={false}
/>
);
})}
</div>
);
🤖 Prompt for AI Agents
In
@src/frontend/src/pages/FlowPage/components/InspectionPanel/components/InspectionPanelFields.tsx
around lines 52 - 77, The render loop over allFields can crash if
data.node?.template[templateField] is undefined; modify the map in
InspectionPanelFields to guard against missing template entries by checking that
const template = data.node?.template?.[templateField] exists before returning an
<InspectionPanelField/>; if template is undefined, either skip rendering that
iteration (return null) or render a safe fallback with defaults, and ensure
getFieldTitle is only called when template is present; reference the map over
allFields, the template variable, getFieldTitle, and the InspectionPanelField
component when making the change.

);
}

// Made with Bob
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Remove the stray “Made with Bob” comment before merging.

🤖 Prompt for AI Agents
In
@src/frontend/src/pages/FlowPage/components/InspectionPanel/components/InspectionPanelFields.tsx
at line 81, Remove the stray comment line containing "Made with Bob" from the
InspectionPanelFields.tsx file: locate the comment in the InspectionPanelFields
component (or nearby top-level file header) and delete that line so no stray
comment remains; then run the project's lint/format step to ensure no trailing
whitespace or formatting issues.

Comment on lines 60 to 91
{hasCode && (
<ShadTooltip content="View Code" side="left">
<Button
variant="ghost"
size="icon"
className="h-8 w-8"
onClick={handleOpenCode}
>
<IconComponent name="Code" className="h-4 w-4" />
</Button>
</ShadTooltip>
)}
</div>

{hasCode && openCodeModal && (
<div className="hidden">
<CodeAreaModal
setValue={handleSetValue}
open={openCodeModal}
setOpen={setOpenCodeModal}
dynamic={true}
setNodeClass={(apiClassType, type) => {
handleNodeClass(apiClassType, type);
}}
nodeClass={data.node}
value={data.node?.template?.code?.value ?? ""}
componentId={data.id}
>
<></>
</CodeAreaModal>
</div>
)}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Find BaseModal implementation
rg -n "export.*BaseModal|class BaseModal" src/frontend/src --type tsx --type ts -A 5 | head -50

Repository: langflow-ai/langflow

Length of output: 91


🏁 Script executed:

#!/bin/bash
# Find CodeAreaModal implementation
rg -n "export.*CodeAreaModal|function CodeAreaModal" src/frontend/src --type tsx --type ts -A 3 | head -40

Repository: langflow-ai/langflow

Length of output: 91


🏁 Script executed:

#!/bin/bash
# Check the full InspectionPanelHeader.tsx file to verify line 96 and surrounding context
wc -l src/frontend/src/pages/FlowPage/components/InspectionPanel/components/InspectionPanelHeader.tsx

Repository: langflow-ai/langflow

Length of output: 162


🏁 Script executed:

#!/bin/bash
# Read the full file to see context around the lines in question
cat -n src/frontend/src/pages/FlowPage/components/InspectionPanel/components/InspectionPanelHeader.tsx

Repository: langflow-ai/langflow

Length of output: 3624


🏁 Script executed:

#!/bin/bash
# Find BaseModal implementation
fd -e ts -e tsx . src/frontend/src | xargs grep -l "export.*BaseModal\|class BaseModal" | head -5

Repository: langflow-ai/langflow

Length of output: 453


🏁 Script executed:

#!/bin/bash
# Find CodeAreaModal implementation
fd -e ts -e tsx . src/frontend/src | xargs grep -l "CodeAreaModal" | grep -E "codeAreaModal|CodeAreaModal" | head -5

Repository: langflow-ai/langflow

Length of output: 457


🏁 Script executed:

#!/bin/bash
# Find ShadTooltip implementation
fd -e ts -e tsx . src/frontend/src | xargs grep -l "ShadTooltip" | grep -i tooltip | head -5

Repository: langflow-ai/langflow

Length of output: 475


🏁 Script executed:

#!/bin/bash
# Search for BaseModal in the codebase
rg -l "BaseModal" src/frontend/src | head -10

Repository: langflow-ai/langflow

Length of output: 585


🏁 Script executed:

#!/bin/bash
# Read BaseModal implementation
cat -n src/frontend/src/modals/baseModal/index.tsx | head -100

Repository: langflow-ai/langflow

Length of output: 3306


🏁 Script executed:

#!/bin/bash
# Read CodeAreaModal implementation
cat -n src/frontend/src/modals/codeAreaModal/index.tsx | head -150

Repository: langflow-ai/langflow

Length of output: 5945


🏁 Script executed:

#!/bin/bash
# Read ShadTooltip implementation
cat -n src/frontend/src/components/common/shadTooltipComponent/index.tsx

Repository: langflow-ai/langflow

Length of output: 3183


Add aria-label to icon-only "View Code" button for accessibility.

The button at line 62-69 is icon-only and should have an aria-label for screen readers. While wrapped in ShadTooltip, the tooltip content is visual-only and does not provide accessible labeling. Additionally, remove the unnecessary // Made with Bob comment at line 96 and the redundant hidden wrapper around CodeAreaModal (the modal already manages visibility via the open prop).

Suggested adjustments
@@
             <Button
               variant="ghost"
               size="icon"
               className="h-8 w-8"
               onClick={handleOpenCode}
+              aria-label="View code"
             >
               <IconComponent name="Code" className="h-4 w-4" />
             </Button>
@@
-      {hasCode && openCodeModal && (
-        <div className="hidden">
-          <CodeAreaModal
+      {hasCode && openCodeModal && (
+        <CodeAreaModal
             setValue={handleSetValue}
             open={openCodeModal}
             setOpen={setOpenCodeModal}
             dynamic={true}
             setNodeClass={(apiClassType, type) => {
               handleNodeClass(apiClassType, type);
             }}
             nodeClass={data.node}
             value={data.node?.template?.code?.value ?? ""}
             componentId={data.id}
           >
-            <></>
+            <span />
           </CodeAreaModal>
-        </div>
       )}
@@
-// Made with Bob
🤖 Prompt for AI Agents
In
@src/frontend/src/pages/FlowPage/components/InspectionPanel/components/InspectionPanelHeader.tsx
around lines 60 - 91, The "View Code" icon-only Button in InspectionPanelHeader
should include an accessible label: add an aria-label (e.g., aria-label="View
code") to the Button that currently calls handleOpenCode so screen readers can
identify it (the ShadTooltip is visual-only). Also remove the unnecessary
surrounding <div className="hidden"> that wraps CodeAreaModal (the modal
controls visibility via its open prop) and delete the stray comment "// Made
with Bob" in this component; keep all existing props on CodeAreaModal
(setOpen={setOpenCodeModal}, open={openCodeModal}, setValue={handleSetValue},
nodeClass={data.node}, etc.) unchanged.

@github-actions github-actions bot added enhancement New feature or request and removed enhancement New feature or request labels Jan 13, 2026
@github-actions github-actions bot added enhancement New feature or request and removed enhancement New feature or request labels Jan 14, 2026
@github-actions github-actions bot added enhancement New feature or request and removed enhancement New feature or request labels Jan 14, 2026
@github-actions github-actions bot added enhancement New feature or request and removed enhancement New feature or request labels Jan 14, 2026
@github-actions github-actions bot removed the enhancement New feature or request label Jan 15, 2026
@github-actions github-actions bot added enhancement New feature or request and removed enhancement New feature or request labels Jan 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants