Skip to content

Conversation

@RohitR311
Copy link
Collaborator

@RohitR311 RohitR311 commented Nov 12, 2025

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.

Screenshot 2025-11-12 at 11 14 03 PM

Fixes #870

Summary by CodeRabbit

  • New Features
    • Robot settings page now dynamically renders limit fields for all available workflows and actions, replacing the previous single hard-coded field. Each read-only numeric field is labeled with its corresponding action name for clarity.

@coderabbitai
Copy link

coderabbitai bot commented Nov 12, 2025

Walkthrough

The 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

Cohort / File(s) Summary
Dynamic limit field rendering
src/components/robot/pages/RobotSettingsPage.tsx
Replaced hard-coded limit field with dynamic rendering that scans workflows/actions for limit args, renders read-only TextFields for each limit with action-specific or generated labels ("List N"), and omits fields entirely when no limits exist

Sequence Diagram

sequenceDiagram
    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
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • Focus on the nested flatMap/filter logic that collects limit args to ensure correctness
  • Verify label generation (action-specific vs. fallback "List N") handles edge cases
  • Confirm read-only state and proper conditional rendering when limits are absent

Possibly related PRs

  • PR #862: Updates rendering and name derivation logic for limit fields, touching the same rendering/naming functionality
  • PR #579: Implements server/API support and editing UI for multiple scrape-list limits in robot workflows
  • PR #858: Modifies labeling logic for list limit fields to use action/list names with generated fallbacks

Suggested labels

Type: Bug

Suggested reviewers

  • amhsirak

Poem

🐰 Many limits, no more hiding,
Each action's field is now residing,
Scan and filter, render with care,
All the limits, shown so fair!
One bug fixed—the bunny's delight! 🎉

Pre-merge checks and finishing touches

✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main fix: displaying limits for multiple list actions instead of just one.
Linked Issues check ✅ Passed The changes directly address issue #870 by replacing hard-coded single limit field with dynamic rendering for multiple list action limits.
Out of Scope Changes check ✅ Passed All changes are scoped to RobotSettingsPage.tsx and directly address the limit display issue for multiple list actions.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch setting-fix

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.

@RohitR311 RohitR311 added Type: Bug Something isn't working Scope: UI/UX Issues/PRs related to UI/UX labels Nov 12, 2025
Copy link

@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: 1

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 69ad028 and 8fd3528.

📒 Files selected for processing (1)
  • src/components/robot/pages/RobotSettingsPage.tsx (1 hunks)

Comment on lines +167 to +174
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={{
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.

@amhsirak amhsirak merged commit ddf0021 into develop Nov 20, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: UI/UX Issues/PRs related to UI/UX Type: Bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: Settings show only one limit for robots with multiple list actions

3 participants