Skip to content

UN-2610 [FEAT] Implement simplified workflow studio UI #1442

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

Open
wants to merge 13 commits into
base: main
Choose a base branch
from

Conversation

jagadeeswaran-zipstack
Copy link
Contributor

@jagadeeswaran-zipstack jagadeeswaran-zipstack commented Jul 16, 2025

What

Complete UI overhaul of the workflow studio page

  • Integrated deployment options with dropdown selection
  • Conditional debug panel and configuration sidebar
  • Progress tracking with visual indicators

Why

The previous workflow studio interface was complex and overwhelming for users, with multiple
sidebars and scattered configuration options. This simplified approach:

  • Improves user experience with a cleaner, more intuitive layout
  • Reduces cognitive load by organizing workflow steps in logical sequence
  • Provides better visual hierarchy and progress indication
  • Maintains all existing functionality while improving usability
  • Follows modern UI/UX patterns for better user adoption

How

Major Changes:

  1. Integrated deployment modals directly into the workflow cards with dropdown selection
  2. Implemented conditional rendering for debug panel and configuration sidebar

Notes on Testing

Testing Scenarios:

  1. Connector Configuration: Test both source and destination connector setup flows
  2. API Integration: Verify prompt studio projects load correctly from API
  3. Deployment Flows: Test all three deployment types (API, ETL, TASK) trigger correct modals
  4. Debug Panel: Verify conditional rendering of debug information
  5. Sidebar Toggle: Test configuration sidebar show/hide functionality

Screenshots

image image image ![Uploading image.png…]()

athul-rs and others added 2 commits July 17, 2025 04:02
* UN-2541 Text Extractor Adapter edit update

* UN-2541 Text Extractor Adapter edit update#2

* UN-2591 update method for adapter

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Adding code replaced during refactoring

* Adding partial TRUE for update serializer

* Pre-commit resolution commit

* Refactoring as per git comments

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Copy link
Contributor

coderabbitai bot commented Jul 16, 2025

Summary by CodeRabbit

  • New Features

    • Introduced a card-based Workflow Builder UI with progress tracking, status messages, and a modular layout for configuring source, destination, tool selection, and deployment steps.
    • Added a Tool Selection Sidebar for easier tool browsing and selection.
    • New WorkflowCard component for displaying workflow steps.
    • Enhanced debug panel and sidebar for improved workflow management.
  • Improvements

    • Streamlined deployment and execution actions into a dropdown menu.
    • Improved workflow execution handling, including file upload support and better user feedback.
    • Enhanced empty state messaging for tools without configurable settings.
    • Added filtering options for deployments and pipelines by workflow.
  • Bug Fixes

    • Improved error handling and user alerts throughout the workflow configuration and execution process.
  • Style

    • Comprehensive new and updated CSS for workflow builder, cards, sidebars, and tool selection.
    • Removed obsolete styles related to the previous workflow steps and actions UI.
  • Refactor

    • Simplified and modularized workflow management by removing legacy step and execution components.
    • Replaced tabbed side panel with a focused tool settings view.
  • Chores

    • Removed unused and deprecated files associated with the old workflow steps and execution layouts.

Summary by CodeRabbit

  • New Features

    • Introduced a new workflow builder interface with a step-by-step card layout for configuring and deploying workflows.
    • Added a debug panel and a toggleable sidebar for enhanced workflow management.
    • Implemented a new WorkflowCard component for modular workflow step display.
  • Refactor

    • Replaced the previous workflow execution layout with a modern, card-based builder using Ant Design components.
    • Simplified the DsSettingsCard component by removing icons and streamlining the UI.
    • Simplified the SidePanel component by removing tabbed navigation and showing only the tool settings view.
    • Enhanced ToolSettings component to show an empty state when no configurable settings exist.
  • Style

    • Added comprehensive new CSS styles for the workflow builder, workflow cards, and settings card to improve layout, spacing, and visual consistency.
    • Added minor CSS for the side panel header.
  • Backend Enhancements

    • Added filtering by workflow ID to API deployment and pipeline viewsets.
    • Added frontend service methods to fetch deployments and pipelines filtered by workflow ID.
    • Added optional callbacks to deployment modals to notify parent components upon deployment creation.
  • Bug Fixes

    • Removed redundant API call in Steps component to prevent race conditions.

Walkthrough

A new workflow builder UI was implemented in the Agency component, replacing the previous layout and workflow execution interface. Supporting components and CSS were introduced or updated, including a new WorkflowCard component and related styles. The DsSettingsCard component was simplified by removing icons and adjusting its CSS. The SidePanel component was simplified by removing tabs and showing a static tool settings view. The ToolSettings component now displays a user-friendly empty state when no settings are available. Backend API viewsets were enhanced to support filtering by workflow ID. Frontend deployment and pipeline services were extended to fetch data filtered by workflow. Deployment modals now support optional callbacks after creation. The Steps component removed a redundant API call to avoid race conditions. New CSS files provide scoped styles for the workflow builder, workflow cards, settings card, and side panel header.

Changes

File(s) Change Summary
Agency component and styles
frontend/src/components/agency/agency/Agency.jsx, Agency.css
Refactored Agency component to implement a card-based workflow builder UI with progress tracking, deployment modals, debug panel, and sidebar; added comprehensive CSS for new layout and workflow UI.
WorkflowCard component and styles
frontend/src/components/agency/workflow-card/WorkflowCard.jsx, WorkflowCard.css
Added new WorkflowCard React component and corresponding CSS for layout and spacing.
DsSettingsCard component and styles
frontend/src/components/agency/ds-settings-card/DsSettingsCard.jsx, DsSettingsCard.css
Simplified DsSettingsCard by removing icons and related logic; added CSS for fixed select width and button alignment.
SidePanel component and styles
frontend/src/components/agency/side-panel/SidePanel.jsx, SidePanel.css
Simplified SidePanel by removing tab navigation and showing only tool settings; added CSS for side panel header.
ToolSettings component
frontend/src/components/agency/tool-settings/ToolSettings.jsx
Added empty state rendering for tools without configurable settings; minor code cleanup.
Steps component and styles
frontend/src/components/agency/steps/Steps.jsx, Steps.css
Removed redundant API call to check workflow update permission to fix race condition; component and styles removed.
API deployment service
frontend/src/components/deployments/api-deployment/api-deployments-service.js
Added method to fetch API deployments filtered by workflow ID.
CreateApiDeploymentModal component
frontend/src/components/deployments/create-api-deployment-modal/CreateApiDeploymentModal.jsx
Added optional callback prop invoked after successful deployment creation.
EtlTaskDeploy component
frontend/src/components/pipelines-or-deployments/etl-task-deploy/EtlTaskDeploy.jsx
Added optional callback prop invoked after successful pipeline creation.
Pipeline service
frontend/src/components/pipelines-or-deployments/pipeline-service.js
Added method to fetch pipelines filtered by workflow ID.
Backend API deployment viewset
backend/api_v2/api_deployment_views.py
Enhanced APIDeploymentViewSet to support filtering deployments by workflow ID via query parameter.
Backend pipeline viewset
backend/pipeline_v2/views.py
Enhanced PipelineViewSet to support filtering pipelines by workflow ID via query parameter.
ToolSelectionSidebar component and styles
frontend/src/components/agency/tool-selection-sidebar/ToolSelectionSidebar.jsx, ToolSelectionSidebar.css
Added new ToolSelectionSidebar component with comprehensive styles and logic for selecting and saving exported tools.
Actions component and styles
frontend/src/components/agency/actions/Actions.jsx, Actions.css
Removed Actions component and associated styles, migrating action handling into Agency component.
StepCard component and styles
frontend/src/components/agency/step-card/StepCard.jsx, StepCard.css
Removed StepCard component and styles, replaced by new workflow card-based UI.
WorkflowExecution components and styles
frontend/src/components/agency/workflow-execution/WorkflowExecution.jsx, WorkflowExecution.css
Removed WorkflowExecution component and styles as part of UI refactor.
WorkflowExecutionMain components and styles
frontend/src/components/agency/workflow-execution-layout/WorkflowExecutionMain.jsx, WorkflowExecutionMain.css
Removed WorkflowExecutionMain component and styles as part of UI refactor.
Workflow actions constants
frontend/src/components/agency/workflow-execution/workflow_actions.js
Deleted workflow action constants no longer used.

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant AgencyComponent
  participant API
  participant PostHog
  participant Modal

  User->>AgencyComponent: Visit workflow builder page
  AgencyComponent->>API: Fetch workflow endpoint details
  AgencyComponent->>API: Check if workflow updates allowed
  AgencyComponent->>API: Fetch prompt studio projects
  AgencyComponent->>AgencyComponent: Render workflow builder cards

  User->>AgencyComponent: Select source/output/prompt project
  User->>AgencyComponent: Click "Deploy" button
  AgencyComponent->>PostHog: Track deploy button click
  AgencyComponent->>AgencyComponent: Determine deployment type
  AgencyComponent->>Modal: Open corresponding deployment modal
  User->>Modal: Confirm deployment
  Modal->>API: Create deployment
  Modal->>AgencyComponent: Invoke onDeploymentCreated callback (if provided)
Loading
sequenceDiagram
  participant User
  participant AgencyComponent
  participant DebugPanel

  User->>AgencyComponent: Toggle Debug Panel button
  AgencyComponent->>DebugPanel: Show/hide debug panel
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~15 minutes

Note

⚡️ Unit Test Generation is now available in beta!

Learn more here, or try it out under "Finishing Touches" below.


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Cache: Disabled due to Reviews > Disable Cache setting
Knowledge Base: Disabled due to Reviews > Disable Knowledge Base setting

📥 Commits

Reviewing files that changed from the base of the PR and between dad6190 and 00b78c3.

📒 Files selected for processing (1)
  • frontend/src/components/agency/ds-settings-card/DsSettingsCard.jsx (3 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • frontend/src/components/agency/ds-settings-card/DsSettingsCard.jsx
⏰ 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). (1)
  • GitHub Check: build
✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch UN-2610-simplified-workflow-studio

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

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: 3

🧹 Nitpick comments (6)
frontend/src/components/agency/ds-settings-card/DsSettingsCard.css (1)

9-11: Consider removing !important and using more specific selectors.

The !important declaration suggests potential CSS specificity conflicts. Consider using more specific selectors or reviewing the cascade to avoid forcing styles.

-.ds-set-card-select{
-  width: 200px !important;
-}
+.workflow-card .ds-set-card-select,
+.ds-settings-card .ds-set-card-select {
+  width: 200px;
+}
frontend/src/components/agency/agency/Agency.css (3)

61-68: Consider overflow handling for viewport height layout.

The height: 100vh with overflow: auto is good, but consider adding min-height to prevent content cutoff on smaller screens.

 .workflow-builder-layout {
   height: 100vh;
+  min-height: 600px;
   background: #f5f5f5;
   display: flex;
   flex-direction: column;
   overflow: auto;
 }

163-171: Fixed width may impact responsiveness.

The width: 200px !important with !important could cause issues on smaller screens. Consider using responsive units or media queries.

 .workflow-select {
-  width: 200px !important;
+  width: 200px;
+  min-width: 150px;
+  max-width: 100%;
 }

200-211: Fixed sidebar width should be responsive.

The fixed width: 400px may be too wide on smaller screens. Consider responsive design.

 .workflow-sidebar {
   position: fixed;
   top: 0;
   right: 0;
-  width: 400px;
+  width: min(400px, 90vw);
   height: 100vh;
   background: white;
   border-left: 1px solid #d9d9d9;
   box-shadow: -2px 0 8px rgba(0, 0, 0, 0.15);
   z-index: 1000;
   overflow-y: auto;
 }
frontend/src/components/agency/agency/Agency.jsx (2)

23-26: Consider removing or documenting unused state variables

There are several state variables marked with eslint-disable-next-line no-unused-vars comments (inputMd, outputMd, activeToolId). If these are intended for future use, please add a comment explaining their purpose. Otherwise, consider removing them to keep the code clean.

Also applies to: 46-47


451-457: Use a proper close icon for better consistency

Consider using an Ant Design icon for the close button instead of the × character for better visual consistency.

+import { CloseOutlined } from "@ant-design/icons";

   <Button
     className="close-sidebar-btn"
     onClick={() => setShowSidebar(false)}
+    icon={<CloseOutlined />}
+    type="text"
     size="small"
-  >
-    ×
-  </Button>
+  />
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Cache: Disabled due to Reviews > Disable Cache setting
Knowledge Base: Disabled due to Reviews > Disable Knowledge Base setting

📥 Commits

Reviewing files that changed from the base of the PR and between 1b7d3b8 and f500a39.

📒 Files selected for processing (6)
  • frontend/src/components/agency/agency/Agency.css (1 hunks)
  • frontend/src/components/agency/agency/Agency.jsx (3 hunks)
  • frontend/src/components/agency/ds-settings-card/DsSettingsCard.css (1 hunks)
  • frontend/src/components/agency/ds-settings-card/DsSettingsCard.jsx (2 hunks)
  • frontend/src/components/agency/workflow-card/WorkflowCard.css (1 hunks)
  • frontend/src/components/agency/workflow-card/WorkflowCard.jsx (1 hunks)
🔇 Additional comments (14)
frontend/src/components/agency/ds-settings-card/DsSettingsCard.css (1)

13-15: Good use of flexbox alignment.

The align-self: flex-end property appropriately aligns the button within its flex container.

frontend/src/components/agency/workflow-card/WorkflowCard.css (1)

1-19: Well-structured component-specific styles.

The CSS follows good practices with:

  • Proper scoping using .workflow-card prefix
  • Consistent spacing and padding
  • Appropriate width adjustments for nested components

The override of base styles is justified for component-specific layout requirements.

frontend/src/components/agency/agency/Agency.css (1)

70-228: Comprehensive and well-structured workflow builder styles.

The CSS implementation demonstrates good practices:

  • Semantic class naming convention
  • Consistent spacing and color usage
  • Proper flexbox layouts
  • Appropriate use of z-index for layering
  • Good visual hierarchy
frontend/src/components/agency/ds-settings-card/DsSettingsCard.jsx (3)

359-368: Good simplification of button UI.

The change from a text button with icon to a primary button with clear "Configure" text improves usability and aligns with the simplified design goals.


335-348: Select component simplified appropriately.

Removing the size="small" prop allows the component to use default sizing, which works better with the new card layout and consistent styling.


14-14: Unused imports successfully cleaned up in DsSettingsCard.jsx

All import statements were reviewed—there are no remaining imports from @ant-design/icons or titleCase. No further cleanup is needed.

frontend/src/components/agency/workflow-card/WorkflowCard.jsx (4)

7-15: Well-designed component props interface.

The component accepts a flexible set of props that support both custom content and the default DsSettingsCard integration. The prop structure is intuitive and follows React best practices.


26-33: Good conditional rendering pattern.

The conditional rendering logic allows for flexibility between custom content and the default DsSettingsCard, making the component reusable across different workflow steps.


40-48: Comprehensive prop validation.

The PropTypes definitions are thorough and appropriate, with required props clearly marked and optional props having correct types.


16-37: Clean component structure with semantic HTML.

The component uses semantic div elements with appropriate CSS classes and integrates well with Ant Design's Flex and Typography components. The layout structure supports the card-based design effectively.

frontend/src/components/agency/agency/Agency.jsx (4)

1-2: Import organization looks good!

The new imports are well-organized and align with the PR objectives for implementing the simplified workflow studio UI.

Also applies to: 11-19


83-143: API functions are well-implemented

The API functions have consistent error handling and properly update the store with fetched data. Good job maintaining consistency across all three functions.


145-189: Deployment logic is well-structured

Good implementation of the deployment flow with proper validation and analytics tracking. The silent error handling for PostHog events is appropriate.


423-445: Debug panel implementation looks good

The conditional rendering and toggle functionality are well-implemented. The placeholder text appropriately indicates that functionality will be added later.

@ritwik-g
Copy link
Contributor

🔄 PR Overview: Simplified Workflow Studio UI

📋 Purpose Summary

This PR implements a complete UI overhaul of the workflow studio page, transforming it from a complex multi-sidebar interface into a simplified, card-based workflow builder. The new design organizes workflow configuration into 4 logical steps presented in a 2x2 grid layout, with integrated deployment options, conditional debug panel, and a toggleable configuration sidebar. This modernization improves user experience by reducing cognitive load while maintaining all existing functionality.

📊 File Change Statistics

  • Total Files Changed: 6
  • Lines Added: +598
  • Lines Deleted: -107
  • Net Change: +491 lines

Detailed Breakdown:

File Status +/- Lines Description
Agency.jsx Modified +349/-41 Complete UI restructure with new card-based layout
Agency.css Modified +169/+0 New comprehensive styling for workflow builder
WorkflowCard.jsx Added +50/+0 New reusable workflow step card component
WorkflowCard.css Added +19/+0 Styling for workflow card component
DsSettingsCard.jsx Modified +3/-66 Simplified by removing icons and status displays
DsSettingsCard.css Modified +8/+0 Updated styling for simplified card

🔄 Key Workflow Sequence

sequenceDiagram
    participant User
    participant WorkflowBuilder
    participant API
    participant PostHog
    participant DeploymentModal

    User->>WorkflowBuilder: Load workflow studio page
    WorkflowBuilder->>API: getWfEndpointDetails()
    WorkflowBuilder->>API: canUpdateWorkflow()
    WorkflowBuilder->>API: getPromptStudioProjects()
    API-->>WorkflowBuilder: Return configuration data
    
    WorkflowBuilder->>WorkflowBuilder: Render 4-step card layout
    Note over WorkflowBuilder: 1. Source Connector<br/>2. Output Destination<br/>3. Prompt Studio Project<br/>4. Deploy Workflow
    
    User->>WorkflowBuilder: Configure source/destination connectors
    User->>WorkflowBuilder: Select prompt studio project
    User->>WorkflowBuilder: Choose deployment type (API/ETL/TASK)
    
    WorkflowBuilder->>PostHog: Track deployment button click
    WorkflowBuilder->>DeploymentModal: Open appropriate modal
    User->>DeploymentModal: Complete deployment configuration
    DeploymentModal->>API: Create deployment
Loading

🎯 UI Flow Architecture

flowchart TD
    A[Workflow Builder Layout] --> B[Header Section]
    A --> C[Progress Section]
    A --> D[2x2 Grid Container]
    A --> E[Debug Panel]
    A --> F[Conditional Sidebar]
    
    B --> B1[Back Button + Title]
    B --> B2[Actions Dropdown]
    
    C --> C1[Progress Label]
    C --> C2[Progress Bar]
    
    D --> D1[Card 1: Source Connector]
    D --> D2[Card 2: Output Destination]
    D --> D3[Card 3: Prompt Studio Project]
    D --> D4[Card 4: Deploy Workflow]
    
    D1 --> D1A[DsSettingsCard Component]
    D2 --> D2A[DsSettingsCard Component]
    D3 --> D3A[Custom Select + Configure Button]
    D4 --> D4A[Deployment Type Select + Deploy Button]
    
    E --> E1[Collapsible Debug Panel]
    E1 --> E2[Debug Information Display]
    
    F --> F1[SidePanel Component]
    F --> F2[Close Button]
    
    D3A --> F[Triggers Sidebar]
    D4A --> G[Opens Deployment Modals]
    
    G --> G1[CreateApiDeploymentModal]
    G --> G2[EtlTaskDeploy - ETL]
    G --> G3[EtlTaskDeploy - TASK]
Loading

🏗️ Architecture Changes

Major Transformations:

  1. Layout Paradigm Shift: From IslandLayout + WorkflowExecution → Card-based grid system
  2. Component Hierarchy: Removed nested Layout/Sider → Flat responsive grid
  3. State Management: Added 8 new state variables for UI control and data management
  4. API Integration: 3 new API calls for endpoint details, permissions, and project data
  5. Modal System: Integrated deployment modals directly into workflow cards

New Components:

  • WorkflowCard: Reusable card component with numbered steps and flexible content
  • Simplified DsSettingsCard: Streamlined connector configuration without visual clutter

Conditional Rendering:

  • Debug panel (toggleable)
  • Configuration sidebar (on-demand)
  • Deployment modals (type-specific)

🎨 Design System Updates

CSS Architecture:

  • 169 new CSS rules for comprehensive workflow builder styling
  • Flexbox-based layouts for responsive design
  • Consistent spacing using 8px/16px/24px grid system
  • Modern visual hierarchy with proper typography scales
  • Interactive states with hover/focus/disabled styling

Visual Improvements:

  • Numbered workflow steps with circular badges
  • Progress tracking with visual indicators
  • Clean card-based interface with subtle shadows
  • Consistent button styling and spacing
  • Responsive 2x2 grid layout

This overview was automatically generated to help reviewers understand the scope and impact of the changes.

ritwik-g

This comment was marked as outdated.

jagadeeswaran-zipstack and others added 2 commits July 22, 2025 02:08
- Remove all console.log statements from Agency and SidePanel components
- Fix deployment button behavior to show single Deploy Workflow button
- Remove view existing deployment functionality from dropdown selection
- Clean up debugging code while maintaining all functionality
- Improve code readability by removing development logging

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
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: 0

♻️ Duplicate comments (5)
frontend/src/components/agency/agency/Agency.jsx (5)

80-85: Add cleanup for API calls to prevent potential memory leaks.

The useEffect hook triggers multiple API calls on mount, but there's no cleanup mechanism if the component unmounts while requests are in progress.

This matches a previous review concern. The API calls should implement cleanup using an AbortController or mounted flag to prevent state updates on unmounted components.


260-262: Handle PostHog tracking errors appropriately.

The empty catch block ignores PostHog tracking errors, which can make debugging analytics issues difficult.

As suggested in previous reviews, add proper error logging:

} catch (err) {
-  // If an error occurs while setting custom posthog event, ignore it and continue
+  // Log PostHog errors for debugging while not breaking the main flow
+  console.warn('PostHog event tracking failed:', err);
}

265-270: Remove redundant deployment trigger from dropdown.

The deployment is triggered both when selecting from the dropdown (onChange) and when clicking the Deploy button, creating confusing UX.

const handleDeploymentTypeChange = (value) => {
  setSelectedDeploymentType(value);
-  if (value) {
-    handleDeployBtnClick(value);
-  }
};

Users should explicitly click the "Deploy Workflow" button to trigger deployment.


435-448: Implement functionality for actions menu items.

The actions dropdown menu items have no click handlers, making them non-functional.

As suggested in previous reviews, add click handlers or remove non-functional items:

const actionsMenuItems = [
  {
    key: "clear-cache",
    label: "Clear Cache",
+   onClick: () => {
+     // Implement cache clearing logic
+     console.log("Clear cache clicked");
+   }
  },
  // ... other items with onClick handlers
];

493-508: Add safety checks for array access.

The hardcoded array indices could cause runtime errors if sourceTypes.connectors doesn't have the expected elements.

-type={sourceTypes.connectors[0]}
+type={sourceTypes.connectors?.[0] || "input"}
-type={sourceTypes.connectors[1]}
+type={sourceTypes.connectors?.[1] || "output"}
🧹 Nitpick comments (2)
frontend/src/components/agency/tool-settings/ToolSettings.jsx (1)

32-34: Consider consolidating duplicate utility functions.

This isObjectEmpty function is similar to the one in SidePanel.jsx. Consider moving it to a shared utilities file to avoid code duplication.

You could create a shared utilities file like utils/objectUtils.js:

+// utils/objectUtils.js
+export const isObjectEmpty = (obj) => {
+  return obj && Object.keys(obj).length === 0;
+};

Then import it in both files:

+import { isObjectEmpty } from '../../../utils/objectUtils';
-const isObjectEmpty = (obj) => {
-  return obj && Object.keys(obj).length === 0;
-};
frontend/src/components/agency/agency/Agency.jsx (1)

34-77: Consider consolidating related state variables.

The component now manages many state variables (14+ new ones). Consider grouping related states into objects or using a reducer pattern to improve maintainability:

+const [uiState, setUiState] = useState({
+  showDebug: false,
+  showSidebar: false,
+  selectedDeploymentType: null,
+  workflowProgress: 0
+});
+
+const [modalState, setModalState] = useState({
+  openAddApiModal: false,
+  openAddETLModal: false,
+  openAddTaskModal: false
+});

This would reduce the number of individual state setters and group related functionality.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Cache: Disabled due to Reviews > Disable Cache setting
Knowledge Base: Disabled due to Reviews > Disable Knowledge Base setting

📥 Commits

Reviewing files that changed from the base of the PR and between f500a39 and d4c6d29.

📒 Files selected for processing (6)
  • frontend/src/components/agency/agency/Agency.css (1 hunks)
  • frontend/src/components/agency/agency/Agency.jsx (3 hunks)
  • frontend/src/components/agency/ds-settings-card/DsSettingsCard.jsx (2 hunks)
  • frontend/src/components/agency/side-panel/SidePanel.css (1 hunks)
  • frontend/src/components/agency/side-panel/SidePanel.jsx (4 hunks)
  • frontend/src/components/agency/tool-settings/ToolSettings.jsx (3 hunks)
✅ Files skipped from review due to trivial changes (1)
  • frontend/src/components/agency/side-panel/SidePanel.css
🚧 Files skipped from review as they are similar to previous changes (2)
  • frontend/src/components/agency/ds-settings-card/DsSettingsCard.jsx
  • frontend/src/components/agency/agency/Agency.css
🧰 Additional context used
🧬 Code Graph Analysis (1)
frontend/src/components/agency/tool-settings/ToolSettings.jsx (2)
frontend/src/components/agency/side-panel/SidePanel.jsx (1)
  • isObjectEmpty (20-22)
frontend/src/components/input-output/configure-ds/ConfigureDs.jsx (2)
  • isFormValid (73-82)
  • formRef (36-36)
🪛 GitHub Check: SonarCloud
frontend/src/components/agency/agency/Agency.jsx

[notice] 221-223: Exceptions should not be ignored

Handle this exception or don't catch it at all.

See more on SonarQube Cloud


[notice] 260-262: Exceptions should not be ignored

Handle this exception or don't catch it at all.

See more on SonarQube Cloud

⏰ 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). (1)
  • GitHub Check: build
🔇 Additional comments (6)
frontend/src/components/agency/tool-settings/ToolSettings.jsx (2)

38-38: Good cleanup removing unused parameter.

Simplifying the callback signature by removing the unused values parameter improves code clarity.


80-103: Excellent empty state implementation.

The conditional rendering provides a clear, user-friendly message when tools don't have configurable settings. The logic correctly checks for loading state and spec emptiness, and the messaging guides users to the appropriate interface.

frontend/src/components/agency/side-panel/SidePanel.jsx (2)

1-9: Well-executed simplification of the SidePanel component.

The removal of tabbed interface and focus on tool settings alone makes the component cleaner and more maintainable. The Typography import supports the new static header approach.


46-58: Improved error handling and documentation.

The added comments provide valuable context about Prompt Studio tools and API error handling, making the code more maintainable and easier to understand.

frontend/src/components/agency/agency/Agency.jsx (2)

388-433: Excellent progress calculation implementation.

The dynamic progress calculation properly addresses the previous concern about hardcoded values. It correctly checks all four workflow steps and provides meaningful feedback to users.


524-598: Well-implemented tool selection and management logic.

The tool selection handler comprehensively manages both new tool additions and replacements. The logic properly handles cleanup of existing tools, API interactions, and store updates with appropriate error handling.

jagadeeswaran-zipstack and others added 2 commits July 27, 2025 13:07
- Replace numbered circles with green checkmarks for completed steps
- Add CheckOutlined icon from Ant Design for completed state
- Update CSS to show green background (#52c41a) for completed steps
- Simplify step indicators to only show checkmark without text
- Improve visual feedback for workflow progress

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
…pport

- Add Run Workflow, Clear Cache, and Clear Processed File History options to Actions dropdown
- Implement proper workflow execution logic with file upload modal support for API workflows
- Add workflow validation to prevent execution without complete configuration
- Remove all console.log statements for clean production code
- Change progress bar color to green when workflow reaches 100% completion
- Clean up unused activeToolId state variable and related setters
- Maintain compatibility with existing workflow store and alert systems

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
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: 0

♻️ Duplicate comments (5)
frontend/src/components/agency/agency/Agency.jsx (5)

95-101: Add cleanup mechanism to prevent memory leaks in API calls.

The useEffect hook triggers multiple API calls without cleanup, which could cause memory leaks if the component unmounts while requests are in progress.

Consider implementing an AbortController or mounted flag pattern as suggested in previous reviews to prevent state updates on unmounted components.


326-328: Empty catch block should include error logging.

The empty catch block ignores PostHog tracking errors. Add at least a console warning for debugging:

} catch (err) {
- // If an error occurs while setting custom posthog event, ignore it and continue
+ // Log PostHog errors for debugging while not breaking the main flow
+ console.warn('PostHog event tracking failed:', err);
}

331-336: Remove redundant deployment trigger from dropdown onChange.

The deployment is triggered both when selecting from the dropdown and when clicking the Deploy button, creating confusing UX. Remove the automatic trigger:

const handleDeploymentTypeChange = (value) => {
  setSelectedDeploymentType(value);
- if (value) {
-   handleDeployBtnClick(value);
- }
};

This ensures deployment only happens when users explicitly click "Deploy Workflow".


868-869: Potential array access error with hardcoded indices.

Add safety checks for array access to prevent runtime errors:

- type={sourceTypes.connectors[0]}
+ type={sourceTypes.connectors?.[0] || "input"}

886-887: Potential array access error with hardcoded indices.

Add safety checks for array access:

- type={sourceTypes.connectors[1]}  
+ type={sourceTypes.connectors?.[1] || "output"}
🧹 Nitpick comments (1)
frontend/src/components/agency/agency/Agency.jsx (1)

902-977: Complex tool selection logic needs error handling improvements.

The tool selection handler is quite complex with multiple async operations. Consider extracting this logic into a separate function and adding better error boundaries:

const handleToolSelection = async (functionName) => {
  try {
    setSelectedTool(functionName);
    await replaceOrCreateToolInstance(functionName);
  } catch (err) {
    // Reset selection on error
    setSelectedTool(null);
    setAlertDetails(handleException(err, "Failed to update tool"));
  }
};

const replaceOrCreateToolInstance = async (functionName) => {
  // Extract the existing logic here
  // This makes testing and maintenance easier
};
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Cache: Disabled due to Reviews > Disable Cache setting
Knowledge Base: Disabled due to Reviews > Disable Knowledge Base setting

📥 Commits

Reviewing files that changed from the base of the PR and between 9820f36 and 2e4ed46.

📒 Files selected for processing (9)
  • backend/api_v2/api_deployment_views.py (1 hunks)
  • backend/pipeline_v2/views.py (1 hunks)
  • frontend/src/components/agency/agency/Agency.css (2 hunks)
  • frontend/src/components/agency/agency/Agency.jsx (3 hunks)
  • frontend/src/components/agency/steps/Steps.jsx (1 hunks)
  • frontend/src/components/deployments/api-deployment/api-deployments-service.js (1 hunks)
  • frontend/src/components/deployments/create-api-deployment-modal/CreateApiDeploymentModal.jsx (4 hunks)
  • frontend/src/components/pipelines-or-deployments/etl-task-deploy/EtlTaskDeploy.jsx (3 hunks)
  • frontend/src/components/pipelines-or-deployments/pipeline-service.js (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • frontend/src/components/agency/agency/Agency.css
🧰 Additional context used
🧬 Code Graph Analysis (1)
backend/api_v2/api_deployment_views.py (1)
backend/api_v2/models.py (1)
  • APIDeployment (26-129)
⏰ 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). (1)
  • GitHub Check: build
🔇 Additional comments (16)
frontend/src/components/agency/steps/Steps.jsx (1)

39-40: LGTM! Good architectural improvement.

Removing the redundant canUpdateWorkflow() call prevents race conditions with the parent Agency.jsx component that now centrally manages workflow state. The comments clearly explain the rationale for this change.

frontend/src/components/pipelines-or-deployments/pipeline-service.js (1)

90-96: LGTM! Clean service method addition.

The new getPipelinesByWorkflowId method follows the established patterns in this service file and correctly constructs the GET request with the workflow query parameter to leverage the backend filtering capability.

frontend/src/components/pipelines-or-deployments/etl-task-deploy/EtlTaskDeploy.jsx (3)

38-38: LGTM! Good callback prop addition.

The new onDeploymentCreated callback prop enhances component integration capabilities and follows proper optional prop patterns.


252-255: LGTM! Proper callback invocation.

The callback is correctly invoked conditionally after successful deployment creation and workflow state updates. The placement and conditional logic are appropriate.


404-404: LGTM! Proper PropTypes definition.

The PropTypes definition correctly marks the callback as optional using PropTypes.func.

frontend/src/components/deployments/api-deployment/api-deployments-service.js (1)

92-98: LGTM! Consistent service method implementation.

The new getDeploymentsByWorkflowId method follows the established patterns in this service file using the options variable approach and correctly constructs the GET request with the workflow query parameter.

backend/api_v2/api_deployment_views.py (1)

133-140: LGTM! Well-implemented queryset filtering.

The workflow filtering enhancement maintains backward compatibility and correctly uses workflow_id to filter by the foreign key relationship. The conditional filtering approach is clean and follows Django ORM best practices.

backend/pipeline_v2/views.py (1)

50-53: LGTM! Clean implementation of workflow-based filtering.

The addition of workflow ID filtering follows the established pattern and integrates well with the workflow-centric UI changes. The implementation correctly checks for parameter presence and applies appropriate filtering.

frontend/src/components/deployments/create-api-deployment-modal/CreateApiDeploymentModal.jsx (3)

30-30: LGTM! Well-structured callback prop addition.

The new onDeploymentCreated callback prop enables better integration with the workflow-centric UI by allowing parent components to refresh deployment information after creation.


123-126: Proper callback implementation with appropriate guards.

The callback is correctly invoked only when present and within the workflow context, ensuring no breaking changes to existing usage patterns.


299-299: PropTypes properly updated for the new callback prop.

frontend/src/components/agency/agency/Agency.jsx (5)

476-504: Progress calculation logic is well-implemented.

The dynamic progress calculation properly considers all four workflow steps with appropriate status checks. The logic correctly handles deployed workflows and tool instance validation.


830-833: Progress display now correctly uses calculated values.

The hardcoded progress values have been replaced with dynamic calculation based on workflow state. This addresses the previous concern about showing actual progress to users.


840-848: Actions dropdown functionality is properly implemented.

The dropdown menu now has working click handlers that properly execute workflow actions like run, clear cache, and clear history. This addresses the previous concern about non-functional menu items.


1162-1163: Excellent integration of callback for deployment refresh.

The onDeploymentCreated={fetchDeploymentInfo} callback properly integrates the modal with the parent component's state management, ensuring the UI reflects deployment changes immediately.


1013-1013: Deployment type selection handles existing deployments correctly.

The logic properly shows existing deployment types while disabling changes when deployments are active, providing clear user feedback about workflow state.

jagadeeswaran-zipstack and others added 2 commits July 28, 2025 03:44
- Configure button now properly disabled when workflow is deployed via ETL/Task pipelines
- Deploy workflow dropdown correctly shows selected deployment type (ETL/TASK)
- Pipeline name and redirection link now display for ETL/Task deployments
- Changed pipeline detection logic to include all workflow pipelines regardless of active status

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
- Added new ToolSelectionSidebar component to replace dropdown
- Updated Agency.css with sidebar and loading styles
- Improved tool selection UX with visual cards and search functionality

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
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: 1

♻️ Duplicate comments (3)
frontend/src/components/agency/agency/Agency.jsx (3)

358-360: LGTM: PostHog error handling implemented

The empty catch block now has proper context from past reviews. This is acceptable for non-critical analytics tracking where failures shouldn't break the main flow.


363-368: Deployment UX issue persists

The redundant deployment trigger issue identified in past reviews still exists. The dropdown onChange still triggers deployment immediately, which could confuse users who expect to click the Deploy button explicitly.

  const handleDeploymentTypeChange = (value) => {
    setSelectedDeploymentType(value);
-   if (value) {
-     handleDeployBtnClick(value);
-   }
  };

981-994: Potential runtime error with array access

The hardcoded array access issue identified in past reviews still exists. sourceTypes.connectors[0] could cause runtime errors if the array is undefined or doesn't have expected elements.

- type={sourceTypes.connectors[0]}
+ type={sourceTypes.connectors?.[0] || "input"}
🧹 Nitpick comments (3)
frontend/src/components/agency/tool-selection-sidebar/ToolSelectionSidebar.jsx (2)

30-34: Consider performance optimization for search filtering

The filtering logic is recalculated on every render. For better performance with large tool lists, consider using useMemo to memoize the filtered results.

+ import { useState, useEffect, useMemo } from "react";

- const filteredTools = tools.filter(
-   (tool) =>
-     tool.name?.toLowerCase().includes(searchTerm.toLowerCase()) ||
-     tool.description?.toLowerCase().includes(searchTerm.toLowerCase())
- );
+ const filteredTools = useMemo(() => 
+   tools.filter(
+     (tool) =>
+       tool.name?.toLowerCase().includes(searchTerm.toLowerCase()) ||
+       tool.description?.toLowerCase().includes(searchTerm.toLowerCase())
+   ), [tools, searchTerm]
+ );

108-114: Redundant fallback in category display

The category tag has a redundant fallback that will never be used since the condition already checks for tool.category existence.

  {tool.category && (
    <div className="tool-category">
      <Tag className="tool-category-tag">
-       {tool.category || "Financial Documents"}
+       {tool.category}
      </Tag>
    </div>
  )}
frontend/src/components/agency/agency/Agency.jsx (1)

1067-1098: Complex conditional logic could be simplified

The deployment options rendering logic is quite complex and could benefit from extraction into a helper function for better readability and maintainability.

+ const getDeploymentOptions = () => {
+   const baseOptions = [
+     {
+       value: "API",
+       label: getDeploymentStatusText("API"),
+       disabled: false,
+     }
+   ];
+   
+   if (!apiOpsPresent || deploymentInfo) {
+     baseOptions.push(
+       {
+         value: "ETL",
+         label: getDeploymentStatusText("ETL"),
+         disabled: false,
+       },
+       {
+         value: "TASK",
+         label: getDeploymentStatusText("TASK"),
+         disabled: false,
+       }
+     );
+   }
+   
+   return baseOptions;
+ };

  <Select
    className="workflow-select"
    placeholder="Select Deployment Type"
    value={
      deploymentInfo
        ? deploymentInfo.type
        : selectedDeploymentType
    }
    onChange={handleDeploymentTypeChange}
    disabled={deploymentInfo || !allowChangeEndpoint}
-   options={[
-     {
-       value: "API",
-       label: getDeploymentStatusText("API"),
-       disabled: false,
-     },
-     ...(apiOpsPresent && !deploymentInfo
-       ? []
-       : [
-           {
-             value: "ETL",
-             label: getDeploymentStatusText("ETL"),
-             disabled: false,
-           },
-           {
-             value: "TASK",
-             label: getDeploymentStatusText("TASK"),
-             disabled: false,
-           },
-         ]),
-   ]}
+   options={getDeploymentOptions()}
  />
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Cache: Disabled due to Reviews > Disable Cache setting
Knowledge Base: Disabled due to Reviews > Disable Knowledge Base setting

📥 Commits

Reviewing files that changed from the base of the PR and between 2e4ed46 and b43673f.

📒 Files selected for processing (5)
  • frontend/src/components/agency/agency/Agency.css (2 hunks)
  • frontend/src/components/agency/agency/Agency.jsx (3 hunks)
  • frontend/src/components/agency/ds-settings-card/DsSettingsCard.jsx (2 hunks)
  • frontend/src/components/agency/tool-selection-sidebar/ToolSelectionSidebar.css (1 hunks)
  • frontend/src/components/agency/tool-selection-sidebar/ToolSelectionSidebar.jsx (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • frontend/src/components/agency/tool-selection-sidebar/ToolSelectionSidebar.css
🚧 Files skipped from review as they are similar to previous changes (2)
  • frontend/src/components/agency/ds-settings-card/DsSettingsCard.jsx
  • frontend/src/components/agency/agency/Agency.css
⏰ 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). (1)
  • GitHub Check: build
🔇 Additional comments (6)
frontend/src/components/agency/tool-selection-sidebar/ToolSelectionSidebar.jsx (2)

20-27: LGTM: Proper state synchronization

The useEffect correctly synchronizes the temporary selected tool state when the sidebar becomes visible or when the selected tool changes. The dependency array is appropriate and the state resets are handled properly.


138-145: LGTM: Comprehensive PropTypes validation

The PropTypes validation covers all required props with appropriate types. The optional selectedTool prop is correctly marked as not required.

frontend/src/components/agency/agency/Agency.jsx (4)

100-122: Improved: API cleanup mechanism implemented

The refactored initialization with Promise.all and proper error handling addresses the previous concern about memory leaks. The timeout for preventing content flash is a good UX touch.


508-536: Excellent: Dynamic progress calculation implemented

This addresses the previous hardcoded progress issue perfectly. The logic properly calculates completion based on actual workflow state and provides meaningful feedback to users.


789-858: Robust tool selection implementation

The tool selection logic properly handles existing tool cleanup, creates new instances, and updates both workflow and tool settings stores. Good error handling and user feedback are implemented.


910-924: Improved: Actions menu with functional handlers

The actions menu now has proper functionality implemented, addressing the previous concern about non-functional menu items. Each action has a corresponding handler.

…d UX

- Replace tool dropdown with interactive sidebar for better tool selection
- Add search functionality and detailed tool information display
- Fix InputOutput component to properly receive workflow execution data
- Add real-time status message display in debug panel
- Remove deprecated Actions component and related unused files
- Clean up stepLoader state (step execution is disabled)
- Improve workflow execution feedback with auto-opening debug panel
- Update workflow card styling for completed steps (light blue theme)

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
jagadeeswaran-zipstack and others added 2 commits July 28, 2025 04:25
- Remove redundant deployment trigger from dropdown onChange handler
- Add AbortController to prevent memory leaks in API calls during component unmount
- Fix useEffect dependency array to include correct deployment state variables
- Extract nested ternary operations into clean generateDeploymentMessage function
- Add proper cleanup functions to abort ongoing requests when component unmounts
- Update all API functions to accept and handle abort signals properly

Fixes three critical issues:
1. Deployment now only triggers on explicit button click, not dropdown selection
2. API calls are properly cancelled preventing memory leaks and race conditions
3. useEffect runs correctly when deployment-related dependencies change

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
…lity

- Added getConfigureTooltipMessage() function to replace complex nested ternary
- Improves code maintainability and Sonar compliance

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
Copy link
Contributor

@chandrasekharan-zipstack chandrasekharan-zipstack left a comment

Choose a reason for hiding this comment

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

BE changes LGTM. I suggest waiting for approvals from FE folks on other files. I can act as the second approver if required

Copy link
Contributor

@vishnuszipstack vishnuszipstack left a comment

Choose a reason for hiding this comment

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

@jagadeeswaran-zipstack added minor comment. resolve those. everything else looks okay to me.

…ncy component

- Import useRequestUrl hook and initialize getUrl function
- Replace all 8 hardcoded URL constructions with getUrl calls
- Makes URL handling consistent with rest of the codebase
- Addresses PR review comment: #1442 (comment)

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
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: 0

♻️ Duplicate comments (1)
frontend/src/components/agency/agency/Agency.jsx (1)

1057-1057: Potential runtime error with hardcoded array indices

The code assumes sourceTypes.connectors has at least 2 elements, which could cause runtime errors if the array is shorter than expected.

- type={sourceTypes.connectors[0]}
+ type={sourceTypes.connectors?.[0] || "input"}

- type={sourceTypes.connectors[1]}  
+ type={sourceTypes.connectors?.[1] || "output"}

Also applies to: 1075-1075

🧹 Nitpick comments (2)
frontend/src/components/agency/agency/Agency.jsx (2)

43-96: Consider consolidating complex state management

The component manages 25+ state variables, which increases complexity and potential for inconsistencies. While the current approach works, consider using useReducer for related state groups to improve maintainability.

For example, group deployment-related states:

- const [selectedDeploymentType, setSelectedDeploymentType] = useState(null);
- const [openAddApiModal, setOpenAddApiModal] = useState(false);
- const [openAddETLModal, setOpenAddETLModal] = useState(false);
- const [openAddTaskModal, setOpenAddTaskModal] = useState(false);
- const [deploymentName, setDeploymentName] = useState("");
- const [deploymentType, setDeploymentType] = useState("");

+ const [deploymentState, dispatchDeployment] = useReducer(deploymentReducer, {
+   selectedType: null,
+   modals: { api: false, etl: false, task: false },
+   name: "",
+   type: ""
+ });

1227-1238: Sidebar implementation is clean but could be improved

The conditional sidebar rendering works well, but the close button positioning might benefit from better styling integration.

Consider improving the close button styling:

<Button
  className="close-sidebar-btn"
  onClick={() => setShowSidebar(false)}
+ type="text"
+ icon={<CloseOutlined />}
  size="small"
>
- ×
</Button>
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Cache: Disabled due to Reviews > Disable Cache setting
Knowledge Base: Disabled due to Reviews > Disable Knowledge Base setting

📥 Commits

Reviewing files that changed from the base of the PR and between cf09810 and dad6190.

📒 Files selected for processing (2)
  • frontend/src/components/agency/agency/Agency.jsx (4 hunks)
  • frontend/src/components/agency/ds-settings-card/DsSettingsCard.jsx (3 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • frontend/src/components/agency/ds-settings-card/DsSettingsCard.jsx
⏰ 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). (1)
  • GitHub Check: build
🔇 Additional comments (10)
frontend/src/components/agency/agency/Agency.jsx (10)

1-42: Imports are well-organized and comprehensive

The import structure is logical, grouping external dependencies (Ant Design, React) before internal components and utilities. All imports appear to be utilized in the component implementation.


97-133: Excellent cleanup implementation for API calls

The initialization useEffect properly implements AbortController for cleanup, includes comprehensive error handling, and prevents state updates on unmounted components. The timeout delay to prevent content flash is a nice UX touch.


161-192: Deployment logic is well-structured but complex

The effect properly manages deployment type availability based on connector configurations. The logic correctly prevents invalid deployment selections when switching between API and other types.


273-337: Deployment info fetching is robust and well-implemented

The parallel API calls using Promise.all, proper error handling, and signal abort checking demonstrate good async programming practices. The logic for prioritizing deployment types (ETL > TASK) is clearly documented and sensible.


568-597: Progress calculation logic is comprehensive

The dynamic progress calculation properly accounts for all workflow steps including connector configuration, tool selection, and deployment status. This addresses the previous hardcoded progress issue effectively.


854-924: Tool selection implementation handles edge cases well

The function properly manages replacing existing tools, updating multiple stores (workflow and tool settings), and provides appropriate user feedback. The error handling ensures consistency even if operations fail partway through.


992-1001: Loading state implementation is clean and user-friendly

The loading spinner with descriptive text provides good user feedback during initial data load. Using IslandLayout maintains consistency with the overall application structure.


1043-1184: Card-based workflow grid is intuitive and well-structured

The 2x2 grid layout with numbered workflow cards provides excellent visual hierarchy and user guidance. The dynamic status indicators (✓ vs numbers) clearly show completion status, and the conditional rendering based on workflow state is implemented correctly.


1185-1195: Deployment alert provides helpful user feedback

The conditional alert with dynamic message generation and proper linking to deployment pages gives users clear information about their workflow's deployment status.


1212-1224: Debug panel implementation enhances developer experience

The collapsible debug panel with status messages and input/output display provides valuable debugging capabilities while keeping the UI clean when not needed.

Copy link
Contributor

filepath function $$\textcolor{#23d18b}{\tt{passed}}$$ SUBTOTAL
$$\textcolor{#23d18b}{\tt{runner/src/unstract/runner/clients/test\_docker.py}}$$ $$\textcolor{#23d18b}{\tt{test\_logs}}$$ $$\textcolor{#23d18b}{\tt{1}}$$ $$\textcolor{#23d18b}{\tt{1}}$$
$$\textcolor{#23d18b}{\tt{runner/src/unstract/runner/clients/test\_docker.py}}$$ $$\textcolor{#23d18b}{\tt{test\_cleanup}}$$ $$\textcolor{#23d18b}{\tt{1}}$$ $$\textcolor{#23d18b}{\tt{1}}$$
$$\textcolor{#23d18b}{\tt{runner/src/unstract/runner/clients/test\_docker.py}}$$ $$\textcolor{#23d18b}{\tt{test\_cleanup\_skip}}$$ $$\textcolor{#23d18b}{\tt{1}}$$ $$\textcolor{#23d18b}{\tt{1}}$$
$$\textcolor{#23d18b}{\tt{runner/src/unstract/runner/clients/test\_docker.py}}$$ $$\textcolor{#23d18b}{\tt{test\_client\_init}}$$ $$\textcolor{#23d18b}{\tt{1}}$$ $$\textcolor{#23d18b}{\tt{1}}$$
$$\textcolor{#23d18b}{\tt{runner/src/unstract/runner/clients/test\_docker.py}}$$ $$\textcolor{#23d18b}{\tt{test\_get\_image\_exists}}$$ $$\textcolor{#23d18b}{\tt{1}}$$ $$\textcolor{#23d18b}{\tt{1}}$$
$$\textcolor{#23d18b}{\tt{runner/src/unstract/runner/clients/test\_docker.py}}$$ $$\textcolor{#23d18b}{\tt{test\_get\_image}}$$ $$\textcolor{#23d18b}{\tt{1}}$$ $$\textcolor{#23d18b}{\tt{1}}$$
$$\textcolor{#23d18b}{\tt{runner/src/unstract/runner/clients/test\_docker.py}}$$ $$\textcolor{#23d18b}{\tt{test\_get\_container\_run\_config}}$$ $$\textcolor{#23d18b}{\tt{1}}$$ $$\textcolor{#23d18b}{\tt{1}}$$
$$\textcolor{#23d18b}{\tt{runner/src/unstract/runner/clients/test\_docker.py}}$$ $$\textcolor{#23d18b}{\tt{test\_get\_container\_run\_config\_without\_mount}}$$ $$\textcolor{#23d18b}{\tt{1}}$$ $$\textcolor{#23d18b}{\tt{1}}$$
$$\textcolor{#23d18b}{\tt{runner/src/unstract/runner/clients/test\_docker.py}}$$ $$\textcolor{#23d18b}{\tt{test\_run\_container}}$$ $$\textcolor{#23d18b}{\tt{1}}$$ $$\textcolor{#23d18b}{\tt{1}}$$
$$\textcolor{#23d18b}{\tt{runner/src/unstract/runner/clients/test\_docker.py}}$$ $$\textcolor{#23d18b}{\tt{test\_get\_image\_for\_sidecar}}$$ $$\textcolor{#23d18b}{\tt{1}}$$ $$\textcolor{#23d18b}{\tt{1}}$$
$$\textcolor{#23d18b}{\tt{runner/src/unstract/runner/clients/test\_docker.py}}$$ $$\textcolor{#23d18b}{\tt{test\_sidecar\_container}}$$ $$\textcolor{#23d18b}{\tt{1}}$$ $$\textcolor{#23d18b}{\tt{1}}$$
$$\textcolor{#23d18b}{\tt{TOTAL}}$$ $$\textcolor{#23d18b}{\tt{11}}$$ $$\textcolor{#23d18b}{\tt{11}}$$

Copy link

@ritwik-g ritwik-g dismissed their stale review July 31, 2025 05:21

Outdated

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants