-
Notifications
You must be signed in to change notification settings - Fork 1.1k
fix: settings show only one limit for robots with multiple list actions #884
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
WalkthroughThe change replaces a single hard-coded robot limit field with dynamic rendering that scans all workflows and actions for limit arguments. Each discovered limit is rendered as a read-only numeric TextField with an action-specific label, with nested filtering logic determining which fields appear based on available limits. Changes
Sequence DiagramsequenceDiagram
participant RobotSettingsPage as RobotSettingsPage
participant Workflows as Workflows
participant Actions as Actions
participant Fields as TextField Render
RobotSettingsPage->>Workflows: Scan all workflows
loop For each workflow
Workflows->>Actions: Iterate actions
loop For each action
Actions->>Actions: Check for limit arg
alt Limit arg exists
Actions->>Fields: Create TextField<br/>(action name, limit value)
Fields->>Fields: Render read-only field
else No limit arg
Actions->>Actions: Skip
end
end
end
alt Limits found
Fields->>RobotSettingsPage: Render all fields
else No limits
RobotSettingsPage->>RobotSettingsPage: Render nothing
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes
Possibly related PRs
Suggested labels
Suggested reviewers
Poem
Pre-merge checks and finishing touches✅ Passed checks (5 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
| 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={{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
| 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.
What this PR does?
Fixes the issue with the robot settings displaying the limit of only a single capture list action even if multiple actions are present.
Fixes #870
Summary by CodeRabbit