Skip to content
Open
Show file tree
Hide file tree
Changes from 4 commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
cce966a
First prototype of inspection panel
lucaseduoli Jan 9, 2026
5429a4b
fixed value not being set
lucaseduoli Jan 9, 2026
ebe8886
Hide inputs that are not handles from the node, show everything else …
lucaseduoli Jan 9, 2026
b6bb0d4
[autofix.ci] apply automated fixes
autofix-ci[bot] Jan 9, 2026
2369db5
Implemented close button on inspection panel
lucaseduoli Jan 13, 2026
deedd21
Re-show inputs on the node
lucaseduoli Jan 14, 2026
bc12b15
remove code from node toolbar
lucaseduoli Jan 14, 2026
63eca6c
change code design on inspection panel
lucaseduoli Jan 14, 2026
dc6c424
create feature flag
lucaseduoli Jan 14, 2026
7355fb4
disable code and controls on node based on feature flag
lucaseduoli Jan 14, 2026
830beb9
adjusted inspection panel size
lucaseduoli Jan 14, 2026
a50cee2
[autofix.ci] apply automated fixes
autofix-ci[bot] Jan 14, 2026
3673b68
disable inspection panel with feature flag
lucaseduoli Jan 14, 2026
e51e4ee
Show only connections on component
lucaseduoli Jan 15, 2026
f541e1c
[autofix.ci] apply automated fixes
autofix-ci[bot] Jan 15, 2026
d2fbfdf
Merge remote-tracking branch 'origin/main' into feat/inspection_panel
lucaseduoli Jan 16, 2026
61d1b6e
[autofix.ci] apply automated fixes
autofix-ci[bot] Jan 16, 2026
a4ab8ff
Add output and logs to inspect panel
lucaseduoli Jan 16, 2026
12407f9
[autofix.ci] apply automated fixes
autofix-ci[bot] Jan 16, 2026
1dd1bb6
removed label from code button
lucaseduoli Jan 16, 2026
f494cc4
filter handleinputs
lucaseduoli Jan 16, 2026
29ce8d5
Merge remote-tracking branch 'origin/main' into feat/inspection_panel
lucaseduoli Jan 19, 2026
d0c6831
added description on inspection panel header
lucaseduoli Jan 19, 2026
745760c
remove tabs from inspection panel and use inspect output on node again
lucaseduoli Jan 19, 2026
eca1e53
Make inspect panel have flexible height and disable its animation
lucaseduoli Jan 19, 2026
dca90a5
[autofix.ci] apply automated fixes
autofix-ci[bot] Jan 19, 2026
28cc19f
Removed division from node name and inputs
lucaseduoli Jan 20, 2026
725e3ee
Reduce some gaps
lucaseduoli Jan 20, 2026
8d3bf63
[autofix.ci] apply automated fixes
autofix-ci[bot] Jan 20, 2026
504f4b3
Add docs button
lucaseduoli Jan 20, 2026
d005c4e
show docs just when exists
lucaseduoli Jan 20, 2026
1331af6
[autofix.ci] apply automated fixes
autofix-ci[bot] Jan 20, 2026
bee5509
added custom 4.5 height and width
lucaseduoli Jan 20, 2026
8c81ffe
Changed node text sizes and icon size
lucaseduoli Jan 20, 2026
e5ebd57
[autofix.ci] apply automated fixes
autofix-ci[bot] Jan 20, 2026
27fa9ad
Added freeze always to the node toolbar
lucaseduoli Jan 20, 2026
8b30f2a
Updated input size on inspect panel and output size on node
lucaseduoli Jan 20, 2026
ae227b5
[autofix.ci] apply automated fixes
autofix-ci[bot] Jan 20, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,8 @@ export default function NodeInputField({
/>
</div>

{data.node?.template[name] !== undefined && (
{/* Hide the input component when field has a handle - inputs are edited in Inspection Panel */}
{!optionalHandle && data.node?.template[name] !== undefined && (
<CustomParameterComponent
handleOnNewValue={handleOnNewValue}
name={name}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,23 @@ const RenderInputParameters = ({
const shownTemplateFields = useMemo(() => {
return templateFields.filter((templateField) => {
const template = data.node?.template[templateField];
return (
template?.show &&
!template?.advanced &&
!(template?.tool_mode && isToolMode)
);

// 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;
Comment on lines +44 to +59
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).

});
}, [templateFields, data.node?.template, isToolMode]);

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,191 @@
import { useMemo } from "react";
import { AssistantButton } from "@/components/common/assistant";
import IconComponent from "@/components/common/genericIconComponent";
import ShadTooltip from "@/components/common/shadTooltipComponent";
import {
CustomParameterComponent,
CustomParameterLabel,
getCustomParameterTitle,
} from "@/customization/components/custom-parameter";
import { LANGFLOW_AGENTIC_EXPERIENCE } from "@/customization/feature-flags";
import { useIsAutoLogin } from "@/hooks/use-is-auto-login";
import useAuthStore from "@/stores/authStore";
import useFlowStore from "@/stores/flowStore";
import { useTypesStore } from "@/stores/typesStore";
import type { NodeInputFieldComponentType } from "@/types/components";
import { cn } from "@/utils/utils";
import {
DEFAULT_TOOLSET_PLACEHOLDER,
FLEX_VIEW_TYPES,
ICON_STROKE_WIDTH,
} from "@/constants/constants";
import useHandleNodeClass from "@/CustomNodes/hooks/use-handle-node-class";
import { usePostTemplateValue } from "@/controllers/API/queries/nodes/use-post-template-value";
import useFetchDataOnMount from "@/CustomNodes/hooks/use-fetch-data-on-mount";
import useHandleOnNewValue from "@/CustomNodes/hooks/use-handle-new-value";
import NodeInputInfo from "@/CustomNodes/GenericNode/components/NodeInputInfo";

export default function InspectionPanelField({
id,
data,
title,
name = "",
required = false,
info = "",
showNode,
isToolMode = false,
proxy,
}: Omit<
NodeInputFieldComponentType,
| "colors"
| "tooltipTitle"
| "type"
| "optionalHandle"
| "colorName"
| "lastInput"
>) {
const isAuthenticated = useAuthStore((state) => state.isAuthenticated);
const isAutoLogin = useIsAutoLogin();
const shouldDisplayApiKey = isAuthenticated && !isAutoLogin;

const { currentFlowId, currentFlowName } = useFlowStore((state) => ({
currentFlowId: state.currentFlow?.id,
currentFlowName: state.currentFlow?.name,
}));

const myData = useTypesStore((state) => state.data);
const postTemplateValue = usePostTemplateValue({
node: data.node!,
nodeId: data.id,
parameterId: name,
});

const { handleNodeClass } = useHandleNodeClass(data.id);

const { handleOnNewValue } = useHandleOnNewValue({
node: data.node!,
nodeId: data.id,
name,
});

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

Comment on lines +71 to +80
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.

useFetchDataOnMount(
data.node!,
data.id,
handleNodeClass,
name,
postTemplateValue,
);

const template = data.node?.template[name];
const type = template?.type;
const isFlexView = FLEX_VIEW_TYPES.includes(type ?? "");

return (
<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"
: "",
)}
Comment on lines +94 to +101
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.

>
<div
className={cn(
"flex w-full flex-col gap-2",
isFlexView ? "flex-row" : "flex-col",
)}
>
<div className="flex w-full items-center justify-between text-sm">
<div className="flex w-full items-center truncate">
{proxy ? (
<ShadTooltip content={<span>{proxy.id}</span>}>
<span>
{getCustomParameterTitle({
title,
nodeId: data.id,
isFlexView,
required,
})}
</span>
</ShadTooltip>
) : (
<div className="flex gap-2">
<span className="text-sm font-medium">
{getCustomParameterTitle({
title,
nodeId: data.id,
isFlexView,
required,
})}
</span>
</div>
)}
<div>
{info !== "" && (
<ShadTooltip content={<NodeInputInfo info={info} />}>
<div className="cursor-help">
<IconComponent
name="Info"
strokeWidth={ICON_STROKE_WIDTH}
className="relative ml-1 h-3 w-3 text-placeholder"
/>
</div>
</ShadTooltip>
)}
</div>
{LANGFLOW_AGENTIC_EXPERIENCE &&
data.node?.template[name]?.ai_enabled && (
<AssistantButton
compData={id}
handleOnNewValue={handleOnNewValue}
inputValue={data.node?.template[name]?.value}
type="field"
/>
)}
</div>
<CustomParameterLabel
name={name}
nodeId={data.id}
templateValue={data.node?.template[name]}
nodeClass={data.node!}
/>
</div>

{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}
/>
)}
</div>
</div>
);
}

// Made with Bob
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
import { useMemo } from "react";
import { sortToolModeFields } from "@/CustomNodes/helpers/sort-tool-mode-field";
import getFieldTitle from "@/CustomNodes/utils/get-field-title";
import type { NodeDataType } from "@/types/flow";
import { LANGFLOW_SUPPORTED_TYPES } from "@/constants/constants";
import InspectionPanelField from "./InspectionPanelField";

interface InspectionPanelFieldsProps {
data: NodeDataType;
}

export default function InspectionPanelFields({
data,
}: InspectionPanelFieldsProps) {
// Get all fields in one list - show ALL fields in Inspection Panel
const allFields = useMemo(() => {
return Object.keys(data.node?.template || {})
.filter((templateField) => {
const template = data.node?.template[templateField];

// Filter out fields that shouldn't be shown
if (
templateField.charAt(0) === "_" ||
!template?.show ||
(templateField === "code" && template.type === "code") ||
(templateField.includes("code") && template.proxy)
) {
return false;
}

return true;
})
.sort((a, b) =>
sortToolModeFields(
a,
b,
data.node!.template,
data.node?.field_order ?? [],
false,
),
);
}, [data.node?.template, data.node?.field_order]);

if (allFields.length === 0) {
return (
<div className="flex items-center justify-center p-8 text-sm text-muted-foreground">
No fields available
</div>
);
}

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>
Comment on lines 58 to 83
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.

Loading
Loading