Skip to content
Merged
Changes from all commits
Commits
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
44 changes: 30 additions & 14 deletions src/components/robot/pages/RobotSettingsPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -152,20 +152,36 @@ export const RobotSettingsPage = ({ handleStart }: RobotSettingsProps) => {
}}
style={{ marginBottom: "20px" }}
/>
{robot.recording.workflow?.[0]?.what?.[0]?.args?.[0]?.limit !==
undefined && (
<TextField
label={t("robot_settings.robot_limit")}
type="number"
value={
robot.recording.workflow[0].what[0].args[0].limit || ""
}
InputProps={{
readOnly: true,
}}
style={{ marginBottom: "20px" }}
/>
)}
{(() => {
let listCounter = 1;

return robot.recording.workflow.flatMap((wf, wfIndex) =>
wf.what.flatMap((action, actionIndex) => {
const argsWithLimit = action.args?.filter(
(arg: any) => arg && typeof arg === "object" && arg.limit !== undefined
);

if (!argsWithLimit?.length) return [];

return argsWithLimit.map((arg, limitIndex) => {
const labelName = action.name || `List ${listCounter++}`;
return (
<TextField
key={`limit-${wfIndex}-${actionIndex}-${limitIndex}`}
label={`${t("robot_settings.robot_limit")} (${labelName})`}
type="number"
value={arg.limit || ""}
InputProps={{
Comment on lines +167 to +174
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Display zero limits correctly.

When arg.limit is 0 the || "" fallback blanks the field, so the UI hides a valid limit. Use nullish coalescing to keep zero visible.

Apply this diff to preserve zero:

-                          value={arg.limit || ""}
+                          value={arg.limit ?? ""}
📝 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
const labelName = action.name || `List ${listCounter++}`;
return (
<TextField
key={`limit-${wfIndex}-${actionIndex}-${limitIndex}`}
label={`${t("robot_settings.robot_limit")} (${labelName})`}
type="number"
value={arg.limit || ""}
InputProps={{
const labelName = action.name || `List ${listCounter++}`;
return (
<TextField
key={`limit-${wfIndex}-${actionIndex}-${limitIndex}`}
label={`${t("robot_settings.robot_limit")} (${labelName})`}
type="number"
value={arg.limit ?? ""}
InputProps={{
🤖 Prompt for AI Agents
In src/components/robot/pages/RobotSettingsPage.tsx around lines 167 to 174, the
numeric TextField value uses the fallback `arg.limit || ""` which hides a valid
zero; replace the logical OR with nullish coalescing so zero is preserved (i.e.
use `arg.limit ?? ""`), ensuring the field renders 0 while still defaulting to
an empty string for null/undefined.

readOnly: true,
}}
style={{ marginBottom: "20px" }}
/>
);
});
})
);
})()}

<TextField
label={t("robot_settings.created_by_user")}
key="Created By User"
Expand Down