Skip to content

Conversation

@Deepak-Kesavan
Copy link
Contributor

@Deepak-Kesavan Deepak-Kesavan commented Jan 12, 2026

What

  • Frontend changes for using Agentic Prompt Studio Plugin

Why

How

Can this PR break any existing features. If yes, please list possible items. If no, please explain why. (PS: Admins do not merge the PR without this section filled)

Database Migrations

Env Config

Relevant Docs

Related Issues or PRs

Dependencies Versions

Notes on Testing

Screenshots

Checklist

I have read and understood the Contribution Guidelines.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 12, 2026

Warning

Rate limit exceeded

@Deepak-Kesavan has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 7 minutes and 46 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between d4d8b21 and 270bae8.

📒 Files selected for processing (2)
  • frontend/src/components/custom-tools/list-of-tools/ListOfTools.jsx
  • frontend/src/components/navigations/side-nav-bar/SideNavBar.jsx

Walkthrough

Adds two new frontend dependencies, integrates an optional Agentic Prompt Studio plugin (runtime-loaded, conditional route and sidebar menu), and refactors ListOfTools for centralized exception handling, internal component renaming, and new full-height tab styling.

Changes

Cohort / File(s) Summary
Dependency Management
frontend/package.json
Added react-diff-viewer-continued and recharts; reordered dependency entries.
Agentic Prompt Studio Plugin Integration
frontend/src/routes/useMainAppRoutes.js, frontend/src/components/navigations/side-nav-bar/SideNavBar.jsx
Added try-catch runtime loading for the AgenticPromptStudio plugin; conditionally registers a route at agentic-prompt-studio/* and injects a sidebar menu item when the plugin is present.
ListOfTools Component Refactor & Styling
frontend/src/components/custom-tools/list-of-tools/ListOfTools.jsx, frontend/src/components/custom-tools/list-of-tools/ListOfTools.css
Introduced useExceptionHandler usage and handleException; renamed internal CustomButtons to DefaultCustomButtons; extracted defaultContent; added flex-based, full-height tab CSS for Ant Tabs.

Sequence Diagram(s)

sequenceDiagram
    participant Browser
    participant Router
    participant PluginLoader as AgenticPluginLoader
    participant Sidebar
    participant PluginModule as AgenticPromptStudio

    Browser->>Router: navigate /main or /agentic-prompt-studio/*
    Router->>PluginLoader: check for AgenticPromptStudio (try-require)
    PluginLoader-->>Router: module found / not found
    alt plugin found
        Router->>PluginModule: mount route component
        PluginLoader->>Sidebar: inject menu item
        Sidebar-->>Browser: render menu with Agentic Prompt Studio entry
    else plugin absent
        Router-->>Sidebar: render default menu
    end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 1 | ❌ 2
❌ Failed checks (2 warnings)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Description check ⚠️ Warning The PR description is largely incomplete with most required sections left empty (Why, How, risk assessment, migrations, env config, docs, issues, versions, testing, screenshots). Complete all required sections: explain why this change is needed, describe the implementation approach, assess breaking change risks, document dependencies added (react-diff-viewer-continued, recharts), and provide testing notes.
✅ Passed checks (1 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately reflects the main change: introducing the Agentic Prompt Studio frontend feature, which aligns with the file modifications across navigation, routing, and component updates.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


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.

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

🤖 Fix all issues with AI agents
In @frontend/src/components/navigations/side-nav-bar/SideNavBar.jsx:
- Around line 244-256: The new submenu entry added when
agenticPromptStudioEnabled sets id: 1.2 which duplicates the existing Workflows
id and will cause React key conflicts; update the inserted object in the
data[0]?.subMenu?.splice(...) call to use a unique identifier (preferably a
string like "agentic-prompt-studio" for the id) and ensure any code that
references the numeric id is updated to handle the new string id; keep the rest
of the properties (title, path, active check using
window.location.pathname.startsWith(`/${orgName}/agentic-prompt-studio`))
unchanged.
🧹 Nitpick comments (1)
frontend/src/components/custom-tools/list-of-tools/ListOfTools.jsx (1)

244-264: Consider memoizing or extracting DefaultCustomButtons.

DefaultCustomButtons is defined inside the component, creating a new function reference on every render. Since it accesses isImportLoading, setOpenImportTool, and handleNewProjectBtnClick from closure, it cannot be extracted outside. Consider wrapping with useCallback or useMemo to stabilize the reference, which can help prevent unnecessary re-renders in ToolNavBar.

♻️ Suggested refactor using useMemo
+import { useEffect, useState, useMemo } from "react";
-import { useEffect, useState } from "react";
...
-  const DefaultCustomButtons = () => {
-    return (
+  const DefaultCustomButtons = useMemo(
+    () => () => (
       <Space gap={16}>
         <CustomButton
           type="default"
           icon={<ArrowDownOutlined />}
           onClick={() => setOpenImportTool(true)}
           loading={isImportLoading}
         >
           Import Project
         </CustomButton>
         <CustomButton
           type="primary"
           icon={<PlusOutlined />}
           onClick={handleNewProjectBtnClick}
         >
           New Project
         </CustomButton>
       </Space>
-    );
-  };
+    ),
+    [isImportLoading, handleNewProjectBtnClick]
+  );
📜 Review details

Configuration used: Organization 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 1004a55 and 2b395ed.

⛔ Files ignored due to path filters (1)
  • frontend/package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (5)
  • frontend/package.json
  • frontend/src/components/custom-tools/list-of-tools/ListOfTools.css
  • frontend/src/components/custom-tools/list-of-tools/ListOfTools.jsx
  • frontend/src/components/navigations/side-nav-bar/SideNavBar.jsx
  • frontend/src/routes/useMainAppRoutes.js
🧰 Additional context used
🧬 Code graph analysis (2)
frontend/src/components/custom-tools/list-of-tools/ListOfTools.jsx (1)
frontend/src/hooks/useExceptionHandler.jsx (1)
  • useExceptionHandler (4-127)
frontend/src/components/navigations/side-nav-bar/SideNavBar.jsx (1)
frontend/src/components/helpers/auth/RequireAuth.js (1)
  • orgName (33-33)
🔇 Additional comments (7)
frontend/src/routes/useMainAppRoutes.js (2)

53-57: LGTM!

The plugin loading pattern is consistent with other plugins in this file (e.g., RequirePlatformAdmin, AppDeployments). The try-catch with an empty catch block is appropriate for optional plugins.


160-165: LGTM!

The conditional route rendering follows the established pattern for optional plugins. The wildcard path (agentic-prompt-studio/*) correctly allows for nested routing within the plugin.

frontend/src/components/custom-tools/list-of-tools/ListOfTools.css (1)

10-27: LGTM!

The flex-based tab layout styling correctly establishes full-height behavior for Ant Design tabs. The overflow: hidden on the content holder and height: 100% cascading through the tab structure is a standard pattern for containing scrollable tab content.

frontend/src/components/custom-tools/list-of-tools/ListOfTools.jsx (2)

28-28: LGTM!

The useExceptionHandler hook is properly integrated and used consistently throughout the component for error handling in API calls.


340-357: LGTM!

The extraction of defaultContent improves readability and prepares the component structure for potential future tab-based layouts (as suggested by the new CSS classes). The rendering logic is clean and maintainable.

Also applies to: 370-370

frontend/src/components/navigations/side-nav-bar/SideNavBar.jsx (1)

61-67: LGTM!

The plugin detection pattern is consistent with other plugins in this file. Setting a boolean flag at module load time is appropriate for conditional feature enablement.

frontend/package.json (1)

41-41: Both react-diff-viewer-continued@^3.4.0 and recharts@^3.5.1 exist on npm and have no known security vulnerabilities. The specified versions are valid and safe to use.

Resolved conflicts in SideNavBar.jsx by:
- Keeping both agenticPromptStudioEnabled and manualReviewSettingsEnabled plugin checks
- Adding new Settings menu functions (getSettingsMenuItems, getActiveSettingsKey, SettingsPopoverContent)
- Preserving agentic prompt studio menu item addition
Changed id from 1.2 to 1.15 to avoid conflict with Workflows menu item.
Resolves CodeRabbit review comment.
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

🧹 Nitpick comments (1)
frontend/src/components/navigations/side-nav-bar/SideNavBar.jsx (1)

328-340: Implementation is consistent with existing patterns.

The menu injection follows the same pattern as the app_deployment injection at line 325. The optional chaining handles the edge case when data is empty.

Minor concern: Both this and line 325 mutate data in place, which could be menu returned from an external hook. If that hook returns a stable reference, this mutation could affect other consumers or cause subtle re-render issues.

Consider cloning before mutation to avoid side effects:

♻️ Optional defensive clone
   const data =
     selectedProduct === "verticals" && menu === null
       ? []
-      : menu || unstractMenuItems;
+      : JSON.parse(JSON.stringify(menu || unstractMenuItems));

Alternatively, use a useMemo to derive the final menu structure without mutating the source.

📜 Review details

Configuration used: Organization 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 2b395ed and d4d8b21.

📒 Files selected for processing (1)
  • frontend/src/components/navigations/side-nav-bar/SideNavBar.jsx
🧰 Additional context used
🧬 Code graph analysis (1)
frontend/src/components/navigations/side-nav-bar/SideNavBar.jsx (1)
frontend/src/components/helpers/auth/RequireAuth.js (1)
  • orgName (33-33)
⏰ 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 (1)
frontend/src/components/navigations/side-nav-bar/SideNavBar.jsx (1)

70-76: LGTM!

The plugin detection pattern is consistent with other optional plugin loads in this file (e.g., lines 34-46, 62-68, 78-84). The approach correctly sets a boolean flag based on plugin availability.

- Renumbered Workflows from 1.2 to 1.3
- Set Agentic Prompt Studio to 1.2
- Maintains consistent single decimal numbering (1.1, 1.2, 1.3)
1. ListOfTools.jsx: Move DefaultCustomButtons component outside parent
   - Extracted component definition to module level
   - Added PropTypes for type safety
   - Pass required props from parent component
   - Improves performance by preventing component recreation on each render

2. SideNavBar.jsx: Replace window with globalThis
   - Changed all window.location references to globalThis.location
   - Improves portability and ES2020 compatibility
@sonarqubecloud
Copy link

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.

2 participants