Skip to content

The fastest, litest AI Gateway. Rust core with Python SDK. Call 100+ LLM APIs in OpenAI (or native) format with cost tracking, guardrails, load balancing, and logging [Bedrock, Azure, OpenAI, Anthropic, OpenAI, VertexAI, vLLM, Nvidia NIM]

chore: remove in-product survey and Claude Code feedback nudges (#30773)

ryan-crabbe-berrie4a53f50de24
diff --git a/litellm/proxy/ui_crud_endpoints/proxy_setting_endpoints.py b/litellm/proxy/ui_crud_endpoints/proxy_setting_endpoints.py
index 3a609eec127..cefe349aade 100644
--- a/litellm/proxy/ui_crud_endpoints/proxy_setting_endpoints.py
+++ b/litellm/proxy/ui_crud_endpoints/proxy_setting_endpoints.py
@@ -14,13 +14,11 @@ from litellm.proxy._types import *
from litellm.proxy.auth.user_api_key_auth import user_api_key_auth
from litellm.repositories.config_repository import ConfigRepository
from litellm.repositories.table_repositories import (
- DailyTagSpendRepository,
SSOConfigRepository,
UISettingsRepository,
)
from litellm.types.proxy.management_endpoints.ui_sso import (
DefaultTeamSSOParams,
- InProductNudgeResponse,
SSOConfig,
)
@@ -178,11 +176,6 @@ class UISettings(BaseModel):
description="If true, org admins cannot generate API keys via /key/generate.",
)
- disable_ui_nudges: bool = Field(
- default=False,
- description="If true, suppresses in-product UI nudges (survey and Claude Code feedback popups) for all users.",
- )
-
class UISettingsResponse(SettingsResponse):
"""Response model for UI settings"""
@@ -206,7 +199,6 @@ ALLOWED_UI_SETTINGS_FIELDS = {
"scope_user_search_to_org",
"disable_custom_api_keys",
"disable_key_generate_for_org_admin",
- "disable_ui_nudges",
}
# Flags that must be synced from the persisted UISettings into
@@ -1117,34 +1109,6 @@ async def update_mcp_semantic_filter_settings(
return result
- "/in_product_nudges",
- tags=["UI Settings"],
- dependencies=[Depends(user_api_key_auth)],
- response_model=InProductNudgeResponse,
-)
-async def get_in_product_nudges():
- """
- Get in-product nudges configuration.
- """
- from litellm.proxy.proxy_server import prisma_client
-
- if prisma_client is None:
- raise HTTPException(
- status_code=500,
- detail={"error": "Database not connected. Please connect a database."},
- )
-
- db_record = await DailyTagSpendRepository(prisma_client).table.find_first(
- where={"tag": "User-Agent: claude-cli"}
- )
-
- if db_record:
- return InProductNudgeResponse(is_claude_code_enabled=True)
-
- return InProductNudgeResponse(is_claude_code_enabled=False)
-
-
UI_SETTINGS_CACHE_KEY = "ui_settings:settings_dict"
UI_SETTINGS_CACHE_TTL = 600 # 10 minutes
diff --git a/litellm/types/proxy/management_endpoints/ui_sso.py b/litellm/types/proxy/management_endpoints/ui_sso.py
index 7d8ff0f65c1..771eb773c0d 100644
--- a/litellm/types/proxy/management_endpoints/ui_sso.py
+++ b/litellm/types/proxy/management_endpoints/ui_sso.py
@@ -1,6 +1,6 @@
from typing import Dict, List, Literal, Optional, Union
-from pydantic import BaseModel, Field
+from pydantic import Field
from typing_extensions import TypedDict
from litellm.proxy._types import KeyManagementRoutes, LitellmUserRoles
@@ -209,10 +209,3 @@ class DefaultTeamSSOParams(LiteLLMPydanticObjectBase):
default=None,
description="Default permissions granted to members of newly created teams (e.g. /key/generate, /key/update, /key/delete). /key/info and /key/health are always included.",
)
-
-
-class InProductNudgeResponse(BaseModel):
- is_claude_code_enabled: bool = Field(
- default=False,
- description="Whether the Claude Code nudge should be shown.",
- )
diff --git a/tests/test_litellm/proxy/auth/test_route_checks.py b/tests/test_litellm/proxy/auth/test_route_checks.py
index 7a4597c4e02..52ba1dbcfbd 100644
--- a/tests/test_litellm/proxy/auth/test_route_checks.py
+++ b/tests/test_litellm/proxy/auth/test_route_checks.py
@@ -1985,7 +1985,6 @@ def test_proxy_admin_viewer_can_access_settings_read_endpoints(route):
# corners of the codebase and represent the long tail of GETs we'd otherwise
# need to enumerate manually. Default-allow makes them all work.
ADMIN_VIEWER_REPORTED_GET_ROUTES = [
- "/in_product_nudges",
"/health/latest",
"/credentials",
"/v1/mcp/network/client-ip",
diff --git a/tests/test_litellm/proxy/ui_crud_endpoints/test_proxy_setting_endpoints.py b/tests/test_litellm/proxy/ui_crud_endpoints/test_proxy_setting_endpoints.py
index f77af2d90bf..ae217aca16e 100644
--- a/tests/test_litellm/proxy/ui_crud_endpoints/test_proxy_setting_endpoints.py
+++ b/tests/test_litellm/proxy/ui_crud_endpoints/test_proxy_setting_endpoints.py
@@ -1032,45 +1032,6 @@ class TestProxySettingEndpoints:
stored_settings = json.loads(create_data["ui_settings"])
assert stored_settings["disable_model_add_for_internal_users"] is True
- def test_update_ui_settings_persists_disable_ui_nudges(
- self, mock_auth, monkeypatch
- ):
- """disable_ui_nudges must be allowlisted so admins can suppress UI popups for everyone"""
- from unittest.mock import AsyncMock, MagicMock
-
- from litellm.proxy._types import UserAPIKeyAuth
- from litellm.proxy.auth.user_api_key_auth import user_api_key_auth
-
- mock_user_auth = UserAPIKeyAuth(
- user_id="test-user-123",
- user_role=LitellmUserRoles.PROXY_ADMIN,
- )
- app.dependency_overrides[user_api_key_auth] = lambda: mock_user_auth
-
- monkeypatch.setattr("litellm.proxy.proxy_server.store_model_in_db", True)
- mock_prisma = MagicMock()
- mock_prisma.db.litellm_uisettings.upsert = AsyncMock()
- mock_prisma.db.litellm_uisettings.find_unique = AsyncMock(return_value=None)
- monkeypatch.setattr("litellm.proxy.proxy_server.prisma_client", mock_prisma)
-
- try:
- response = client.patch(
- "/update/ui_settings", json={"disable_ui_nudges": True}
- )
- finally:
- app.dependency_overrides.clear()
-
- assert response.status_code == 200
- data = response.json()
- assert data["status"] == "success"
- assert data["settings"]["disable_ui_nudges"] is True
-
- create_data = mock_prisma.db.litellm_uisettings.upsert.call_args.kwargs["data"][
- "create"
- ]
- stored_settings = json.loads(create_data["ui_settings"])
- assert stored_settings["disable_ui_nudges"] is True
-
def test_update_ui_settings_ignores_non_allowlisted_value(
self, mock_auth, monkeypatch
):
diff --git a/ui/litellm-dashboard/eslint-suppressions.json b/ui/litellm-dashboard/eslint-suppressions.json
index 7820750cee3..770c953d3f3 100644
--- a/ui/litellm-dashboard/eslint-suppressions.json
+++ b/ui/litellm-dashboard/eslint-suppressions.json
@@ -1848,16 +1848,6 @@
"count": 1
}
},
- "src/components/survey/NudgePrompt.tsx": {
- "react-hooks/set-state-in-effect": {
- "count": 1
- }
- },
- "src/components/survey/SurveyModal.tsx": {
- "no-restricted-syntax": {
- "count": 1
- }
- },
"src/components/tag_management/TagTable.tsx": {
"no-restricted-imports": {
"count": 1
diff --git a/ui/litellm-dashboard/src/app/(dashboard)/page.tsx b/ui/litellm-dashboard/src/app/(dashboard)/page.tsx
index 4604d5a0a53..8320f1d6a1b 100644
--- a/ui/litellm-dashboard/src/app/(dashboard)/page.tsx
+++ b/ui/litellm-dashboard/src/app/(dashboard)/page.tsx
@@ -1,13 +1,11 @@
"use client";
import { teamListCall as v2TeamListCall } from "@/app/(dashboard)/hooks/teams/useTeams";
-import { useUISettings } from "@/app/(dashboard)/hooks/uiSettings/useUISettings";
import LoadingScreen from "@/components/common_components/LoadingScreen";
import { Team } from "@/components/key_team_helpers/key_list";
-import { Organization, proxyBaseUrl, getInProductNudgesCall } from "@/components/networking";
+import { Organization, proxyBaseUrl } from "@/components/networking";
import { CreateKeyPrefillData } from "@/components/organisms/create_key_button";
import { fetchOrganizations } from "@/components/organizations";
-import { SurveyPrompt, SurveyModal, ClaudeCodePrompt, ClaudeCodeModal } from "@/components/survey";
import UserDashboard from "@/components/user_dashboard";
import { useAuth } from "@/contexts/AuthContext";
import {
@@ -33,18 +31,6 @@ function CreateKeyPageContent() {
const searchParams = useSearchParams()!;
const [createClicked, setCreateClicked] = useState<boolean>(false);
- const { data: uiSettingsData, isLoading: uiSettingsLoading } = useUISettings();
- const nudgesDisabled = uiSettingsLoading || Boolean(uiSettingsData?.values?.disable_ui_nudges);
-
- // Survey state - always show by default
- const [showSurveyPrompt, setShowSurveyPrompt] = useState(true);
- const [showSurveyModal, setShowSurveyModal] = useState(false);
-
- // Claude Code feedback state
- const [isClaudeCode, setIsClaudeCode] = useState(false);
- const [showClaudeCodePrompt, setShowClaudeCodePrompt] = useState(false);
- const [showClaudeCodeModal, setShowClaudeCodeModal] = useState(false);
-
const invitation_id = searchParams.get("invitation_id");
// Parse URL query parameters for pre-filling the create key form
@@ -178,90 +164,6 @@ function CreateKeyPageContent() {
}
}, [accessToken, userID, userRole]);
- // Fetch in-product nudges configuration from backend
- useEffect(() => {
- if (nudgesDisabled) {
- return;
- }
- if (accessToken && token) {
- (async () => {
- try {
- const nudgesConfig = await getInProductNudgesCall(accessToken);
- const isUsingClaudeCode = nudgesConfig?.is_claude_code_enabled || false;
- setIsClaudeCode(isUsingClaudeCode);
-
- // Show Claude Code prompt on login if enabled
- if (isUsingClaudeCode) {
- setShowClaudeCodePrompt(true);
- // Don't show the regular survey prompt if showing Claude Code prompt
- setShowSurveyPrompt(false);
- }
- } catch (error) {
- console.error("Failed to fetch in-product nudges:", error);
- // Silently fail and don't show Claude Code nudge
- }
- })();
- }
- }, [accessToken, token, nudgesDisabled]);
-
- // Auto-dismiss survey prompt after 15 seconds
- useEffect(() => {
- if (showSurveyPrompt && !showSurveyModal) {
- const timer = setTimeout(() => {
- setShowSurveyPrompt(false);
- }, 15000);
- return () => clearTimeout(timer);
- }
- }, [showSurveyPrompt, showSurveyModal]);
-
- // Auto-dismiss Claude Code prompt after 15 seconds
- useEffect(() => {
- if (showClaudeCodePrompt && !showClaudeCodeModal) {
- const timer = setTimeout(() => {
- setShowClaudeCodePrompt(false);
- }, 15000);
- return () => clearTimeout(timer);
- }
- }, [showClaudeCodePrompt, showClaudeCodeModal]);
-
- const handleOpenSurvey = () => {
- setShowSurveyPrompt(false);
- setShowSurveyModal(true);
- };
-
- const handleDismissSurveyPrompt = () => {
- setShowSurveyPrompt(false);
- };
-
- const handleSurveyComplete = () => {
- setShowSurveyModal(false);
- };
-
- const handleSurveyModalClose = () => {
- // If they close the modal without completing, show the prompt again
- setShowSurveyModal(false);
- setShowSurveyPrompt(true);
- };
-
- const handleOpenClaudeCode = () => {
- setShowClaudeCodePrompt(false);
- setShowClaudeCodeModal(true);
- };
-
- const handleDismissClaudeCodePrompt = () => {
- setShowClaudeCodePrompt(false);
- };
-
- const handleClaudeCodeComplete = () => {
- setShowClaudeCodeModal(false);
- };
-
- const handleClaudeCodeModalClose = () => {
- // If they close the modal without completing, show the prompt again
- setShowClaudeCodeModal(false);
- setShowClaudeCodePrompt(true);
- };
-
if (authLoading || redirectToLogin || isLegacyRedirect) {
return <LoadingScreen />;
}
@@ -285,45 +187,23 @@ function CreateKeyPageContent() {
createClicked={createClicked}
/>
) : (
- <>
- <UserDashboard
- userID={userID}
- userRole={userRole}
- premiumUser={premiumUser}
- teams={teams}
- keys={keys}
- setUserRole={setUserRole}
- userEmail={userEmail}
- setUserEmail={setUserEmail}
- setTeams={setTeams}
- setKeys={setKeys}
- organizations={organizations}
- addKey={addKey}
- createClicked={createClicked}
- autoOpenCreate={autoOpenCreate}
- prefillData={prefillData}
- />
-
- {/* Survey Components */}
- <SurveyPrompt
- isVisible={showSurveyPrompt && !nudgesDisabled}
- onOpen={handleOpenSurvey}
- onDismiss={handleDismissSurveyPrompt}
- />
- <SurveyModal isOpen={showSurveyModal} onClose={handleSurveyModalClose} onComplete={handleSurveyComplete} />
-
- {/* Claude Code Components */}
- <ClaudeCodePrompt
- isVisible={showClaudeCodePrompt && !nudgesDisabled}
- onOpen={handleOpenClaudeCode}
- onDismiss={handleDismissClaudeCodePrompt}
- />
- <ClaudeCodeModal
- isOpen={showClaudeCodeModal}
- onClose={handleClaudeCodeModalClose}
- onComplete={handleClaudeCodeComplete}
- />
- </>
+ <UserDashboard
+ userID={userID}
+ userRole={userRole}
+ premiumUser={premiumUser}
+ teams={teams}
+ keys={keys}
+ setUserRole={setUserRole}
+ userEmail={userEmail}
+ setUserEmail={setUserEmail}
+ setTeams={setTeams}
+ setKeys={setKeys}
+ organizations={organizations}
+ addKey={addKey}
+ createClicked={createClicked}
+ autoOpenCreate={autoOpenCreate}
+ prefillData={prefillData}
+ />
)}
</>
);
diff --git a/ui/litellm-dashboard/src/components/Settings/AdminSettings/UISettings/UISettings.tsx b/ui/litellm-dashboard/src/components/Settings/AdminSettings/UISettings/UISettings.tsx
index 25865c48f9b..9ce0d908838 100644
--- a/ui/litellm-dashboard/src/components/Settings/AdminSettings/UISettings/UISettings.tsx
+++ b/ui/litellm-dashboard/src/components/Settings/AdminSettings/UISettings/UISettings.tsx
@@ -26,7 +26,6 @@ export default function UISettings() {
const allowVectorStoresTeamAdminsProperty = schema?.properties?.allow_vector_stores_for_team_admins;
const scopeUserSearchProperty = schema?.properties?.scope_user_search_to_org;
const disableCustomApiKeysProperty = schema?.properties?.disable_custom_api_keys;
- const disableUINudgesProperty = schema?.properties?.disable_ui_nudges;
const values = data?.values ?? {};
const isDisabledForInternalUsers = Boolean(values.disable_model_add_for_internal_users);
const isDisabledTeamAdminDeleteTeamUser = Boolean(values.disable_team_admin_delete_team_user);
@@ -61,20 +60,6 @@ export default function UISettings() {
);
};
- const handleToggleDisableUINudges = (checked: boolean) => {
- updateSettings(
- { disable_ui_nudges: checked },
- {
- onSuccess: () => {
- NotificationManager.success("UI settings updated successfully");
- },
- onError: (error) => {
- NotificationManager.fromBackend(error);
- },
- },
- );
- };
-
const handleUpdatePageVisibility = (settings: { enabled_ui_pages_internal_users: string[] | null }) => {
updateSettings(settings, {
onSuccess: () => {
@@ -466,26 +451,6 @@ export default function UISettings() {
<Divider />
- {/* Disable in-product UI nudges */}
- <Space align="start" size="middle">
- <Switch
- checked={Boolean(values.disable_ui_nudges)}
- disabled={isUpdating}
- loading={isUpdating}
- onChange={handleToggleDisableUINudges}
- aria-label={disableUINudgesProperty?.description ?? "Disable UI nudges"}
- />
- <Space direction="vertical" size={4}>
- <Typography.Text strong>Disable UI nudges</Typography.Text>
- <Typography.Text type="secondary">
- {disableUINudgesProperty?.description ??
- "If true, suppresses in-product UI nudges (survey and Claude Code feedback popups) for all users."}
- </Typography.Text>
- </Space>
- </Space>
-
- <Divider />
-
{/* Page Visibility for Internal Users */}
<PageVisibilitySettings
enabledPagesInternalUsers={values.enabled_ui_pages_internal_users}
diff --git a/ui/litellm-dashboard/src/components/networking.tsx b/ui/litellm-dashboard/src/components/networking.tsx
index b387a9f9189..3d15aea8fdd 100644
--- a/ui/litellm-dashboard/src/components/networking.tsx
+++ b/ui/litellm-dashboard/src/components/networking.tsx
@@ -18,17 +18,6 @@ export const getCallbackConfigsCall = async (accessToken: string) => {
}
};
-export const getInProductNudgesCall = async (accessToken: string) => {
- /**
- * Get in-product nudges configuration.
- */
- try {
- return await apiClient.get(`/in_product_nudges`, { accessToken });
- } catch (error) {
- console.error("Failed to get in-product nudges:", error);
- throw error;
- }
-};
/**
* Helper file for calls being made to proxy
*/
diff --git a/ui/litellm-dashboard/src/components/survey/ClaudeCodeModal.test.tsx b/ui/litellm-dashboard/src/components/survey/ClaudeCodeModal.test.tsx
deleted file mode 100644
index e1c3c80d1af..00000000000
--- a/ui/litellm-dashboard/src/components/survey/ClaudeCodeModal.test.tsx
+++ /dev/null
@@ -1,52 +0,0 @@
-import { screen } from "@testing-library/react";
-import userEvent from "@testing-library/user-event";
-import { afterEach, describe, expect, it, vi } from "vitest";
-import { renderWithProviders } from "../../../tests/test-utils";
-import { ClaudeCodeModal } from "./ClaudeCodeModal";
-
-describe("ClaudeCodeModal", () => {
- afterEach(() => {
- vi.restoreAllMocks();
- });
-
- it("should render nothing when isOpen is false", () => {
- renderWithProviders(<ClaudeCodeModal isOpen={false} onClose={vi.fn()} onComplete={vi.fn()} />);
- expect(screen.queryByText(/Help us improve your experience/i)).not.toBeInTheDocument();
- });
-
- it("should render the feedback modal content when isOpen is true", () => {
- renderWithProviders(<ClaudeCodeModal isOpen={true} onClose={vi.fn()} onComplete={vi.fn()} />);
- expect(screen.getByText(/Help us improve your experience/i)).toBeInTheDocument();
- });
-
- it("should show the survey description text", () => {
- renderWithProviders(<ClaudeCodeModal isOpen={true} onClose={vi.fn()} onComplete={vi.fn()} />);
- expect(screen.getByText(/your experience using LiteLLM with Claude Code/i)).toBeInTheDocument();
- });
-
- it("should open the Google Form and call onComplete when the feedback button is clicked", async () => {
- const onComplete = vi.fn();
- const openSpy = vi.spyOn(window, "open").mockImplementation(() => null);
- const user = userEvent.setup();
-
- renderWithProviders(<ClaudeCodeModal isOpen={true} onClose={vi.fn()} onComplete={onComplete} />);
-
- await user.click(screen.getByRole("button", { name: /Open Feedback Form/i }));
-
- expect(openSpy).toHaveBeenCalledWith("https://forms.gle/LZeJQ3XytBakckYa9", "_blank", "noopener,noreferrer");
- expect(onComplete).toHaveBeenCalled();
- });
-
- it("should call onClose when the close button is clicked", async () => {
- const onClose = vi.fn();
- const user = userEvent.setup();
-
- renderWithProviders(<ClaudeCodeModal isOpen={true} onClose={onClose} onComplete={vi.fn()} />);
-
- // The X close button is the first button; the "Open Feedback Form" button is the second
- const buttons = screen.getAllByRole("button");
- await user.click(buttons[0]);
-
- expect(onClose).toHaveBeenCalled();
- });
-});
diff --git a/ui/litellm-dashboard/src/components/survey/ClaudeCodeModal.tsx b/ui/litellm-dashboard/src/components/survey/ClaudeCodeModal.tsx
deleted file mode 100644
index 8e17a2ce986..00000000000
--- a/ui/litellm-dashboard/src/components/survey/ClaudeCodeModal.tsx
+++ /dev/null
@@ -1,65 +0,0 @@
-import React from "react";
-import { X, Code, ExternalLink } from "lucide-react";
-import { Button } from "antd";
-
-interface ClaudeCodeModalProps {
- isOpen: boolean;
- onClose: () => void;
- onComplete: () => void;
-}
-
-const GOOGLE_FORM_URL = "https://forms.gle/LZeJQ3XytBakckYa9";
-
-export function ClaudeCodeModal({ isOpen, onClose, onComplete }: ClaudeCodeModalProps) {
- if (!isOpen) return null;
-
- const handleOpenForm = () => {
- window.open(GOOGLE_FORM_URL, "_blank", "noopener,noreferrer");
- onComplete();
- };
-
- return (
- <div className="fixed inset-0 z-50 flex items-center justify-center p-4 sm:p-6">
- {/* Backdrop */}
- <div className="fixed inset-0 bg-black/40 backdrop-blur-sm" onClick={onClose} />
-
- {/* Modal */}
- <div className="relative w-full max-w-md bg-white rounded-xl shadow-2xl overflow-hidden transform transition-all duration-300 ease-out">
- {/* Header */}
- <div className="px-6 py-4 border-b border-gray-100 flex items-center justify-between bg-gray-50/50">
- <div className="flex items-center gap-2 text-purple-600">
- <Code className="h-5 w-5" />
- <span className="font-semibold text-sm tracking-wide uppercase">Claude Code Feedback</span>
- </div>
- <button
- onClick={onClose}
- className="text-gray-400 hover:text-gray-600 transition-colors p-1 rounded-full hover:bg-gray-100"
- >
- <X className="h-5 w-5" />
- </button>
- </div>
-
- {/* Content */}
- <div className="p-8">
- <h2 className="text-2xl font-bold text-gray-900 mb-4">Help us improve your experience</h2>
- <p className="text-gray-600 mb-6">
- We&apos;d love to hear about your experience using LiteLLM with Claude Code. Your feedback helps us improve
- the product for everyone.
- </p>
- <p className="text-sm text-gray-500 mb-6">This brief survey takes about 2-3 minutes to complete.</p>
-
- <Button
- type="primary"
- size="large"
- block
- onClick={handleOpenForm}
- icon={<ExternalLink className="h-4 w-4" />}
- style={{ backgroundColor: "#7c3aed", borderColor: "#7c3aed" }}
- >
- Open Feedback Form
- </Button>
- </div>
- </div>
- </div>
- );
-}
diff --git a/ui/litellm-dashboard/src/components/survey/ClaudeCodePrompt.test.tsx b/ui/litellm-dashboard/src/components/survey/ClaudeCodePrompt.test.tsx
deleted file mode 100644
index c460781cad6..00000000000
--- a/ui/litellm-dashboard/src/components/survey/ClaudeCodePrompt.test.tsx
+++ /dev/null
@@ -1,72 +0,0 @@
-import { screen } from "@testing-library/react";
-import userEvent from "@testing-library/user-event";
-import { describe, expect, it, vi } from "vitest";
-import { renderWithProviders } from "../../../tests/test-utils";
-import { ClaudeCodePrompt } from "./ClaudeCodePrompt";
-
-vi.mock("./NudgePrompt", () => ({
- NudgePrompt: ({
- title,
- description,
- buttonText,
- onOpen,
- onDismiss,
- isVisible,
- }: {
- title: string;
- description: string;
- buttonText: string;
- onOpen: () => void;
- onDismiss: () => void;
- isVisible: boolean;
- }) => {
- if (!isVisible) return null;
- return (
- <div>
- <span>{title}</span>
- <span>{description}</span>
- <button onClick={onOpen}>{buttonText}</button>
- <button onClick={onDismiss}>Dismiss</button>
- </div>
- );
- },
-}));
-
-describe("ClaudeCodePrompt", () => {
- it("should render with the Claude Code Feedback title when visible", () => {
- renderWithProviders(<ClaudeCodePrompt isVisible={true} onOpen={vi.fn()} onDismiss={vi.fn()} />);
- expect(screen.getByText("Claude Code Feedback")).toBeInTheDocument();
- });
-
- it("should render the correct description text", () => {
- renderWithProviders(<ClaudeCodePrompt isVisible={true} onOpen={vi.fn()} onDismiss={vi.fn()} />);
- expect(screen.getByText(/Help us improve your Claude Code experience/i)).toBeInTheDocument();
- });
-
- it("should call onOpen when the share feedback button is clicked", async () => {
- const onOpen = vi.fn();
- const user = userEvent.setup();
-
- renderWithProviders(<ClaudeCodePrompt isVisible={true} onOpen={onOpen} onDismiss={vi.fn()} />);
-
- await user.click(screen.getByRole("button", { name: /Share feedback/i }));
-
- expect(onOpen).toHaveBeenCalled();
- });
-
- it("should call onDismiss when the dismiss button is clicked", async () => {
- const onDismiss = vi.fn();
- const user = userEvent.setup();
-
- renderWithProviders(<ClaudeCodePrompt isVisible={true} onOpen={vi.fn()} onDismiss={onDismiss} />);
-
- await user.click(screen.getByRole("button", { name: /Dismiss/i }));
-
- expect(onDismiss).toHaveBeenCalled();
- });
-
- it("should not render when isVisible is false", () => {
- renderWithProviders(<ClaudeCodePrompt isVisible={false} onOpen={vi.fn()} onDismiss={vi.fn()} />);
- expect(screen.queryByText("Claude Code Feedback")).not.toBeInTheDocument();
- });
-});
diff --git a/ui/litellm-dashboard/src/components/survey/ClaudeCodePrompt.tsx b/ui/litellm-dashboard/src/components/survey/ClaudeCodePrompt.tsx
deleted file mode 100644
index 2f97c164976..00000000000
--- a/ui/litellm-dashboard/src/components/survey/ClaudeCodePrompt.tsx
+++ /dev/null
@@ -1,25 +0,0 @@
-import React from "react";
-import { Code } from "lucide-react";
-import { NudgePrompt } from "./NudgePrompt";
-
-interface ClaudeCodePromptProps {
- onOpen: () => void;
- onDismiss: () => void;
- isVisible: boolean;
-}
-
-export function ClaudeCodePrompt({ onOpen, onDismiss, isVisible }: ClaudeCodePromptProps) {
- return (
- <NudgePrompt
- onOpen={onOpen}
- onDismiss={onDismiss}
- isVisible={isVisible}
- title="Claude Code Feedback"
- description="Help us improve your Claude Code experience with LiteLLM! Share your feedback in 4 quick questions."
- buttonText="Share feedback"
- icon={Code}
- accentColor="#7c3aed"
- buttonStyle={{ backgroundColor: "#7c3aed", borderColor: "#7c3aed" }}
- />
- );
-}
diff --git a/ui/litellm-dashboard/src/components/survey/NudgePrompt.test.tsx b/ui/litellm-dashboard/src/components/survey/NudgePrompt.test.tsx
deleted file mode 100644
index 26db8a680c5..00000000000
--- a/ui/litellm-dashboard/src/components/survey/NudgePrompt.test.tsx
+++ /dev/null
@@ -1,101 +0,0 @@
-import { render, screen } from "@testing-library/react";
-import { MessageSquare } from "lucide-react";
-import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
-import { NudgePrompt } from "./NudgePrompt";
-
-vi.mock("@/app/(dashboard)/hooks/useDisableShowPrompts", () => ({
- useDisableShowPrompts: vi.fn(),
-}));
-
-vi.mock("@/utils/localStorageUtils", () => ({
- setLocalStorageItem: vi.fn(),
- emitLocalStorageChange: vi.fn(),
- LOCAL_STORAGE_EVENT: "local-storage-change",
-}));
-
-import { useDisableShowPrompts } from "@/app/(dashboard)/hooks/useDisableShowPrompts";
-import { emitLocalStorageChange, setLocalStorageItem } from "@/utils/localStorageUtils";
-
-const mockUseDisableShowPrompts = vi.mocked(useDisableShowPrompts);
-const mockSetLocalStorageItem = vi.mocked(setLocalStorageItem);
-const mockEmitLocalStorageChange = vi.mocked(emitLocalStorageChange);
-
-const defaultProps = {
- onOpen: vi.fn(),
- onDismiss: vi.fn(),
- isVisible: true,
- title: "Test Title",
- description: "Test Description",
- buttonText: "Open Modal",
- icon: MessageSquare,
- accentColor: "#3b82f6",
-};
-
-describe("NudgePrompt", () => {
- beforeEach(() => {
- vi.clearAllMocks();
- mockUseDisableShowPrompts.mockReturnValue(false);
- vi.useFakeTimers();
- });
-
- afterEach(() => {
- vi.useRealTimers();
- });
-
- it("should render", () => {
- render(<NudgePrompt {...defaultProps} />);
-
- expect(screen.getByText("Test Title")).toBeInTheDocument();
- });
-
- it("should render with all provided props", () => {
- const { container } = render(<NudgePrompt {...defaultProps} />);
-
- expect(screen.getByText("Test Title")).toBeInTheDocument();
- expect(screen.getByText("Test Description")).toBeInTheDocument();
- expect(screen.getByRole("button", { name: "Open Modal" })).toBeInTheDocument();
- expect(container.querySelector("svg")).toBeInTheDocument();
- });
-
- it("should not render when isVisible is false", () => {
- render(<NudgePrompt {...defaultProps} isVisible={false} />);
-
- expect(screen.queryByText("Test Title")).not.toBeInTheDocument();
- });
-
- it("should not render when disableShowPrompts is true", () => {
- mockUseDisableShowPrompts.mockReturnValue(true);
-
- render(<NudgePrompt {...defaultProps} />);
-
- expect(screen.queryByText("Test Title")).not.toBeInTheDocument();
- });
-
- it("should display progress bar with correct accent color", () => {
- const { container } = render(<NudgePrompt {...defaultProps} accentColor="#ff0000" />);
-
- const progressBar = container.querySelector("div[style*='width']");
- expect(progressBar).toHaveStyle({ backgroundColor: "#ff0000" });
- });
-
- it("should reset progress when isVisible becomes false", () => {
- const { rerender, container } = render(<NudgePrompt {...defaultProps} />);
-
- vi.advanceTimersByTime(5000);
-
- rerender(<NudgePrompt {...defaultProps} isVisible={false} />);
-
- rerender(<NudgePrompt {...defaultProps} isVisible={true} />);
-
- const progressBar = container.querySelector("div[style*='width']");
- expect(progressBar?.getAttribute("style")).toContain("width: 100%");
- });
-
- it("should apply custom button style when provided", () => {
- const buttonStyle = { backgroundColor: "#custom-color" };
- render(<NudgePrompt {...defaultProps} buttonStyle={buttonStyle} />);
-
- const openButton = screen.getByRole("button", { name: "Open Modal" });
- expect(openButton).toHaveStyle(buttonStyle);
- });
-});
diff --git a/ui/litellm-dashboard/src/components/survey/NudgePrompt.tsx b/ui/litellm-dashboard/src/components/survey/NudgePrompt.tsx
deleted file mode 100644
index 73cabc7e072..00000000000
--- a/ui/litellm-dashboard/src/components/survey/NudgePrompt.tsx
+++ /dev/null
@@ -1,143 +0,0 @@
-import React, { useEffect, useState } from "react";
-import { X, LucideIcon, Check } from "lucide-react";
-import { Button } from "antd";
-import { useDisableShowPrompts } from "@/app/(dashboard)/hooks/useDisableShowPrompts";
-import { setLocalStorageItem, emitLocalStorageChange } from "@/utils/localStorageUtils";
-
-interface NudgePromptProps {
- onOpen: () => void;
- onDismiss: () => void;
- isVisible: boolean;
- title: string;
- description: string;
- buttonText: string;
- icon: LucideIcon;
- accentColor: string;
- buttonStyle?: React.CSSProperties;
-}
-
-const DISMISS_DURATION = 15000; // 15 seconds
-const CONFIRMATION_DURATION = 5000; // 5 seconds
-
-export function NudgePrompt({
- onOpen,
- onDismiss,
- isVisible,
- title,
- description,
- buttonText,
- icon: Icon,
- accentColor,
- buttonStyle,
-}: NudgePromptProps) {
- const disableShowPrompts = useDisableShowPrompts();
- const [progress, setProgress] = useState(100);
- const [showConfirmation, setShowConfirmation] = useState(false);
-
- useEffect(() => {
- if (!isVisible) {
- setProgress(100);
- setShowConfirmation(false);
- return;
- }
-
- const startTime = Date.now();
- const interval = setInterval(() => {
- const elapsed = Date.now() - startTime;
- const remaining = Math.max(0, 100 - (elapsed / DISMISS_DURATION) * 100);
- setProgress(remaining);
-
- if (remaining <= 0) {
- clearInterval(interval);
- }
- }, 50);
-
- return () => clearInterval(interval);
- }, [isVisible]);
-
- useEffect(() => {
- if (showConfirmation) {
- const timer = setTimeout(() => {
- setShowConfirmation(false);
- onDismiss();
- }, CONFIRMATION_DURATION);
-
- return () => clearTimeout(timer);
- }
- }, [showConfirmation, onDismiss]);
-
- const handleDontAskAgain = () => {
- setLocalStorageItem("disableShowPrompts", "true");
- emitLocalStorageChange("disableShowPrompts");
- setShowConfirmation(true);
- };
-
- // Show confirmation even if disableShowPrompts is true (since we just set it)
- if (showConfirmation) {
- return (
- <div
- className={`fixed bottom-6 right-6 z-40 w-80 bg-white rounded-lg shadow-xl border border-gray-200 overflow-hidden transform transition-all duration-300 ease-out ${
- isVisible ? "translate-y-0 opacity-100 scale-100" : "translate-y-4 opacity-0 scale-95"
- }`}
- >
- <div className="p-4">
- <div className="flex items-center gap-3">
- <div className="flex-shrink-0 w-8 h-8 rounded-full bg-green-100 flex items-center justify-center">
- <Check className="h-5 w-5 text-green-600" />
- </div>
- <div className="flex-1">
- <p className="text-sm text-gray-700 font-medium">
- Got it, we will not ask again. Reactivate this at any time in the User Menu.
- </p>
- </div>
- </div>
- </div>
- </div>
- );
- }
-
- // Don't show the prompt if disabled (unless we're showing confirmation)
- if (!isVisible || disableShowPrompts) return null;
-
- return (
- <div
- className={`fixed bottom-6 right-6 z-40 w-80 bg-white rounded-lg shadow-xl border border-gray-200 overflow-hidden transform transition-all duration-300 ease-out ${
- isVisible ? "translate-y-0 opacity-100 scale-100" : "translate-y-4 opacity-0 scale-95"
- }`}
- >
- {/* Progress bar at top showing time remaining */}
- <div className="h-1 bg-gray-100 w-full">
- <div
- className="h-full transition-all duration-100 ease-linear"
- style={{ width: `${progress}%`, backgroundColor: accentColor }}
- />
- </div>
-
- <div className="p-4">
- <div className="flex items-start justify-between mb-2">
- <div className="flex items-center gap-2" style={{ color: accentColor }}>
- <Icon className="h-5 w-5" />
- <span className="font-semibold text-sm">{title}</span>
- </div>
- <button
- onClick={onDismiss}
- className="text-gray-400 hover:text-gray-600 transition-colors p-0.5 rounded hover:bg-gray-100"
- >
- <X className="h-4 w-4" />
- </button>
- </div>
-
- <p className="text-sm text-gray-600 mb-3">{description}</p>
-
- <div className="space-y-2">
- <Button type="primary" block onClick={onOpen} style={buttonStyle}>
- {buttonText}
- </Button>
- <Button variant="outlined" danger block onClick={handleDontAskAgain} className="text-xs">
- Don&apos;t ask me again
- </Button>
- </div>
- </div>
- </div>
- );
-}
diff --git a/ui/litellm-dashboard/src/components/survey/SurveyModal.test.tsx b/ui/litellm-dashboard/src/components/survey/SurveyModal.test.tsx
deleted file mode 100644
index a0ad43a9cd9..00000000000
--- a/ui/litellm-dashboard/src/components/survey/SurveyModal.test.tsx
+++ /dev/null
@@ -1,160 +0,0 @@
-import { screen, waitFor } from "@testing-library/react";
-import userEvent from "@testing-library/user-event";
-import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
-import { renderWithProviders } from "../../../tests/test-utils";
-import { SurveyModal } from "./SurveyModal";
-
-describe("SurveyModal", () => {
- beforeEach(() => {
- vi.spyOn(global, "fetch").mockResolvedValue(new Response());
- });
-
- afterEach(() => {
- vi.restoreAllMocks();
- });
-
- it("should render nothing when isOpen is false", () => {
- renderWithProviders(<SurveyModal isOpen={false} onClose={vi.fn()} onComplete={vi.fn()} />);
- expect(screen.queryByText(/Are you using LiteLLM at your company\?/i)).not.toBeInTheDocument();
- });
-
- it("should render step 1 when the modal is opened", () => {
- renderWithProviders(<SurveyModal isOpen={true} onClose={vi.fn()} onComplete={vi.fn()} />);
- expect(screen.getByText(/Are you using LiteLLM at your company\?/i)).toBeInTheDocument();
- });
-
- it("should disable the Next button until a step 1 choice is made", () => {
- renderWithProviders(<SurveyModal isOpen={true} onClose={vi.fn()} onComplete={vi.fn()} />);
- expect(screen.getByRole("button", { name: /Next/i })).toBeDisabled();
- });
-
- it("should enable the Next button after selecting Yes", async () => {
- const user = userEvent.setup();
- renderWithProviders(<SurveyModal isOpen={true} onClose={vi.fn()} onComplete={vi.fn()} />);
-
- await user.click(screen.getByRole("button", { name: /We use it for work/i }));
-
- expect(screen.getByRole("button", { name: /Next/i })).not.toBeDisabled();
- });
-
- it("should navigate to the company name step when Yes is selected and Next is clicked", async () => {
- const user = userEvent.setup();
- renderWithProviders(<SurveyModal isOpen={true} onClose={vi.fn()} onComplete={vi.fn()} />);
-
- await user.click(screen.getByRole("button", { name: /We use it for work/i }));
- await user.click(screen.getByRole("button", { name: /Next/i }));
-
- expect(screen.getByText(/What company are you using LiteLLM at\?/i)).toBeInTheDocument();
- });
-
- it("should skip the company name step when No is selected and go straight to step 3", async () => {
- const user = userEvent.setup();
- renderWithProviders(<SurveyModal isOpen={true} onClose={vi.fn()} onComplete={vi.fn()} />);
-
- await user.click(screen.getByRole("button", { name: /Personal project/i }));
- await user.click(screen.getByRole("button", { name: /Next/i }));
-
- expect(screen.getByText(/When did you start using LiteLLM\?/i)).toBeInTheDocument();
- });
-
- it("should show 5 total steps when using at a company", async () => {
- const user = userEvent.setup();
- renderWithProviders(<SurveyModal isOpen={true} onClose={vi.fn()} onComplete={vi.fn()} />);
-
- await user.click(screen.getByRole("button", { name: /We use it for work/i }));
-
- expect(screen.getByText(/Step 1 of 5/i)).toBeInTheDocument();
- });
-
- it("should show 4 total steps when not using at a company", async () => {
- const user = userEvent.setup();
- renderWithProviders(<SurveyModal isOpen={true} onClose={vi.fn()} onComplete={vi.fn()} />);
-
- await user.click(screen.getByRole("button", { name: /Personal project/i }));
-
- expect(screen.getByText(/Step 1 of 4/i)).toBeInTheDocument();
- });
-
- it("should navigate back to step 1 from step 3 when No was previously selected", async () => {
- const user = userEvent.setup();
- renderWithProviders(<SurveyModal isOpen={true} onClose={vi.fn()} onComplete={vi.fn()} />);
-
- await user.click(screen.getByRole("button", { name: /Personal project/i }));
- await user.click(screen.getByRole("button", { name: /Next/i }));
- await user.click(screen.getByRole("button", { name: /Back/i }));
-
- expect(screen.getByText(/Are you using LiteLLM at your company\?/i)).toBeInTheDocument();
- });
-
- describe("when step 4 (reasons) is reached", () => {
- async function navigateToStep4(user: ReturnType<typeof userEvent.setup>) {
- // No path: step 1 → 3 → 4
- await user.click(screen.getByRole("button", { name: /Personal project/i }));
- await user.click(screen.getByRole("button", { name: /Next/i }));
- await user.click(screen.getByRole("radio", { name: /Less than a month ago/i }));
- await user.click(screen.getByRole("button", { name: /Next/i }));
- }
-
- it("should show a text input when the Other reason is selected", async () => {
- const user = userEvent.setup();
- renderWithProviders(<SurveyModal isOpen={true} onClose={vi.fn()} onComplete={vi.fn()} />);
-
- await navigateToStep4(user);
- await user.click(screen.getByRole("button", { name: /Something else not listed above/i }));
-
- expect(screen.getByPlaceholderText(/Please specify/i)).toBeInTheDocument();
- });
-
- it("should keep the Next button disabled when Other is selected but the text field is empty", async () => {
- const user = userEvent.setup();
- renderWithProviders(<SurveyModal isOpen={true} onClose={vi.fn()} onComplete={vi.fn()} />);
-
- await navigateToStep4(user);
- await user.click(screen.getByRole("button", { name: /Something else not listed above/i }));
-
- expect(screen.getByRole("button", { name: /Next/i })).toBeDisabled();
- });
-
- it("should enable Next when a standard reason is selected", async () => {
- const user = userEvent.setup();
- renderWithProviders(<SurveyModal isOpen={true} onClose={vi.fn()} onComplete={vi.fn()} />);
-
- await navigateToStep4(user);
- await user.click(screen.getByRole("button", { name: /Stars, contributors, forks, community support/i }));
-
- expect(screen.getByRole("button", { name: /Next/i })).not.toBeDisabled();
- });
- });
-
- it("should call onComplete after successfully submitting the form", async () => {
- const onComplete = vi.fn();
- const user = userEvent.setup();
- renderWithProviders(<SurveyModal isOpen={true} onClose={vi.fn()} onComplete={onComplete} />);
-
- // Navigate through the No path: step 1 → 3 → 4 → 5 → submit
- await user.click(screen.getByRole("button", { name: /Personal project/i }));
- await user.click(screen.getByRole("button", { name: /Next/i }));
- await user.click(screen.getByRole("radio", { name: /Less than a month ago/i }));
- await user.click(screen.getByRole("button", { name: /Next/i }));
- await user.click(screen.getByRole("button", { name: /Stars, contributors, forks, community support/i }));
- await user.click(screen.getByRole("button", { name: /Next/i }));
- // Step 5: email is optional
- await user.click(screen.getByRole("button", { name: /Submit/i }));
-
- await waitFor(() => {
- expect(onComplete).toHaveBeenCalled();
- });
- });
-
- it("should call onClose when the close button is clicked", async () => {
- const onClose = vi.fn();
- const user = userEvent.setup();
- renderWithProviders(<SurveyModal isOpen={true} onClose={onClose} onComplete={vi.fn()} />);
-
- // X close button is the first button in the modal header
- const buttons = screen.getAllByRole("button");
- await user.click(buttons[0]);
-
- expect(onClose).toHaveBeenCalled();
- });
-});
diff --git a/ui/litellm-dashboard/src/components/survey/SurveyModal.tsx b/ui/litellm-dashboard/src/components/survey/SurveyModal.tsx
deleted file mode 100644
index b7213626358..00000000000
--- a/ui/litellm-dashboard/src/components/survey/SurveyModal.tsx
+++ /dev/null
@@ -1,391 +0,0 @@
-import React, { useState } from "react";
-import { X, MessageSquare, ArrowRight, ArrowLeft } from "lucide-react";
-import { Button, Input, Radio, Space, Progress, Checkbox } from "antd";
-
-interface SurveyModalProps {
- isOpen: boolean;
- onClose: () => void;
- onComplete: () => void;
-}
-
-const REASONS_OPTIONS = [
- {
- id: "oss_adoption",
- label: "OSS Adoption",
- description: "Stars, contributors, forks, community support",
- },
- {
- id: "ai_integration",
- label: "AI Integration",
- description:
- "LiteLLM had the logging/guardrail integration we needed - Langfuse, OTEL, S3 logging, Azure Content Safety guardrails",
- },
- {
- id: "unified_api",
- label: "Unified API",
- description: "LiteLLM had the best OpenAI-compatible API across providers - OpenAI, Anthropic, Gemini, etc.",
- },
- {
- id: "breadth_of_models",
- label: "Breadth of Models/Providers",
- description:
- "LiteLLM had the provider + endpoint combinations we needed - /ocr endpoint with Mistral OCR, /batches endppint with Bedrock API, etc.",
- },
- {
- id: "other",
- label: "Other",
- description: "Something else not listed above",
- },
-];
-
-type SurveyData = {
- usingAtCompany: boolean | null;
- companyName: string;
- startDate: string;
- reasons: string[];
- otherReason: string;
- email: string;
-};
-
-export function SurveyModal({ isOpen, onClose, onComplete }: SurveyModalProps) {
- const [step, setStep] = useState(1);
- const [data, setData] = useState<SurveyData>({
- usingAtCompany: null,
- companyName: "",
- startDate: "",
- reasons: [],
- otherReason: "",
- email: "",
- });
- const [isSubmitting, setIsSubmitting] = useState(false);
-
- // Steps: 1=company?, 2=company name (conditional), 3=when, 4=why, 5=email
- // If not at company: skip step 2, so total is 4
- // If at company: total is 5
- const totalSteps = data.usingAtCompany === true ? 5 : 4;
-
- if (!isOpen) return null;
-
- const handleNext = () => {
- // Skip company name step if not using at company
- if (step === 1 && data.usingAtCompany === false) {
- setStep(3); // Skip to "when did you start"
- } else if (step < 5) {
- setStep(step + 1);
- } else {
- handleSubmit();
- }
- };
-
- const handleBack = () => {
- if (step === 3 && data.usingAtCompany === false) {
- setStep(1); // Go back to first question if we skipped company name
- } else {
- setStep(step - 1);
- }
- };
-
- const handleSubmit = async () => {
- setIsSubmitting(true);
- try {
- // Map reason IDs to readable labels
- const reasonLabels: Record<string, string> = {
- oss_adoption: "OSS Adoption (stars, contributors, forks)",
- ai_integration: "AI Integration (Langfuse, OTEL, S3, Azure Content Safety)",
- unified_api: "Unified API (OpenAI-compatible)",
- breadth_of_models: "Breadth of Models/Providers (/ocr, /batches, Bedrock, Azure OCR)",
- };
-
- const readableReasons = data.reasons.map((r) => {
- if (r === "other" && data.otherReason) {
- return `Other: ${data.otherReason}`;
- }
- return reasonLabels[r] || r;
- });
-
- // Submit to feedback endpoint (redirects to Google Form)
- const feedbackUrl = "https://feedback.litellm.ai/survey";
-
- const formData = new URLSearchParams({
- "entry.2015264290": data.usingAtCompany ? "Yes" : "No",
- "entry.1876243786": data.companyName || "",
- "entry.1282591459": data.startDate,
- "entry.393456108": readableReasons.join(", "),
- "entry.928142208": data.email || "",
- });
-
- await fetch(feedbackUrl, {
- method: "POST",
- mode: "no-cors",
- body: formData,
- });
- } catch (error) {
- // Silently fail - don't block the user experience
- console.error("Failed to submit survey:", error);
- }
- setIsSubmitting(false);
- onComplete();
- };
-
- const updateData = (key: keyof SurveyData, value: boolean | string | string[] | null) => {
- setData((prev) => ({
- ...prev,
- [key]: value,
- }));
- };
-
- const toggleReason = (reasonId: string) => {
- setData((prev) => ({
- ...prev,
- reasons: prev.reasons.includes(reasonId)
- ? prev.reasons.filter((r) => r !== reasonId)
- : [...prev.reasons, reasonId],
- }));
- };
-
- const isStepValid = () => {
- if (step === 1) return data.usingAtCompany !== null;
- if (step === 2) return data.companyName.trim().length > 0;
- if (step === 3) return data.startDate !== "";
- if (step === 4) {
- // If "other" is selected, require the text field
- if (data.reasons.includes("other")) {
- return data.reasons.length > 0 && data.otherReason.trim().length > 0;
- }
- return data.reasons.length > 0;
- }
- if (step === 5) return true; // Email is optional
- return false;
- };
-
- const getStepNumber = () => {
- if (data.usingAtCompany === false) {
- // When not at company: skip step 2, so steps 3,4,5 become 2,3,4
- if (step === 1) return 1;
- if (step === 3) return 2;
- if (step === 4) return 3;
- if (step === 5) return 4;
- }
- return step;
- };
-
- const renderStepContent = () => {
- // Step 1: Using at company?
- if (step === 1) {
- return (
- <div className="space-y-6">
- <h2 className="text-2xl font-bold text-gray-900">Are you using LiteLLM at your company?</h2>
- <p className="text-gray-500">
- Help us understand how our product is being used in professional environments.
- </p>
- <div className="grid grid-cols-1 sm:grid-cols-2 gap-4 pt-4">
- <button
- onClick={() => updateData("usingAtCompany", true)}
- className={`p-6 rounded-lg border-2 text-left transition-all ${
- data.usingAtCompany === true
- ? "border-blue-600 bg-blue-50 ring-1 ring-blue-600"
- : "border-gray-200 hover:border-blue-300 hover:bg-gray-50"
- }`}
- >
- <span className="block text-lg font-semibold text-gray-900 mb-1">Yes</span>
- <span className="text-sm text-gray-500">We use it for work</span>
- </button>
- <button
- onClick={() => updateData("usingAtCompany", false)}
- className={`p-6 rounded-lg border-2 text-left transition-all ${
- data.usingAtCompany === false
- ? "border-blue-600 bg-blue-50 ring-1 ring-blue-600"
- : "border-gray-200 hover:border-blue-300 hover:bg-gray-50"
- }`}
- >
- <span className="block text-lg font-semibold text-gray-900 mb-1">No</span>
- <span className="text-sm text-gray-500">Personal project / Hobby</span>
- </button>
- </div>
- </div>
- );
- }
-
- // Step 2: Company name (only if using at company)
- if (step === 2 && data.usingAtCompany === true) {
- return (
- <div className="space-y-6">
- <h2 className="text-2xl font-bold text-gray-900">What company are you using LiteLLM at?</h2>
- <p className="text-gray-500">This helps us understand our user base better.</p>
- <Input
- size="large"
- placeholder="Enter your company name"
- value={data.companyName}
- onChange={(e) => updateData("companyName", e.target.value)}
- autoFocus
- />
- </div>
- );
- }
-
- // Step 3: When did you start?
- if (step === 3) {
- return (
- <div className="space-y-6">
- <h2 className="text-2xl font-bold text-gray-900">When did you start using LiteLLM?</h2>
- <Radio.Group
- value={data.startDate}
- onChange={(e) => updateData("startDate", e.target.value)}
- className="w-full"
- >
- <Space direction="vertical" className="w-full">
- {["Less than a month ago", "1-3 months ago", "3-6 months ago", "More than 6 months ago"].map((option) => (
- <label
- key={option}
- className={`flex items-center p-4 rounded-lg border cursor-pointer transition-all w-full ${
- data.startDate === option
- ? "border-blue-600 bg-blue-50 ring-1 ring-blue-600"
- : "border-gray-200 hover:bg-gray-50"
- }`}
- >
- <Radio value={option}>{option}</Radio>
- </label>
- ))}
- </Space>
- </Radio.Group>
- </div>
- );
- }
-
- // Step 4: Why did you pick LiteLLM?
- if (step === 4) {
- return (
- <div className="space-y-6">
- <h2 className="text-2xl font-bold text-gray-900">Why did you pick LiteLLM over other AI Gateways?</h2>
- <p className="text-gray-500">Select all that apply.</p>
- <div className="space-y-3">
- {REASONS_OPTIONS.map((option) => {
- const isSelected = data.reasons.includes(option.id);
- return (
- <div key={option.id}>
- <div
- role="button"
- tabIndex={0}
- onClick={() => toggleReason(option.id)}
- onKeyDown={(e) => {
- if (e.key === "Enter" || e.key === " ") {
- e.preventDefault();
- toggleReason(option.id);
- }
- }}
- className={`flex items-start p-4 rounded-lg border cursor-pointer transition-all ${
- isSelected
- ? "border-blue-600 bg-blue-50 ring-1 ring-blue-600"
- : "border-gray-200 hover:bg-gray-50"
- }`}
- >
- <Checkbox checked={isSelected} className="mt-0.5 pointer-events-none" />
- <div className="ml-3">
- <span className="block font-medium text-gray-900">{option.label}</span>
- <span className="text-sm text-gray-500">{option.description}</span>
- </div>
- </div>
- {/* Show text input if "Other" is selected */}
- {option.id === "other" && isSelected && (
- <Input
- className="mt-2 ml-7"
- placeholder="Please specify..."
- value={data.otherReason}
- onChange={(e) => updateData("otherReason", e.target.value)}
- onClick={(e) => e.stopPropagation()}
- autoFocus
- />
- )}
- </div>
- );
- })}
- </div>
- </div>
- );
- }
-
- // Step 5: Email (optional)
- if (step === 5) {
- return (
- <div className="space-y-6">
- <h2 className="text-2xl font-bold text-gray-900">Want to share more?</h2>
- <p className="text-gray-500">
- Leave your email and we may reach out to learn more about your experience. This is completely optional.
- </p>
- <Input
- size="large"
- type="email"
- placeholder="[email protected] (optional)"
- value={data.email}
- onChange={(e) => updateData("email", e.target.value)}
- autoFocus
- />
- <p className="text-xs text-gray-400">We will only use this to follow up on your feedback. No spam, ever.</p>
- </div>
- );
- }
-
- return null;
- };
-
- const isLastStep = step === 5;
-
- return (
- <div className="fixed inset-0 z-50 flex items-center justify-center p-4 sm:p-6">
- {/* Backdrop */}
- <div className="fixed inset-0 bg-black/40 backdrop-blur-sm" onClick={onClose} />
-
- {/* Modal */}
- <div className="relative w-full max-w-lg bg-white rounded-xl shadow-2xl overflow-hidden flex flex-col max-h-[90vh] transform transition-all duration-300 ease-out">
- {/* Header */}
- <div className="px-6 py-4 border-b border-gray-100 flex items-center justify-between bg-gray-50/50">
- <div className="flex items-center gap-2 text-blue-600">
- <MessageSquare className="h-5 w-5" />
- <span className="font-semibold text-sm tracking-wide uppercase">Quick Feedback</span>
- </div>
- <button
- onClick={onClose}
- className="text-gray-400 hover:text-gray-600 transition-colors p-1 rounded-full hover:bg-gray-100"
- >
- <X className="h-5 w-5" />
- </button>
- </div>
-
- {/* Progress Bar */}
- <Progress
- percent={(getStepNumber() / totalSteps) * 100}
- showInfo={false}
- strokeColor="#2563eb"
- className="m-0"
- />
-
- {/* Content */}
- <div className="p-8 flex-1 overflow-y-auto">{renderStepContent()}</div>
-
- {/* Footer */}
- <div className="px-6 py-4 bg-gray-50 border-t border-gray-200 flex items-center justify-between">
- <div className="text-sm text-gray-500 font-medium">
- Step {getStepNumber()} of {totalSteps}
- </div>
- <div className="flex gap-3">
- {step > 1 && (
- <Button onClick={handleBack} disabled={isSubmitting} icon={<ArrowLeft className="h-4 w-4" />}>
- Back
- </Button>
- )}
- <Button
- type="primary"
- onClick={handleNext}
- disabled={!isStepValid() || isSubmitting}
- loading={isSubmitting}
- className="min-w-[100px]"
- >
- {isLastStep ? "Submit" : "Next"}
- {!isLastStep && <ArrowRight className="ml-2 h-4 w-4" />}
- </Button>
- </div>
- </div>
- </div>
- </div>
- );
-}
diff --git a/ui/litellm-dashboard/src/components/survey/SurveyPrompt.test.tsx b/ui/litellm-dashboard/src/components/survey/SurveyPrompt.test.tsx
deleted file mode 100644
index 257531d5c98..00000000000
--- a/ui/litellm-dashboard/src/components/survey/SurveyPrompt.test.tsx
+++ /dev/null
@@ -1,72 +0,0 @@
-import { screen } from "@testing-library/react";
-import userEvent from "@testing-library/user-event";
-import { describe, expect, it, vi } from "vitest";
-import { renderWithProviders } from "../../../tests/test-utils";
-import { SurveyPrompt } from "./SurveyPrompt";
-
-vi.mock("./NudgePrompt", () => ({
- NudgePrompt: ({
- title,
- description,
- buttonText,
- onOpen,
- onDismiss,
- isVisible,
- }: {
- title: string;
- description: string;
- buttonText: string;
- onOpen: () => void;
- onDismiss: () => void;
- isVisible: boolean;
- }) => {
- if (!isVisible) return null;
- return (
- <div>
- <span>{title}</span>
- <span>{description}</span>
- <button onClick={onOpen}>{buttonText}</button>
- <button onClick={onDismiss}>Dismiss</button>
- </div>
- );
- },
-}));
-
-describe("SurveyPrompt", () => {
- it("should render with the Quick feedback title when visible", () => {
- renderWithProviders(<SurveyPrompt isVisible={true} onOpen={vi.fn()} onDismiss={vi.fn()} />);
- expect(screen.getByText("Quick feedback")).toBeInTheDocument();
- });
-
- it("should render the correct description text", () => {
- renderWithProviders(<SurveyPrompt isVisible={true} onOpen={vi.fn()} onDismiss={vi.fn()} />);
- expect(screen.getByText(/Help us improve LiteLLM/i)).toBeInTheDocument();
- });
-
- it("should call onOpen when the share feedback button is clicked", async () => {
- const onOpen = vi.fn();
- const user = userEvent.setup();
-
- renderWithProviders(<SurveyPrompt isVisible={true} onOpen={onOpen} onDismiss={vi.fn()} />);
-
- await user.click(screen.getByRole("button", { name: /Share feedback/i }));
-
- expect(onOpen).toHaveBeenCalled();
- });
-
- it("should call onDismiss when the dismiss button is clicked", async () => {
- const onDismiss = vi.fn();
- const user = userEvent.setup();
-
- renderWithProviders(<SurveyPrompt isVisible={true} onOpen={vi.fn()} onDismiss={onDismiss} />);
-
- await user.click(screen.getByRole("button", { name: /Dismiss/i }));
-
- expect(onDismiss).toHaveBeenCalled();
- });
-
- it("should not render when isVisible is false", () => {
- renderWithProviders(<SurveyPrompt isVisible={false} onOpen={vi.fn()} onDismiss={vi.fn()} />);
- expect(screen.queryByText("Quick feedback")).not.toBeInTheDocument();
- });
-});
diff --git a/ui/litellm-dashboard/src/components/survey/SurveyPrompt.tsx b/ui/litellm-dashboard/src/components/survey/SurveyPrompt.tsx
deleted file mode 100644
index e55b724a2a8..00000000000
--- a/ui/litellm-dashboard/src/components/survey/SurveyPrompt.tsx
+++ /dev/null
@@ -1,24 +0,0 @@
-import React from "react";
-import { MessageSquare } from "lucide-react";
-import { NudgePrompt } from "./NudgePrompt";
-
-interface SurveyPromptProps {
- onOpen: () => void;
- onDismiss: () => void;
- isVisible: boolean;
-}
-
-export function SurveyPrompt({ onOpen, onDismiss, isVisible }: SurveyPromptProps) {
- return (
- <NudgePrompt
- onOpen={onOpen}
- onDismiss={onDismiss}
- isVisible={isVisible}
- title="Quick feedback"
- description="Help us improve LiteLLM! Share your experience in 5 quick questions."
- buttonText="Share feedback"
- icon={MessageSquare}
- accentColor="#3b82f6"
- />
- );
-}
diff --git a/ui/litellm-dashboard/src/components/survey/index.tsx b/ui/litellm-dashboard/src/components/survey/index.tsx
deleted file mode 100644
index 7a227a027af..00000000000
--- a/ui/litellm-dashboard/src/components/survey/index.tsx
+++ /dev/null
@@ -1,5 +0,0 @@
-export { SurveyPrompt } from "./SurveyPrompt";
-export { SurveyModal } from "./SurveyModal";
-export { ClaudeCodePrompt } from "./ClaudeCodePrompt";
-export { ClaudeCodeModal } from "./ClaudeCodeModal";
-export { NudgePrompt } from "./NudgePrompt";
diff --git a/ui/litellm-dashboard/src/lib/http/schema.d.ts b/ui/litellm-dashboard/src/lib/http/schema.d.ts
index b3dfe24ed70..6f25472db62 100644
--- a/ui/litellm-dashboard/src/lib/http/schema.d.ts
+++ b/ui/litellm-dashboard/src/lib/http/schema.d.ts
@@ -5935,26 +5935,6 @@ export interface paths {
patch?: never;
trace?: never;
};
- "/in_product_nudges": {
- parameters: {
- query?: never;
- header?: never;
- path?: never;
- cookie?: never;
- };
- /**
- * Get In Product Nudges
- * @description Get in-product nudges configuration.
- */
- get: operations["get_in_product_nudges_in_product_nudges_get"];
- put?: never;
- post?: never;
- delete?: never;
- options?: never;
- head?: never;
- patch?: never;
- trace?: never;
- };
"/interactions": {
parameters: {
query?: never;
@@ -23830,15 +23810,6 @@ export interface components {
} & {
[key: string]: unknown;
};
- /** InProductNudgeResponse */
- InProductNudgeResponse: {
- /**
- * Is Claude Code Enabled
- * @description Whether the Claude Code nudge should be shown.
- * @default false
- */
- is_claude_code_enabled: boolean;
- };
/** IndexCreateLiteLLMParams */
IndexCreateLiteLLMParams: {
/** Vector Store Index */
@@ -40763,26 +40734,6 @@ export interface operations {
};
};
};
- get_in_product_nudges_in_product_nudges_get: {
- parameters: {
- query?: never;
- header?: never;
- path?: never;
- cookie?: never;
- };
- requestBody?: never;
- responses: {
- /** @description Successful Response */
- 200: {
- headers: {
- [name: string]: unknown;
- };
- content: {
- "application/json": components["schemas"]["InProductNudgeResponse"];
- };
- };
- };
- };
create_interaction_interactions_post: {
parameters: {
query?: never;