diff --git a/src/Chat/ChatBase.tsx b/src/Chat/ChatBase.tsx index 295a7fa4..f2c1c36a 100644 --- a/src/Chat/ChatBase.tsx +++ b/src/Chat/ChatBase.tsx @@ -39,7 +39,7 @@ import { WebHandler } from "../lib/WebHandler"; import { ChatCraftCommandRegistry } from "../lib/commands"; import ChatHeader from "./ChatHeader"; import { FreeModelProvider } from "../lib/providers/DefaultProvider/FreeModelProvider"; -import PreferencesModal from "../components/PreferencesModal"; +import PreferencesModal from "../components/Preferences/PreferencesModal"; type ChatBaseProps = { chat: ChatCraftChat; diff --git a/src/components/DefaultSystemPromptModal.tsx b/src/components/DefaultSystemPromptModal.tsx deleted file mode 100644 index 9ff87e57..00000000 --- a/src/components/DefaultSystemPromptModal.tsx +++ /dev/null @@ -1,96 +0,0 @@ -import { RefObject, useState } from "react"; -import { - Button, - Flex, - FormControl, - Modal, - ModalOverlay, - ModalContent, - ModalHeader, - ModalFooter, - ModalBody, - ModalCloseButton, - VStack, - Text, - Textarea, -} from "@chakra-ui/react"; -import debounce from "lodash-es/debounce"; - -import { useSettings } from "../hooks/use-settings"; -import { defaultSystemPrompt } from "../lib/system-prompt"; - -type DefaultSystemPromptModalProps = { - isOpen: boolean; - onClose: () => void; - finalFocusRef?: RefObject; -}; - -function DefaultSystemPromptModal({ - isOpen, - onClose, - finalFocusRef, -}: DefaultSystemPromptModalProps) { - const [prompt, setPrompt] = useState(defaultSystemPrompt()); - const { settings, setSettings } = useSettings(); - - // Update the default prompt, but not on every keystroke - const handleSave = debounce((value: string) => { - setSettings({ ...settings, customSystemPrompt: value }); - }, 250); - - // When the prompt changes, update state, and trigger a save for later - const handleUpdate = (value: string) => { - setPrompt(value); - handleSave(value); - }; - - // Reset the default system prompt back to the app's default - const handleReset = () => { - setSettings({ ...settings, customSystemPrompt: undefined }); - setPrompt(defaultSystemPrompt()); - }; - - return ( - - - - Default System Prompt - - - - - The default system prompt is used as the first message in every chat. It provides the - LLM important context, behavioral cues, and expectations about responses and desired - response formats. - - - - NOTE: changes to the default system prompt will take effect in new chats, but - won't affect existing ones. - - - -