diff --git a/src/components/ChatInputControls.tsx b/src/components/ChatInputControls.tsx new file mode 100644 index 0000000..ce5ba28 --- /dev/null +++ b/src/components/ChatInputControls.tsx @@ -0,0 +1,11 @@ +import { ModelPicker } from "./ModelPicker"; +import { ProModeSelector } from "./ProModeSelector"; + +export function ChatInputControls() { + return ( +
+ + +
+ ); +} diff --git a/src/components/ProModeSelector.tsx b/src/components/ProModeSelector.tsx new file mode 100644 index 0000000..c8dca95 --- /dev/null +++ b/src/components/ProModeSelector.tsx @@ -0,0 +1,82 @@ +import { Button } from "@/components/ui/button"; +import { + Tooltip, + TooltipContent, + TooltipTrigger, +} from "@/components/ui/tooltip"; +import { + Popover, + PopoverContent, + PopoverTrigger, +} from "@/components/ui/popover"; +import { Switch } from "@/components/ui/switch"; +import { Label } from "@/components/ui/label"; +import { Sparkles, Info } from "lucide-react"; +import { useSettings } from "@/hooks/useSettings"; + +export function ProModeSelector() { + const { settings, updateSettings } = useSettings(); + + const toggleSaverMode = () => { + updateSettings({ enableProSaverMode: !settings?.enableProSaverMode }); + }; + if (!settings?.enableDyadPro) { + return null; + } + + return ( + + + + + + + + Configure Dyad Pro settings + + +
+
+

+ + Dyad Pro +

+
+
+
+
+ +
+ + + + + + Note: using the free Gemini API lets Google use your data to + improve their models. + + +

+ Uses your free Gemini API quota before consuming Dyad Pro AI + credits +

+
+
+ +
+
+ + + ); +} diff --git a/src/components/chat/ChatInput.tsx b/src/components/chat/ChatInput.tsx index efe8c78..7ba6809 100644 --- a/src/components/chat/ChatInput.tsx +++ b/src/components/chat/ChatInput.tsx @@ -20,7 +20,7 @@ import { } from "lucide-react"; import type React from "react"; import { useCallback, useEffect, useRef, useState } from "react"; -import { ModelPicker } from "@/components/ModelPicker"; + import { useSettings } from "@/hooks/useSettings"; import { IpcClient } from "@/ipc/ipc_client"; import { @@ -59,6 +59,7 @@ import { useAttachments } from "@/hooks/useAttachments"; import { AttachmentsList } from "./AttachmentsList"; import { DragDropOverlay } from "./DragDropOverlay"; import { showError, showUncommittedFilesWarning } from "@/lib/toast"; +import { ChatInputControls } from "../ChatInputControls"; const showTokenBarAtom = atom(false); export function ChatInput({ chatId }: { chatId?: number }) { @@ -340,9 +341,7 @@ export function ChatInput({ chatId }: { chatId?: number }) { )}
-
- -
+ )}
-
- +
+
diff --git a/src/lib/schemas.ts b/src/lib/schemas.ts index 22c20c3..85ecc99 100644 --- a/src/lib/schemas.ts +++ b/src/lib/schemas.ts @@ -118,6 +118,7 @@ export const UserSettingsSchema = z.object({ experiments: ExperimentsSchema.optional(), lastShownReleaseNotesVersion: z.string().optional(), maxChatTurnsInContext: z.number().optional(), + enableProSaverMode: z.boolean().optional(), // DEPRECATED. runtimeMode: RuntimeModeSchema.optional(), });