diff --git a/apps/desktop/src/components/main/body/ai.tsx b/apps/desktop/src/components/main/body/ai.tsx index f1602d0c5..8c5c285b6 100644 --- a/apps/desktop/src/components/main/body/ai.tsx +++ b/apps/desktop/src/components/main/body/ai.tsx @@ -34,7 +34,7 @@ export const TabItemAI: TabItem> = ({ icon={} title={
- AI + AI Settings ({suffix})
} diff --git a/apps/desktop/src/components/main/body/settings.tsx b/apps/desktop/src/components/main/body/settings.tsx index 4001b7bb2..222f1d951 100644 --- a/apps/desktop/src/components/main/body/settings.tsx +++ b/apps/desktop/src/components/main/body/settings.tsx @@ -16,7 +16,7 @@ export const TabItemSettings: TabItem> = ({ return ( } - title={"Settings"} + title={"App Settings"} selected={tab.active} tabIndex={tabIndex} handleCloseThis={() => handleCloseThis(tab)} diff --git a/apps/desktop/src/components/main/sidebar/profile/index.tsx b/apps/desktop/src/components/main/sidebar/profile/index.tsx index fd41903b7..fd52bed66 100644 --- a/apps/desktop/src/components/main/sidebar/profile/index.tsx +++ b/apps/desktop/src/components/main/sidebar/profile/index.tsx @@ -174,7 +174,7 @@ export function ProfileSection({ onExpandChange }: ProfileSectionProps = {}) { }, { icon: SparklesIcon, - label: "AI", + label: "AI Settings", onClick: handleClickAI, badge: ( @@ -185,7 +185,7 @@ export function ProfileSection({ onExpandChange }: ProfileSectionProps = {}) { }, { icon: SettingsIcon, - label: "Settings", + label: "App Settings", onClick: handleClickSettings, badge: ( diff --git a/apps/desktop/src/components/settings/general/account.tsx b/apps/desktop/src/components/settings/general/account.tsx index d8f681b43..b3ccc89ec 100644 --- a/apps/desktop/src/components/settings/general/account.tsx +++ b/apps/desktop/src/components/settings/general/account.tsx @@ -6,11 +6,21 @@ import { type ReactNode, useCallback, useEffect, useState } from "react"; import { getRpcCanStartTrial, postBillingStartTrial } from "@hypr/api-client"; import { createClient } from "@hypr/api-client/client"; import { Button } from "@hypr/ui/components/ui/button"; +import { + Dialog, + DialogContent, + DialogDescription, + DialogFooter, + DialogHeader, + DialogTitle, +} from "@hypr/ui/components/ui/dialog"; import { Input } from "@hypr/ui/components/ui/input"; import { useAuth } from "../../../auth"; import { useBillingAccess } from "../../../billing"; import { env } from "../../../env"; +import * as settings from "../../../store/tinybase/settings"; +import { useTabs } from "../../../store/zustand/tabs"; const WEB_APP_BASE_URL = env.VITE_APP_URL ?? "http://localhost:3000"; @@ -161,6 +171,40 @@ export function AccountSettings() { function BillingButton() { const auth = useAuth(); const { isPro } = useBillingAccess(); + const openNew = useTabs((state) => state.openNew); + const [showTrialStartedDialog, setShowTrialStartedDialog] = useState(false); + + const setLlmProvider = settings.UI.useSetValueCallback( + "current_llm_provider", + () => "hyprnote", + [], + settings.STORE_ID, + ); + const setLlmModel = settings.UI.useSetValueCallback( + "current_llm_model", + () => "Auto", + [], + settings.STORE_ID, + ); + const setSttProvider = settings.UI.useSetValueCallback( + "current_stt_provider", + () => "hyprnote", + [], + settings.STORE_ID, + ); + const setSttModel = settings.UI.useSetValueCallback( + "current_stt_model", + () => "cloud", + [], + settings.STORE_ID, + ); + + const setTrialDefaults = useCallback(() => { + setLlmProvider(); + setLlmModel(); + setSttProvider(); + setSttModel(); + }, [setLlmProvider, setLlmModel, setSttProvider, setSttModel]); const canTrialQuery = useQuery({ enabled: !!auth?.session && !isPro, @@ -199,6 +243,8 @@ function BillingButton() { }, onSuccess: async () => { await auth?.refreshSession(); + setTrialDefaults(); + setShowTrialStartedDialog(true); }, }); @@ -210,6 +256,15 @@ function BillingButton() { void openUrl(`${WEB_APP_BASE_URL}/app/account`); }, []); + const handleGoToAISettings = useCallback(() => { + setShowTrialStartedDialog(false); + openNew({ type: "ai", state: { tab: "transcription" } }); + }, [openNew]); + + const handleConfirm = useCallback(() => { + setShowTrialStartedDialog(false); + }, []); + if (isPro) { return ( + <> + + + + + + Pro Trial Started + + Your Pro trial has started. We've automatically configured your + AI settings to use Hyprnote Cloud for both transcription and + intelligence features. + + + + + + + + + ); }