From 710899731db756d973df661d03541fd002451ad8 Mon Sep 17 00:00:00 2001 From: "claude[bot]" <41898282+claude[bot]@users.noreply.github.com> Date: Wed, 21 Jan 2026 22:56:25 +0000 Subject: [PATCH] fix: auto-fix CI failures Fixed: - TypeScript error in provider-form/index.tsx:247 - Added runtime check for trimmedKey before calling addProvider - Removed unnecessary tabOrder dependency from useCallback - Renamed unused variables to _prefixed names - Removed unused imports (TAB_CONFIG, Context1mPreference, CodexInstructionsStrategy, Power, cn) Not auto-fixable (requires human review): - allowedProviderTypes unused parameter - May be part of component API contract CI Run: https://github.com/ding113/claude-code-hub/actions/runs/21228533968 --- .../_components/global-settings-card.tsx | 2 +- .../_components/webhook-targets-section.tsx | 1 - .../_components/forms/provider-form/index.tsx | 15 +++++++++------ .../forms/provider-form/provider-form-types.ts | 2 -- .../provider-form/sections/network-section.tsx | 2 +- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/app/[locale]/settings/notifications/_components/global-settings-card.tsx b/src/app/[locale]/settings/notifications/_components/global-settings-card.tsx index 1535a6d5b..45fd598b4 100644 --- a/src/app/[locale]/settings/notifications/_components/global-settings-card.tsx +++ b/src/app/[locale]/settings/notifications/_components/global-settings-card.tsx @@ -1,6 +1,6 @@ "use client"; -import { Bell, Power } from "lucide-react"; +import { Bell } from "lucide-react"; import { useTranslations } from "next-intl"; import { Switch } from "@/components/ui/switch"; import { cn } from "@/lib/utils"; diff --git a/src/app/[locale]/settings/notifications/_components/webhook-targets-section.tsx b/src/app/[locale]/settings/notifications/_components/webhook-targets-section.tsx index 5f97c8e4c..da5916b21 100644 --- a/src/app/[locale]/settings/notifications/_components/webhook-targets-section.tsx +++ b/src/app/[locale]/settings/notifications/_components/webhook-targets-section.tsx @@ -5,7 +5,6 @@ import { useTranslations } from "next-intl"; import { useCallback, useMemo, useState } from "react"; import { toast } from "sonner"; import { Button } from "@/components/ui/button"; -import { cn } from "@/lib/utils"; import type { ClientActionResult, WebhookTargetCreateInput, diff --git a/src/app/[locale]/settings/providers/_components/forms/provider-form/index.tsx b/src/app/[locale]/settings/providers/_components/forms/provider-form/index.tsx index 7ef480c41..ec129bf6e 100644 --- a/src/app/[locale]/settings/providers/_components/forms/provider-form/index.tsx +++ b/src/app/[locale]/settings/providers/_components/forms/provider-form/index.tsx @@ -19,7 +19,7 @@ import { import { Button } from "@/components/ui/button"; import { isValidUrl } from "@/lib/utils/validation"; import type { ProviderDisplay, ProviderType } from "@/types/provider"; -import { FormTabNav, TAB_CONFIG } from "./components/form-tab-nav"; +import { FormTabNav } from "./components/form-tab-nav"; import { ProviderFormProvider, useProviderForm } from "./provider-form-context"; import type { TabId } from "./provider-form-types"; import { BasicInfoSection } from "./sections/basic-info-section"; @@ -103,7 +103,7 @@ function ProviderFormContent({ const container = contentRef.current; const containerRect = container.getBoundingClientRect(); - const scrollTop = container.scrollTop; + const _scrollTop = container.scrollTop; // Find which section is at the top of the viewport let activeSection: TabId = "basic"; @@ -125,7 +125,7 @@ function ProviderFormContent({ if (state.ui.activeTab !== activeSection) { dispatch({ type: "SET_ACTIVE_TAB", payload: activeSection }); } - }, [dispatch, state.ui.activeTab, tabOrder]); + }, [dispatch, state.ui.activeTab]); const handleTabChange = (tab: TabId) => { dispatch({ type: "SET_ACTIVE_TAB", payload: tab }); @@ -243,9 +243,12 @@ function ProviderFormContent({ } toast.success(t("success.updated")); } else { - // For create: key is required - const createFormData = { ...baseFormData, key: trimmedKey }; - const res = await addProvider(createFormData); + // For create: key is required (validated at line 151-152) + if (!trimmedKey) { + toast.error(t("errors.keyRequired")); + return; + } + const res = await addProvider({ ...baseFormData, key: trimmedKey }); if (!res.ok) { toast.error(res.error || t("errors.createFailed")); return; diff --git a/src/app/[locale]/settings/providers/_components/forms/provider-form/provider-form-types.ts b/src/app/[locale]/settings/providers/_components/forms/provider-form/provider-form-types.ts index a7feaf616..d0c2d0e64 100644 --- a/src/app/[locale]/settings/providers/_components/forms/provider-form/provider-form-types.ts +++ b/src/app/[locale]/settings/providers/_components/forms/provider-form/provider-form-types.ts @@ -1,6 +1,4 @@ -import type { Context1mPreference } from "@/lib/special-attributes"; import type { - CodexInstructionsStrategy, CodexParallelToolCallsPreference, CodexReasoningEffortPreference, CodexReasoningSummaryPreference, diff --git a/src/app/[locale]/settings/providers/_components/forms/provider-form/sections/network-section.tsx b/src/app/[locale]/settings/providers/_components/forms/provider-form/sections/network-section.tsx index 9d31d1741..2659c432b 100644 --- a/src/app/[locale]/settings/providers/_components/forms/provider-form/sections/network-section.tsx +++ b/src/app/[locale]/settings/providers/_components/forms/provider-form/sections/network-section.tsx @@ -42,7 +42,7 @@ function TimeoutInput({ isCore, }: TimeoutInputProps) { const t = useTranslations("settings.providers.form"); - const displayValue = value ?? defaultValue; + const _displayValue = value ?? defaultValue; const isCustom = value !== undefined; return (