diff --git a/apps/client/src/features/workspace/components/settings/components/ai-provider-settings.tsx b/apps/client/src/features/workspace/components/settings/components/ai-provider-settings.tsx index 78727bda..360dc6db 100644 --- a/apps/client/src/features/workspace/components/settings/components/ai-provider-settings.tsx +++ b/apps/client/src/features/workspace/components/settings/components/ai-provider-settings.tsx @@ -1,7 +1,7 @@ import { useEffect, useState } from "react"; import { z } from "zod/v4"; import { - Anchor, + ActionIcon, Badge, Box, Button, @@ -15,12 +15,13 @@ import { Text, Textarea, TextInput, + Tooltip, useMantineTheme, } from "@mantine/core"; import { useForm } from "@mantine/form"; import { useDisclosure } from "@mantine/hooks"; import { zod4Resolver } from "mantine-form-zod-resolver"; -import { IconPencil } from "@tabler/icons-react"; +import { IconPencil, IconX } from "@tabler/icons-react"; import { useAtom } from "jotai"; import { notifications } from "@mantine/notifications"; import { useTranslation } from "react-i18next"; @@ -430,19 +431,34 @@ export default function AiProviderSettings() { disabled={isLoading} {...form.getInputProps("chatModel")} /> - - - {hasApiKey && ( - - {t("Clear")} - - )} - + {/* The key field is write-only: the stored key never loads back, so the + built-in visibility toggle reveals nothing. Replace it with a Clear + action in the right section. Passing rightSection suppresses the eye + (Mantine). While typing a new key (buffer non-empty) fall back to + the default eye so the user can verify what they typed. */} + + + + + + ) : undefined + } + rightSectionPointerEvents="all" + {...form.getInputProps("apiKey")} + /> - - - {hasEmbeddingApiKey && ( - - {t("Clear")} - - )} - + {/* The key field is write-only: the stored key never loads back, so the + built-in visibility toggle reveals nothing. Replace it with a Clear + action in the right section. Passing rightSection suppresses the eye + (Mantine). While typing a new key (buffer non-empty) fall back to + the default eye so the user can verify what they typed. */} + + + + + + ) : undefined + } + rightSectionPointerEvents="all" + {...form.getInputProps("embeddingApiKey")} + /> - - - {hasSttApiKey && ( - - {t("Clear")} - - )} - + {/* The key field is write-only: the stored key never loads back, so the + built-in visibility toggle reveals nothing. Replace it with a Clear + action in the right section. Passing rightSection suppresses the eye + (Mantine). While typing a new key (buffer non-empty) fall back to + the default eye so the user can verify what they typed. */} + + + + + + ) : undefined + } + rightSectionPointerEvents="all" + {...form.getInputProps("sttApiKey")} + />