Skip to content

Conversation

@chandrasekharan-zipstack
Copy link
Contributor

@chandrasekharan-zipstack chandrasekharan-zipstack commented Dec 17, 2025

What

Fixed search filter persistence issue when switching between adapter settings pages (LLMs, Vector DBs, Embedding, Text Extractor).

Why

When searching for an adapter on one settings page (e.g., "postgres" on Vector DBs), switching to another page (e.g., LLMs) would keep the search filter active but display empty results since the search term doesn't match items on the new page. This creates confusing UX where users don't realize they need to clear the search filter.

How

  • Added searchKey prop to ToolNavBar that uses the page type as key for Search component
  • Added clearSearch() function to useListSearch hook to reset internal search state
  • ToolSettings calls clearSearch() when type changes and passes type as searchKey to force Search component remount

React's key prop ensures Search component remounts when switching pages, and the clearSearch function resets the internal search state completely.

Can this PR break any existing features. If yes, please list possible items. If no, please explain why.

No. This only adds optional props and a new hook function. Existing behavior is preserved for all use cases.

Notes on Testing

  • Switch between different adapter settings pages (LLMs, Vector DBs, Embedding, Text Extractor)
  • Perform a search on one page
  • Switch to another page - search filter should be cleared and show all items for new page
  • Verify each page displays correct adapters after filter is cleared

Screenshots

image The search filter gets cleared on switching side nav bar tabs ---

Generated with Claude Code

Fixed the search filter not clearing when switching between LLMs, Vector DBs,
Embedding, and Text Extractor pages. The fix uses React's key prop to force
remount the Search component when page type changes.

Changes:
- Added searchKey prop to ToolNavBar and Search component
- Added clearSearch function to useListSearch hook
- Call clearSearch when adapter type changes in ToolSettings

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 17, 2025

Summary by CodeRabbit

  • Improvements
    • Fixed search functionality to properly reset when switching between different tool types, preventing search queries from persisting across tool contexts.

✏️ Tip: You can customize this high-level summary in your review settings.

Walkthrough

Three files modified to introduce search state management improvements. Added searchKey prop to ToolNavBar and implemented clearSearch function in useListSearch hook. ToolSettings now clears search state when the tool type changes, passing searchKey to ToolNavBar to scope search behavior.

Changes

Cohort / File(s) Summary
Search hook enhancement
frontend/src/hooks/useListSearch.js
Added clearSearch function (via useCallback) that resets searchTextRef and restores displayList to full list. Exported as part of hook's public API.
Search integration in components
frontend/src/components/navigations/tool-nav-bar/ToolNavBar.jsx, frontend/src/components/tool-settings/tool-settings/ToolSettings.jsx
ToolNavBar: Added searchKey prop to component signature and propTypes; rendered as React key on Search input element. ToolSettings: Integrated clearSearch function call on mount/update to reset search state; passes current type as searchKey to ToolNavBar.

Sequence Diagram

sequenceDiagram
    participant TS as ToolSettings
    participant ULS as useListSearch Hook
    participant TNB as ToolNavBar
    participant S as Search Component

    TS->>TS: Type prop changes
    TS->>ULS: Call clearSearch()
    activate ULS
    ULS->>ULS: Reset searchTextRef
    ULS->>ULS: Restore displayList to full list
    deactivate ULS
    TS->>TNB: Pass new searchKey (type)
    TNB->>S: Re-render with key={searchKey}
    Note over S: Component re-mounts<br/>Search state cleared
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

  • Verify searchKey prop is properly destructured and typed in ToolNavBar
  • Confirm clearSearch correctly resets both searchTextRef and displayList state
  • Check that ToolSettings properly invokes clearSearch on type changes (mount/update lifecycle)
  • Validate that the React key change on Search component triggers proper re-initialization

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: clearing search filters when switching adapter settings pages, which is the primary objective of this PR.
Description check ✅ Passed The PR description is comprehensive and follows the template structure, covering all required sections including What, Why, How, risk assessment, testing notes, and impact analysis.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ 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 misc/adapter-search-filter-clear-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.

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
frontend/src/components/navigations/tool-nav-bar/ToolNavBar.jsx (1)

21-23: Consider cancelling debounced search on type change.

The debounced function is recreated on each render but not cancelled when searchKey changes. If a user types and switches types within 600ms, the pending debounced callback may fire after the switch, applying stale search text to the new page's data while the input appears empty.

To prevent this, memoize and cancel the debounced function:

+import { useMemo, useEffect } from "react";
+
 function ToolNavBar({
   ...
 }) {
   const navigate = useNavigate();
-  const onSearchDebounce = debounce(({ target: { value } }) => {
-    onSearch(value, setSearchList);
-  }, 600);
+  const onSearchDebounce = useMemo(
+    () => debounce(({ target: { value } }) => {
+      onSearch(value, setSearchList);
+    }, 600),
+    [onSearch, setSearchList]
+  );
+
+  useEffect(() => {
+    return () => {
+      onSearchDebounce.cancel();
+    };
+  }, [searchKey, onSearchDebounce]);
🧹 Nitpick comments (1)
frontend/src/components/tool-settings/tool-settings/ToolSettings.jsx (1)

60-67: Optional: Consider adding stable dependencies to useEffect.

While clearSearch and setMasterList are stable references (memoized with useCallback), ESLint's exhaustive-deps rule may flag them as missing dependencies. Adding them would silence warnings without changing behavior.

 useEffect(() => {
   clearSearch();
   setMasterList([]);
   if (!type) {
     return;
   }
   getAdapters();
-}, [type]);
+}, [type, clearSearch, setMasterList]);
📜 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 a70a178 and f07115f.

📒 Files selected for processing (3)
  • frontend/src/components/navigations/tool-nav-bar/ToolNavBar.jsx (3 hunks)
  • frontend/src/components/tool-settings/tool-settings/ToolSettings.jsx (2 hunks)
  • frontend/src/hooks/useListSearch.js (2 hunks)
⏰ 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 (3)
frontend/src/hooks/useListSearch.js (1)

36-39: LGTM! Clean implementation of search state reset.

The clearSearch function correctly resets both the search text reference and the display list to show unfiltered results. The use of useCallback with an empty dependency array ensures a stable function reference.

Also applies to: 57-57

frontend/src/components/navigations/tool-nav-bar/ToolNavBar.jsx (1)

18-19: Good use of React key prop to reset search state.

The searchKey prop correctly forces the Search component to remount when the adapter type changes, clearing its internal input state. This pairs well with the clearSearch() call in the parent component.

Also applies to: 59-59, 81-81

frontend/src/components/tool-settings/tool-settings/ToolSettings.jsx (1)

57-57: Well-structured implementation of search reset on type change.

The combination of calling clearSearch() and passing type as searchKey ensures both the hook's internal state and the Search component's UI are properly reset when switching adapter pages. The clearSearch() call on line 61 is essential—without it, searchTextRef would retain the old search term and incorrectly filter the new adapter data.

Also applies to: 61-61, 231-231

@sonarqubecloud
Copy link

@kirtimanmishrazipstack kirtimanmishrazipstack merged commit aa37eb8 into main Dec 18, 2025
6 checks passed
@kirtimanmishrazipstack kirtimanmishrazipstack deleted the misc/adapter-search-filter-clear-fix branch December 18, 2025 08:02
harini-venkataraman added a commit that referenced this pull request Jan 13, 2026
* UN-3008 [FIX] Pass word-level confidence setting to Structure Tool (#1714)

* UN-3008 [FIX] Pass word-level confidence setting to Structure Tool

Fix missing propagation of word confidence setting:
- Add ENABLE_WORD_CONFIDENCE constant to SettingsKeys
- Read and pass word confidence setting through tool_settings

* Bump Structure Tool version to 0.0.95

* UN-3099 [FIX] Disable issue in hitl tab in configure destination and table line iss… (#1707)

* disable issue in hitl tab in configure destination and table line issue in logs

* sonar issue fix

* [MISC] Clear search filter when switching adapter settings pages (#1712)

MISC [FIX] Clear search filter when switching adapter settings pages

Fixed the search filter not clearing when switching between LLMs, Vector DBs,
Embedding, and Text Extractor pages. The fix uses React's key prop to force
remount the Search component when page type changes.

Changes:
- Added searchKey prop to ToolNavBar and Search component
- Added clearSearch function to useListSearch hook
- Call clearSearch when adapter type changes in ToolSettings

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

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Co-authored-by: Kirtiman Mishra <110175055+kirtimanmishrazipstack@users.noreply.github.com>

* [MISC] Add back button to Add Adapter/Connector modals (#1710)

* MISC [FEAT] Add back button to Add Adapter/Connector modals

Added a back button in the modal title when configuring a new adapter/connector.
This allows users to return to the adapter selection screen without closing the
entire modal.

- Back button only shown when adding new (not when editing)
- Clicking back resets selectedSourceId and clears metadata

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* Update frontend/src/components/input-output/add-source-modal/AddSourceModal.jsx

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Signed-off-by: Chandrasekharan M <117059509+chandrasekharan-zipstack@users.noreply.github.com>

* Update frontend/src/components/input-output/add-source-modal/AddSourceModal.jsx

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Signed-off-by: Chandrasekharan M <117059509+chandrasekharan-zipstack@users.noreply.github.com>

---------

Signed-off-by: Chandrasekharan M <117059509+chandrasekharan-zipstack@users.noreply.github.com>
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: Kirtiman Mishra <110175055+kirtimanmishrazipstack@users.noreply.github.com>

* [MISC] Load pdfjs worker from node_modules instead of CDN (#1716)

* MISC [FIX] Load pdfjs worker from node_modules instead of CDN

Use ?url import for pdfjs-dist worker to load from local node_modules
instead of relying on CDN URL. Resolves version mismatch issues between
package and worker versions.

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* MISC [FIX] Use centralized pdfWorkerConfig with CRA/Vite compatible new URL() pattern

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Co-authored-by: Hari John Kuriakose <hari@zipstack.com>

* [FIX] Fix PDF.js worker require is not defined error in staging (#1717)

* [FIX] Updated pdf js worker to load from cdn (#1718)

* updated pdf js worker to load from cdn

* lint issue fix

* UN-1722 [FEAT] Add export reminder for Prompt Studio projects in use (#1547)

* UN-1722 [FEAT] Add export reminder for Prompt Studio projects in use

- Add backend API endpoint to check if project is used in deployments
- Implement frontend change tracking for prompt modifications
- Create yellow notification bar component with export action
- Track changes when editing, adding, or deleting prompts
- Clear notification after successful export
- Check usage in API Deployments, ETL/Task Pipelines, and Manual Review

This ensures users are reminded to export their Prompt Studio changes when
the project is actively being used in deployments, preventing confusion
about why changes don't take effect immediately.

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

Co-Authored-By: Claude <noreply@anthropic.com>

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

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

* fix: Remove trailing commas to fix Prettier/ESLint build errors

Removed 10 trailing commas from 4 files that were causing the Docker
build to fail with Prettier violations:
- DocumentParser.jsx: 3 locations (lines 86, 124, 179)
- Header.jsx: 3 locations (lines 73, 176, 277)
- ToolIde.jsx: 2 locations (lines 97, 223)
- custom-tool-store.js: 2 locations (lines 83, 106)

These changes ensure the code passes ESLint/Prettier checks during
the build process without modifying any functionality.

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

Co-Authored-By: Claude <noreply@anthropic.com>

* refactor: Fix CodeRabbit major issues - state carryover and useCallback pattern

Fixed two major issues identified by CodeRabbit review:

1. Fixed state carryover bug in custom-tool-store.js
   - When switching tools, deploymentUsageInfo and lastExportedAt now
     properly reset to null instead of carrying over from previous tool
   - Prevents incorrect export reminders showing for wrong projects

2. Fixed useCallback pattern issue in ToolIde.jsx
   - Replaced isCheckingUsage state in useCallback deps with useRef
   - Prevents unnecessary callback recreations and potential race conditions
   - Simplified useEffect dependencies to only depend on the callback
   - Removed unused isCheckingUsage state variable

These changes improve code quality and prevent potential bugs without
affecting functionality.

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

Co-Authored-By: Claude <noreply@anthropic.com>

* fix: Address all PR #1547 review comments from chandrasekharan-zipstack

This commit addresses all actionable review comments from the code reviewer:

## Backend Changes (views.py, constants.py, exceptions.py)

1. **Import Location Fix** ✅
   - Moved APIDeployment, Pipeline, and WorkflowEndpoint imports to top of file
   - Removed lazy imports from check_deployment_usage method
   - Follows Python best practices for import organization

2. **Deployment Type Enum** ✅
   - Created DeploymentType class in constants.py with deployment type constants
   - Updated check_deployment_usage to use DeploymentType constants
   - Replaced hardcoded strings: "API Deployment", "ETL Pipeline", etc.
   - Improves maintainability and prevents typos

3. **Error Handling** ✅
   - Created DeploymentUsageCheckError exception class
   - Changed check_deployment_usage to raise exception instead of returning error response
   - Provides better error handling and follows DRF exception patterns

4. **Function Naming** ✅
   - Renamed _check_tool_usage to _check_tool_usage_in_workflows
   - More explicit function name clarifies it checks workflow usage specifically
   - Updated all calls in destroy() and check_deployment_usage() methods

## Frontend Changes (ToolIde.jsx, CustomToolsHelper.js)

5. **Store State Race Condition Fix** ✅
   - Added explicit reset of hasUnsavedChanges, deploymentUsageInfo, lastExportedAt
   - Ensures fields don't carry over when switching between tools
   - Prevents incorrect export reminders showing for wrong projects

6. **Stale State Race Condition Fix** ✅
   - Added check for current hasUnsavedChanges state after API response
   - Prevents showing export reminder if user exported during in-flight check
   - Uses customToolStore.getState() to get real-time state value

## Not Addressed (Requires Discussion)

- Active filtering question: Needs product/architecture discussion
- UX enhancement for clickable links: May be future enhancement

All code quality and bug fix comments have been fully addressed.

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

Co-Authored-By: Claude <noreply@anthropic.com>

* fix: PR review comments

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

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

* fix: PR review comments

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

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

* coderabbit fixes commit

* Fixes for export conditions

---------

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

* UN-3113 [FEAT] Add custom data support in Prompt Studio (#1719)

support for custom data

Co-authored-by: Deepak K <89829542+Deepak-Kesavan@users.noreply.github.com>

* UN-1725 [FIX] Remove CheckableTag enabled/disabled toggle from LLM profiles (#1704)

Remove the enabled/disabled toggle feature from prompt card LLM profiles
as it caused newly added profiles to appear disabled by default.

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

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>

* fix: Replace CDN URL with local import for PDF worker (#1720)

* fix: Replace CDN URL with local import for PDF worker

Replace the external CDN URL (unpkg.com) for pdf.js worker with a local
import from the installed pdfjs-dist package using Webpack 5's asset
module feature.

Changes:
- Use 'pdfjs-dist/build/pdf.worker.min.js?url' import syntax
- Export the imported worker URL instead of hardcoded CDN URL

Benefits:
- Eliminates external network dependency for PDF rendering
- Worker version automatically stays in sync with installed package
- Enables offline functionality
- Faster loading as worker is bundled with the application
- Consistent with existing pattern used in ExtractionModal.jsx

* refactor: Use export...from syntax for re-exporting PDF worker URL

Addresses SonarCloud code smell by using the more concise
'export { default as X } from' syntax instead of separate
import and export statements.

* UN-3124 [FIX] : Add security headers and HTTP method restrictions to nginx (#1726)

* feat: Add security headers and HTTP method restrictions to nginx

- Add X-Content-Type-Options header to prevent MIME sniffing
- Add X-Frame-Options header to prevent clickjacking
- Add X-XSS-Protection header for XSS protection
- Add Referrer-Policy header for referrer control
- Disable TRACE and TRACK HTTP methods
- Limit allowed HTTP methods to GET, HEAD, POST in location block

* fix: Remove deprecated X-XSS-Protection header

X-XSS-Protection is deprecated and ignored by modern browsers.
Chrome removed support in 2019. Content-Security-Policy (CSP)
is the recommended replacement for XSS protection.

* fix: Limit HTTP methods to GET and HEAD only

Static file serving only requires GET and HEAD methods.
POST is not needed as API calls go directly to the backend.

* UN-3102 [FIX] confirmation alert alway asking issue fix (#1711)

confirmation alert alway asking issue fix

* AH-87 [FIX]: Restore user session on verticals routes refresh (#1731)

Move verticalsRouter inside PersistentLogin wrapper to ensure
session validation runs before rendering verticals pages.
This fixes the issue where refreshing /verticals/subscriptions
showed 'Please login' even for authenticated users.

* UN-2081 [FIX] Surface underlying library errors for database destination connectors in the UI (#1734)

* handling error

* handling error

* handling error

* small change

* change base query exception class

* change base query exception class

* feat/agentic-prompt-studio

* feat/agentic-prompt-studio

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

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

---------

Signed-off-by: Chandrasekharan M <117059509+chandrasekharan-zipstack@users.noreply.github.com>
Signed-off-by: harini-venkataraman <115449948+harini-venkataraman@users.noreply.github.com>
Co-authored-by: Deepak K <89829542+Deepak-Kesavan@users.noreply.github.com>
Co-authored-by: vishnuszipstack <117254672+vishnuszipstack@users.noreply.github.com>
Co-authored-by: Chandrasekharan M <117059509+chandrasekharan-zipstack@users.noreply.github.com>
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Co-authored-by: Kirtiman Mishra <110175055+kirtimanmishrazipstack@users.noreply.github.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: Hari John Kuriakose <hari@zipstack.com>
Co-authored-by: Athul <89829560+athul-rs@users.noreply.github.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Jagadeesh <jagadeeswaran@zipstack.com>
Co-authored-by: Jaseem Jas <89440144+jaseemjaskp@users.noreply.github.com>
harini-venkataraman added a commit that referenced this pull request Jan 13, 2026
* UN-3008 [FIX] Pass word-level confidence setting to Structure Tool (#1714)

* UN-3008 [FIX] Pass word-level confidence setting to Structure Tool

Fix missing propagation of word confidence setting:
- Add ENABLE_WORD_CONFIDENCE constant to SettingsKeys
- Read and pass word confidence setting through tool_settings

* Bump Structure Tool version to 0.0.95

* UN-3099 [FIX] Disable issue in hitl tab in configure destination and table line iss… (#1707)

* disable issue in hitl tab in configure destination and table line issue in logs

* sonar issue fix

* [MISC] Clear search filter when switching adapter settings pages (#1712)

MISC [FIX] Clear search filter when switching adapter settings pages

Fixed the search filter not clearing when switching between LLMs, Vector DBs,
Embedding, and Text Extractor pages. The fix uses React's key prop to force
remount the Search component when page type changes.

Changes:
- Added searchKey prop to ToolNavBar and Search component
- Added clearSearch function to useListSearch hook
- Call clearSearch when adapter type changes in ToolSettings

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

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Co-authored-by: Kirtiman Mishra <110175055+kirtimanmishrazipstack@users.noreply.github.com>

* [MISC] Add back button to Add Adapter/Connector modals (#1710)

* MISC [FEAT] Add back button to Add Adapter/Connector modals

Added a back button in the modal title when configuring a new adapter/connector.
This allows users to return to the adapter selection screen without closing the
entire modal.

- Back button only shown when adding new (not when editing)
- Clicking back resets selectedSourceId and clears metadata

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* Update frontend/src/components/input-output/add-source-modal/AddSourceModal.jsx

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Signed-off-by: Chandrasekharan M <117059509+chandrasekharan-zipstack@users.noreply.github.com>

* Update frontend/src/components/input-output/add-source-modal/AddSourceModal.jsx

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Signed-off-by: Chandrasekharan M <117059509+chandrasekharan-zipstack@users.noreply.github.com>

---------

Signed-off-by: Chandrasekharan M <117059509+chandrasekharan-zipstack@users.noreply.github.com>
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: Kirtiman Mishra <110175055+kirtimanmishrazipstack@users.noreply.github.com>

* [MISC] Load pdfjs worker from node_modules instead of CDN (#1716)

* MISC [FIX] Load pdfjs worker from node_modules instead of CDN

Use ?url import for pdfjs-dist worker to load from local node_modules
instead of relying on CDN URL. Resolves version mismatch issues between
package and worker versions.

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* MISC [FIX] Use centralized pdfWorkerConfig with CRA/Vite compatible new URL() pattern

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Co-authored-by: Hari John Kuriakose <hari@zipstack.com>

* [FIX] Fix PDF.js worker require is not defined error in staging (#1717)

* [FIX] Updated pdf js worker to load from cdn (#1718)

* updated pdf js worker to load from cdn

* lint issue fix

* UN-1722 [FEAT] Add export reminder for Prompt Studio projects in use (#1547)

* UN-1722 [FEAT] Add export reminder for Prompt Studio projects in use

- Add backend API endpoint to check if project is used in deployments
- Implement frontend change tracking for prompt modifications
- Create yellow notification bar component with export action
- Track changes when editing, adding, or deleting prompts
- Clear notification after successful export
- Check usage in API Deployments, ETL/Task Pipelines, and Manual Review

This ensures users are reminded to export their Prompt Studio changes when
the project is actively being used in deployments, preventing confusion
about why changes don't take effect immediately.

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

Co-Authored-By: Claude <noreply@anthropic.com>

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

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

* fix: Remove trailing commas to fix Prettier/ESLint build errors

Removed 10 trailing commas from 4 files that were causing the Docker
build to fail with Prettier violations:
- DocumentParser.jsx: 3 locations (lines 86, 124, 179)
- Header.jsx: 3 locations (lines 73, 176, 277)
- ToolIde.jsx: 2 locations (lines 97, 223)
- custom-tool-store.js: 2 locations (lines 83, 106)

These changes ensure the code passes ESLint/Prettier checks during
the build process without modifying any functionality.

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

Co-Authored-By: Claude <noreply@anthropic.com>

* refactor: Fix CodeRabbit major issues - state carryover and useCallback pattern

Fixed two major issues identified by CodeRabbit review:

1. Fixed state carryover bug in custom-tool-store.js
   - When switching tools, deploymentUsageInfo and lastExportedAt now
     properly reset to null instead of carrying over from previous tool
   - Prevents incorrect export reminders showing for wrong projects

2. Fixed useCallback pattern issue in ToolIde.jsx
   - Replaced isCheckingUsage state in useCallback deps with useRef
   - Prevents unnecessary callback recreations and potential race conditions
   - Simplified useEffect dependencies to only depend on the callback
   - Removed unused isCheckingUsage state variable

These changes improve code quality and prevent potential bugs without
affecting functionality.

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

Co-Authored-By: Claude <noreply@anthropic.com>

* fix: Address all PR #1547 review comments from chandrasekharan-zipstack

This commit addresses all actionable review comments from the code reviewer:

## Backend Changes (views.py, constants.py, exceptions.py)

1. **Import Location Fix** ✅
   - Moved APIDeployment, Pipeline, and WorkflowEndpoint imports to top of file
   - Removed lazy imports from check_deployment_usage method
   - Follows Python best practices for import organization

2. **Deployment Type Enum** ✅
   - Created DeploymentType class in constants.py with deployment type constants
   - Updated check_deployment_usage to use DeploymentType constants
   - Replaced hardcoded strings: "API Deployment", "ETL Pipeline", etc.
   - Improves maintainability and prevents typos

3. **Error Handling** ✅
   - Created DeploymentUsageCheckError exception class
   - Changed check_deployment_usage to raise exception instead of returning error response
   - Provides better error handling and follows DRF exception patterns

4. **Function Naming** ✅
   - Renamed _check_tool_usage to _check_tool_usage_in_workflows
   - More explicit function name clarifies it checks workflow usage specifically
   - Updated all calls in destroy() and check_deployment_usage() methods

## Frontend Changes (ToolIde.jsx, CustomToolsHelper.js)

5. **Store State Race Condition Fix** ✅
   - Added explicit reset of hasUnsavedChanges, deploymentUsageInfo, lastExportedAt
   - Ensures fields don't carry over when switching between tools
   - Prevents incorrect export reminders showing for wrong projects

6. **Stale State Race Condition Fix** ✅
   - Added check for current hasUnsavedChanges state after API response
   - Prevents showing export reminder if user exported during in-flight check
   - Uses customToolStore.getState() to get real-time state value

## Not Addressed (Requires Discussion)

- Active filtering question: Needs product/architecture discussion
- UX enhancement for clickable links: May be future enhancement

All code quality and bug fix comments have been fully addressed.

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

Co-Authored-By: Claude <noreply@anthropic.com>

* fix: PR review comments

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

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

* fix: PR review comments

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

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

* coderabbit fixes commit

* Fixes for export conditions

---------

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

* UN-3113 [FEAT] Add custom data support in Prompt Studio (#1719)

support for custom data

Co-authored-by: Deepak K <89829542+Deepak-Kesavan@users.noreply.github.com>

* UN-1725 [FIX] Remove CheckableTag enabled/disabled toggle from LLM profiles (#1704)

Remove the enabled/disabled toggle feature from prompt card LLM profiles
as it caused newly added profiles to appear disabled by default.

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

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>

* fix: Replace CDN URL with local import for PDF worker (#1720)

* fix: Replace CDN URL with local import for PDF worker

Replace the external CDN URL (unpkg.com) for pdf.js worker with a local
import from the installed pdfjs-dist package using Webpack 5's asset
module feature.

Changes:
- Use 'pdfjs-dist/build/pdf.worker.min.js?url' import syntax
- Export the imported worker URL instead of hardcoded CDN URL

Benefits:
- Eliminates external network dependency for PDF rendering
- Worker version automatically stays in sync with installed package
- Enables offline functionality
- Faster loading as worker is bundled with the application
- Consistent with existing pattern used in ExtractionModal.jsx

* refactor: Use export...from syntax for re-exporting PDF worker URL

Addresses SonarCloud code smell by using the more concise
'export { default as X } from' syntax instead of separate
import and export statements.

* UN-3124 [FIX] : Add security headers and HTTP method restrictions to nginx (#1726)

* feat: Add security headers and HTTP method restrictions to nginx

- Add X-Content-Type-Options header to prevent MIME sniffing
- Add X-Frame-Options header to prevent clickjacking
- Add X-XSS-Protection header for XSS protection
- Add Referrer-Policy header for referrer control
- Disable TRACE and TRACK HTTP methods
- Limit allowed HTTP methods to GET, HEAD, POST in location block

* fix: Remove deprecated X-XSS-Protection header

X-XSS-Protection is deprecated and ignored by modern browsers.
Chrome removed support in 2019. Content-Security-Policy (CSP)
is the recommended replacement for XSS protection.

* fix: Limit HTTP methods to GET and HEAD only

Static file serving only requires GET and HEAD methods.
POST is not needed as API calls go directly to the backend.

* UN-3102 [FIX] confirmation alert alway asking issue fix (#1711)

confirmation alert alway asking issue fix

* AH-87 [FIX]: Restore user session on verticals routes refresh (#1731)

Move verticalsRouter inside PersistentLogin wrapper to ensure
session validation runs before rendering verticals pages.
This fixes the issue where refreshing /verticals/subscriptions
showed 'Please login' even for authenticated users.

* UN-2081 [FIX] Surface underlying library errors for database destination connectors in the UI (#1734)

* handling error

* handling error

* handling error

* small change

* change base query exception class

* change base query exception class

* feat/agentic-prompt-studio

* feat/agentic-prompt-studio

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

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

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

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

* feat/agentic-prompt-studio

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

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

---------

Signed-off-by: Chandrasekharan M <117059509+chandrasekharan-zipstack@users.noreply.github.com>
Signed-off-by: harini-venkataraman <115449948+harini-venkataraman@users.noreply.github.com>
Co-authored-by: Deepak K <89829542+Deepak-Kesavan@users.noreply.github.com>
Co-authored-by: vishnuszipstack <117254672+vishnuszipstack@users.noreply.github.com>
Co-authored-by: Chandrasekharan M <117059509+chandrasekharan-zipstack@users.noreply.github.com>
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Co-authored-by: Kirtiman Mishra <110175055+kirtimanmishrazipstack@users.noreply.github.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: Hari John Kuriakose <hari@zipstack.com>
Co-authored-by: Athul <89829560+athul-rs@users.noreply.github.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Jagadeesh <jagadeeswaran@zipstack.com>
Co-authored-by: Jaseem Jas <89440144+jaseemjaskp@users.noreply.github.com>
harini-venkataraman added a commit that referenced this pull request Jan 13, 2026
* UN-3008 [FIX] Pass word-level confidence setting to Structure Tool (#1714)

* UN-3008 [FIX] Pass word-level confidence setting to Structure Tool

Fix missing propagation of word confidence setting:
- Add ENABLE_WORD_CONFIDENCE constant to SettingsKeys
- Read and pass word confidence setting through tool_settings

* Bump Structure Tool version to 0.0.95

* UN-3099 [FIX] Disable issue in hitl tab in configure destination and table line iss… (#1707)

* disable issue in hitl tab in configure destination and table line issue in logs

* sonar issue fix

* [MISC] Clear search filter when switching adapter settings pages (#1712)

MISC [FIX] Clear search filter when switching adapter settings pages

Fixed the search filter not clearing when switching between LLMs, Vector DBs,
Embedding, and Text Extractor pages. The fix uses React's key prop to force
remount the Search component when page type changes.

Changes:
- Added searchKey prop to ToolNavBar and Search component
- Added clearSearch function to useListSearch hook
- Call clearSearch when adapter type changes in ToolSettings

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

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Co-authored-by: Kirtiman Mishra <110175055+kirtimanmishrazipstack@users.noreply.github.com>

* [MISC] Add back button to Add Adapter/Connector modals (#1710)

* MISC [FEAT] Add back button to Add Adapter/Connector modals

Added a back button in the modal title when configuring a new adapter/connector.
This allows users to return to the adapter selection screen without closing the
entire modal.

- Back button only shown when adding new (not when editing)
- Clicking back resets selectedSourceId and clears metadata

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* Update frontend/src/components/input-output/add-source-modal/AddSourceModal.jsx

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Signed-off-by: Chandrasekharan M <117059509+chandrasekharan-zipstack@users.noreply.github.com>

* Update frontend/src/components/input-output/add-source-modal/AddSourceModal.jsx

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Signed-off-by: Chandrasekharan M <117059509+chandrasekharan-zipstack@users.noreply.github.com>

---------

Signed-off-by: Chandrasekharan M <117059509+chandrasekharan-zipstack@users.noreply.github.com>
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: Kirtiman Mishra <110175055+kirtimanmishrazipstack@users.noreply.github.com>

* [MISC] Load pdfjs worker from node_modules instead of CDN (#1716)

* MISC [FIX] Load pdfjs worker from node_modules instead of CDN

Use ?url import for pdfjs-dist worker to load from local node_modules
instead of relying on CDN URL. Resolves version mismatch issues between
package and worker versions.

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* MISC [FIX] Use centralized pdfWorkerConfig with CRA/Vite compatible new URL() pattern

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Co-authored-by: Hari John Kuriakose <hari@zipstack.com>

* [FIX] Fix PDF.js worker require is not defined error in staging (#1717)

* [FIX] Updated pdf js worker to load from cdn (#1718)

* updated pdf js worker to load from cdn

* lint issue fix

* UN-1722 [FEAT] Add export reminder for Prompt Studio projects in use (#1547)

* UN-1722 [FEAT] Add export reminder for Prompt Studio projects in use

- Add backend API endpoint to check if project is used in deployments
- Implement frontend change tracking for prompt modifications
- Create yellow notification bar component with export action
- Track changes when editing, adding, or deleting prompts
- Clear notification after successful export
- Check usage in API Deployments, ETL/Task Pipelines, and Manual Review

This ensures users are reminded to export their Prompt Studio changes when
the project is actively being used in deployments, preventing confusion
about why changes don't take effect immediately.

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

Co-Authored-By: Claude <noreply@anthropic.com>

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

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

* fix: Remove trailing commas to fix Prettier/ESLint build errors

Removed 10 trailing commas from 4 files that were causing the Docker
build to fail with Prettier violations:
- DocumentParser.jsx: 3 locations (lines 86, 124, 179)
- Header.jsx: 3 locations (lines 73, 176, 277)
- ToolIde.jsx: 2 locations (lines 97, 223)
- custom-tool-store.js: 2 locations (lines 83, 106)

These changes ensure the code passes ESLint/Prettier checks during
the build process without modifying any functionality.

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

Co-Authored-By: Claude <noreply@anthropic.com>

* refactor: Fix CodeRabbit major issues - state carryover and useCallback pattern

Fixed two major issues identified by CodeRabbit review:

1. Fixed state carryover bug in custom-tool-store.js
   - When switching tools, deploymentUsageInfo and lastExportedAt now
     properly reset to null instead of carrying over from previous tool
   - Prevents incorrect export reminders showing for wrong projects

2. Fixed useCallback pattern issue in ToolIde.jsx
   - Replaced isCheckingUsage state in useCallback deps with useRef
   - Prevents unnecessary callback recreations and potential race conditions
   - Simplified useEffect dependencies to only depend on the callback
   - Removed unused isCheckingUsage state variable

These changes improve code quality and prevent potential bugs without
affecting functionality.

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

Co-Authored-By: Claude <noreply@anthropic.com>

* fix: Address all PR #1547 review comments from chandrasekharan-zipstack

This commit addresses all actionable review comments from the code reviewer:

## Backend Changes (views.py, constants.py, exceptions.py)

1. **Import Location Fix** ✅
   - Moved APIDeployment, Pipeline, and WorkflowEndpoint imports to top of file
   - Removed lazy imports from check_deployment_usage method
   - Follows Python best practices for import organization

2. **Deployment Type Enum** ✅
   - Created DeploymentType class in constants.py with deployment type constants
   - Updated check_deployment_usage to use DeploymentType constants
   - Replaced hardcoded strings: "API Deployment", "ETL Pipeline", etc.
   - Improves maintainability and prevents typos

3. **Error Handling** ✅
   - Created DeploymentUsageCheckError exception class
   - Changed check_deployment_usage to raise exception instead of returning error response
   - Provides better error handling and follows DRF exception patterns

4. **Function Naming** ✅
   - Renamed _check_tool_usage to _check_tool_usage_in_workflows
   - More explicit function name clarifies it checks workflow usage specifically
   - Updated all calls in destroy() and check_deployment_usage() methods

## Frontend Changes (ToolIde.jsx, CustomToolsHelper.js)

5. **Store State Race Condition Fix** ✅
   - Added explicit reset of hasUnsavedChanges, deploymentUsageInfo, lastExportedAt
   - Ensures fields don't carry over when switching between tools
   - Prevents incorrect export reminders showing for wrong projects

6. **Stale State Race Condition Fix** ✅
   - Added check for current hasUnsavedChanges state after API response
   - Prevents showing export reminder if user exported during in-flight check
   - Uses customToolStore.getState() to get real-time state value

## Not Addressed (Requires Discussion)

- Active filtering question: Needs product/architecture discussion
- UX enhancement for clickable links: May be future enhancement

All code quality and bug fix comments have been fully addressed.

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

Co-Authored-By: Claude <noreply@anthropic.com>

* fix: PR review comments

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

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

* fix: PR review comments

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

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

* coderabbit fixes commit

* Fixes for export conditions

---------

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

* UN-3113 [FEAT] Add custom data support in Prompt Studio (#1719)

support for custom data

Co-authored-by: Deepak K <89829542+Deepak-Kesavan@users.noreply.github.com>

* UN-1725 [FIX] Remove CheckableTag enabled/disabled toggle from LLM profiles (#1704)

Remove the enabled/disabled toggle feature from prompt card LLM profiles
as it caused newly added profiles to appear disabled by default.

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

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>

* fix: Replace CDN URL with local import for PDF worker (#1720)

* fix: Replace CDN URL with local import for PDF worker

Replace the external CDN URL (unpkg.com) for pdf.js worker with a local
import from the installed pdfjs-dist package using Webpack 5's asset
module feature.

Changes:
- Use 'pdfjs-dist/build/pdf.worker.min.js?url' import syntax
- Export the imported worker URL instead of hardcoded CDN URL

Benefits:
- Eliminates external network dependency for PDF rendering
- Worker version automatically stays in sync with installed package
- Enables offline functionality
- Faster loading as worker is bundled with the application
- Consistent with existing pattern used in ExtractionModal.jsx

* refactor: Use export...from syntax for re-exporting PDF worker URL

Addresses SonarCloud code smell by using the more concise
'export { default as X } from' syntax instead of separate
import and export statements.

* UN-3124 [FIX] : Add security headers and HTTP method restrictions to nginx (#1726)

* feat: Add security headers and HTTP method restrictions to nginx

- Add X-Content-Type-Options header to prevent MIME sniffing
- Add X-Frame-Options header to prevent clickjacking
- Add X-XSS-Protection header for XSS protection
- Add Referrer-Policy header for referrer control
- Disable TRACE and TRACK HTTP methods
- Limit allowed HTTP methods to GET, HEAD, POST in location block

* fix: Remove deprecated X-XSS-Protection header

X-XSS-Protection is deprecated and ignored by modern browsers.
Chrome removed support in 2019. Content-Security-Policy (CSP)
is the recommended replacement for XSS protection.

* fix: Limit HTTP methods to GET and HEAD only

Static file serving only requires GET and HEAD methods.
POST is not needed as API calls go directly to the backend.

* UN-3102 [FIX] confirmation alert alway asking issue fix (#1711)

confirmation alert alway asking issue fix

* AH-87 [FIX]: Restore user session on verticals routes refresh (#1731)

Move verticalsRouter inside PersistentLogin wrapper to ensure
session validation runs before rendering verticals pages.
This fixes the issue where refreshing /verticals/subscriptions
showed 'Please login' even for authenticated users.

* UN-2081 [FIX] Surface underlying library errors for database destination connectors in the UI (#1734)

* handling error

* handling error

* handling error

* small change

* change base query exception class

* change base query exception class

* feat/agentic-prompt-studio

* feat/agentic-prompt-studio

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

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

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

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

* feat/agentic-prompt-studio

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

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

* feat/agentic-prompt-studio

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

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

---------

Signed-off-by: Chandrasekharan M <117059509+chandrasekharan-zipstack@users.noreply.github.com>
Signed-off-by: harini-venkataraman <115449948+harini-venkataraman@users.noreply.github.com>
Co-authored-by: Deepak K <89829542+Deepak-Kesavan@users.noreply.github.com>
Co-authored-by: vishnuszipstack <117254672+vishnuszipstack@users.noreply.github.com>
Co-authored-by: Chandrasekharan M <117059509+chandrasekharan-zipstack@users.noreply.github.com>
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Co-authored-by: Kirtiman Mishra <110175055+kirtimanmishrazipstack@users.noreply.github.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: Hari John Kuriakose <hari@zipstack.com>
Co-authored-by: Athul <89829560+athul-rs@users.noreply.github.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Jagadeesh <jagadeeswaran@zipstack.com>
Co-authored-by: Jaseem Jas <89440144+jaseemjaskp@users.noreply.github.com>
harini-venkataraman added a commit that referenced this pull request Jan 13, 2026
* UN-3008 [FIX] Pass word-level confidence setting to Structure Tool (#1714)

* UN-3008 [FIX] Pass word-level confidence setting to Structure Tool

Fix missing propagation of word confidence setting:
- Add ENABLE_WORD_CONFIDENCE constant to SettingsKeys
- Read and pass word confidence setting through tool_settings

* Bump Structure Tool version to 0.0.95

* UN-3099 [FIX] Disable issue in hitl tab in configure destination and table line iss… (#1707)

* disable issue in hitl tab in configure destination and table line issue in logs

* sonar issue fix

* [MISC] Clear search filter when switching adapter settings pages (#1712)

MISC [FIX] Clear search filter when switching adapter settings pages

Fixed the search filter not clearing when switching between LLMs, Vector DBs,
Embedding, and Text Extractor pages. The fix uses React's key prop to force
remount the Search component when page type changes.

Changes:
- Added searchKey prop to ToolNavBar and Search component
- Added clearSearch function to useListSearch hook
- Call clearSearch when adapter type changes in ToolSettings

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

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Co-authored-by: Kirtiman Mishra <110175055+kirtimanmishrazipstack@users.noreply.github.com>

* [MISC] Add back button to Add Adapter/Connector modals (#1710)

* MISC [FEAT] Add back button to Add Adapter/Connector modals

Added a back button in the modal title when configuring a new adapter/connector.
This allows users to return to the adapter selection screen without closing the
entire modal.

- Back button only shown when adding new (not when editing)
- Clicking back resets selectedSourceId and clears metadata

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* Update frontend/src/components/input-output/add-source-modal/AddSourceModal.jsx

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Signed-off-by: Chandrasekharan M <117059509+chandrasekharan-zipstack@users.noreply.github.com>

* Update frontend/src/components/input-output/add-source-modal/AddSourceModal.jsx

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Signed-off-by: Chandrasekharan M <117059509+chandrasekharan-zipstack@users.noreply.github.com>

---------

Signed-off-by: Chandrasekharan M <117059509+chandrasekharan-zipstack@users.noreply.github.com>
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: Kirtiman Mishra <110175055+kirtimanmishrazipstack@users.noreply.github.com>

* [MISC] Load pdfjs worker from node_modules instead of CDN (#1716)

* MISC [FIX] Load pdfjs worker from node_modules instead of CDN

Use ?url import for pdfjs-dist worker to load from local node_modules
instead of relying on CDN URL. Resolves version mismatch issues between
package and worker versions.

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* MISC [FIX] Use centralized pdfWorkerConfig with CRA/Vite compatible new URL() pattern

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Co-authored-by: Hari John Kuriakose <hari@zipstack.com>

* [FIX] Fix PDF.js worker require is not defined error in staging (#1717)

* [FIX] Updated pdf js worker to load from cdn (#1718)

* updated pdf js worker to load from cdn

* lint issue fix

* UN-1722 [FEAT] Add export reminder for Prompt Studio projects in use (#1547)

* UN-1722 [FEAT] Add export reminder for Prompt Studio projects in use

- Add backend API endpoint to check if project is used in deployments
- Implement frontend change tracking for prompt modifications
- Create yellow notification bar component with export action
- Track changes when editing, adding, or deleting prompts
- Clear notification after successful export
- Check usage in API Deployments, ETL/Task Pipelines, and Manual Review

This ensures users are reminded to export their Prompt Studio changes when
the project is actively being used in deployments, preventing confusion
about why changes don't take effect immediately.

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

Co-Authored-By: Claude <noreply@anthropic.com>

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

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

* fix: Remove trailing commas to fix Prettier/ESLint build errors

Removed 10 trailing commas from 4 files that were causing the Docker
build to fail with Prettier violations:
- DocumentParser.jsx: 3 locations (lines 86, 124, 179)
- Header.jsx: 3 locations (lines 73, 176, 277)
- ToolIde.jsx: 2 locations (lines 97, 223)
- custom-tool-store.js: 2 locations (lines 83, 106)

These changes ensure the code passes ESLint/Prettier checks during
the build process without modifying any functionality.

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

Co-Authored-By: Claude <noreply@anthropic.com>

* refactor: Fix CodeRabbit major issues - state carryover and useCallback pattern

Fixed two major issues identified by CodeRabbit review:

1. Fixed state carryover bug in custom-tool-store.js
   - When switching tools, deploymentUsageInfo and lastExportedAt now
     properly reset to null instead of carrying over from previous tool
   - Prevents incorrect export reminders showing for wrong projects

2. Fixed useCallback pattern issue in ToolIde.jsx
   - Replaced isCheckingUsage state in useCallback deps with useRef
   - Prevents unnecessary callback recreations and potential race conditions
   - Simplified useEffect dependencies to only depend on the callback
   - Removed unused isCheckingUsage state variable

These changes improve code quality and prevent potential bugs without
affecting functionality.

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

Co-Authored-By: Claude <noreply@anthropic.com>

* fix: Address all PR #1547 review comments from chandrasekharan-zipstack

This commit addresses all actionable review comments from the code reviewer:

## Backend Changes (views.py, constants.py, exceptions.py)

1. **Import Location Fix** ✅
   - Moved APIDeployment, Pipeline, and WorkflowEndpoint imports to top of file
   - Removed lazy imports from check_deployment_usage method
   - Follows Python best practices for import organization

2. **Deployment Type Enum** ✅
   - Created DeploymentType class in constants.py with deployment type constants
   - Updated check_deployment_usage to use DeploymentType constants
   - Replaced hardcoded strings: "API Deployment", "ETL Pipeline", etc.
   - Improves maintainability and prevents typos

3. **Error Handling** ✅
   - Created DeploymentUsageCheckError exception class
   - Changed check_deployment_usage to raise exception instead of returning error response
   - Provides better error handling and follows DRF exception patterns

4. **Function Naming** ✅
   - Renamed _check_tool_usage to _check_tool_usage_in_workflows
   - More explicit function name clarifies it checks workflow usage specifically
   - Updated all calls in destroy() and check_deployment_usage() methods

## Frontend Changes (ToolIde.jsx, CustomToolsHelper.js)

5. **Store State Race Condition Fix** ✅
   - Added explicit reset of hasUnsavedChanges, deploymentUsageInfo, lastExportedAt
   - Ensures fields don't carry over when switching between tools
   - Prevents incorrect export reminders showing for wrong projects

6. **Stale State Race Condition Fix** ✅
   - Added check for current hasUnsavedChanges state after API response
   - Prevents showing export reminder if user exported during in-flight check
   - Uses customToolStore.getState() to get real-time state value

## Not Addressed (Requires Discussion)

- Active filtering question: Needs product/architecture discussion
- UX enhancement for clickable links: May be future enhancement

All code quality and bug fix comments have been fully addressed.

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

Co-Authored-By: Claude <noreply@anthropic.com>

* fix: PR review comments

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

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

* fix: PR review comments

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

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

* coderabbit fixes commit

* Fixes for export conditions

---------

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

* UN-3113 [FEAT] Add custom data support in Prompt Studio (#1719)

support for custom data

Co-authored-by: Deepak K <89829542+Deepak-Kesavan@users.noreply.github.com>

* UN-1725 [FIX] Remove CheckableTag enabled/disabled toggle from LLM profiles (#1704)

Remove the enabled/disabled toggle feature from prompt card LLM profiles
as it caused newly added profiles to appear disabled by default.

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

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>

* fix: Replace CDN URL with local import for PDF worker (#1720)

* fix: Replace CDN URL with local import for PDF worker

Replace the external CDN URL (unpkg.com) for pdf.js worker with a local
import from the installed pdfjs-dist package using Webpack 5's asset
module feature.

Changes:
- Use 'pdfjs-dist/build/pdf.worker.min.js?url' import syntax
- Export the imported worker URL instead of hardcoded CDN URL

Benefits:
- Eliminates external network dependency for PDF rendering
- Worker version automatically stays in sync with installed package
- Enables offline functionality
- Faster loading as worker is bundled with the application
- Consistent with existing pattern used in ExtractionModal.jsx

* refactor: Use export...from syntax for re-exporting PDF worker URL

Addresses SonarCloud code smell by using the more concise
'export { default as X } from' syntax instead of separate
import and export statements.

* UN-3124 [FIX] : Add security headers and HTTP method restrictions to nginx (#1726)

* feat: Add security headers and HTTP method restrictions to nginx

- Add X-Content-Type-Options header to prevent MIME sniffing
- Add X-Frame-Options header to prevent clickjacking
- Add X-XSS-Protection header for XSS protection
- Add Referrer-Policy header for referrer control
- Disable TRACE and TRACK HTTP methods
- Limit allowed HTTP methods to GET, HEAD, POST in location block

* fix: Remove deprecated X-XSS-Protection header

X-XSS-Protection is deprecated and ignored by modern browsers.
Chrome removed support in 2019. Content-Security-Policy (CSP)
is the recommended replacement for XSS protection.

* fix: Limit HTTP methods to GET and HEAD only

Static file serving only requires GET and HEAD methods.
POST is not needed as API calls go directly to the backend.

* UN-3102 [FIX] confirmation alert alway asking issue fix (#1711)

confirmation alert alway asking issue fix

* AH-87 [FIX]: Restore user session on verticals routes refresh (#1731)

Move verticalsRouter inside PersistentLogin wrapper to ensure
session validation runs before rendering verticals pages.
This fixes the issue where refreshing /verticals/subscriptions
showed 'Please login' even for authenticated users.

* UN-2081 [FIX] Surface underlying library errors for database destination connectors in the UI (#1734)

* handling error

* handling error

* handling error

* small change

* change base query exception class

* change base query exception class

* feat/agentic-prompt-studio

* feat/agentic-prompt-studio

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

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

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

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

* feat/agentic-prompt-studio

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

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

* feat/agentic-prompt-studio

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

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

* feat/agentic-prompt-studio

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

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

---------

Signed-off-by: Chandrasekharan M <117059509+chandrasekharan-zipstack@users.noreply.github.com>
Signed-off-by: harini-venkataraman <115449948+harini-venkataraman@users.noreply.github.com>
Co-authored-by: Deepak K <89829542+Deepak-Kesavan@users.noreply.github.com>
Co-authored-by: vishnuszipstack <117254672+vishnuszipstack@users.noreply.github.com>
Co-authored-by: Chandrasekharan M <117059509+chandrasekharan-zipstack@users.noreply.github.com>
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Co-authored-by: Kirtiman Mishra <110175055+kirtimanmishrazipstack@users.noreply.github.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: Hari John Kuriakose <hari@zipstack.com>
Co-authored-by: Athul <89829560+athul-rs@users.noreply.github.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Jagadeesh <jagadeeswaran@zipstack.com>
Co-authored-by: Jaseem Jas <89440144+jaseemjaskp@users.noreply.github.com>
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.

5 participants