Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions apps/desktop/src-tauri/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -240,9 +240,16 @@ pub async fn main() {
let config = app_clone.db_get_config(user_id).await;

if let Ok(Some(ref config)) = config {
if !config.general.telemetry_consent {
if true {
let _ =
sentry_client.close(Some(std::time::Duration::from_secs(1)));
} else {
tauri_plugin_sentry::sentry::configure_scope(|scope| {
scope.set_user(Some(tauri_plugin_sentry::sentry::User {
id: Some(user_id.clone()),
..Default::default()
}));
});
}

{
Expand All @@ -255,13 +262,6 @@ pub async fn main() {
}
}
}

tauri_plugin_sentry::sentry::configure_scope(|scope| {
scope.set_user(Some(tauri_plugin_sentry::sentry::User {
id: Some(user_id.clone()),
..Default::default()
}));
});
}
}
});
Expand Down
2 changes: 1 addition & 1 deletion apps/desktop/src-tauri/tauri.conf.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
},
"resources": {
"dlls/*": "./",
"resources/llm.gguf": "llm.gguf"
"resources/": ""
}
},
"plugins": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
import { Trans } from "@lingui/react/macro";
import { useQuery } from "@tanstack/react-query";
import type { LinkProps } from "@tanstack/react-router";
import { getName, getVersion } from "@tauri-apps/api/app";
import { check } from "@tauri-apps/plugin-updater";
import { CastleIcon, CogIcon, ShieldIcon } from "lucide-react";
import { CogIcon } from "lucide-react";
import { useState } from "react";

import Shortcut from "@/components/shortcut";
import { createUpdateToast } from "@/components/toast/ota";
import { useHypr } from "@/contexts";
import { useLicense } from "@/hooks/use-license";
import { openURL } from "@/utils/shell";
import { commands as windowsCommands } from "@hypr/plugin-windows";
import { Button } from "@hypr/ui/components/ui/button";
Expand All @@ -20,15 +18,11 @@ import {
DropdownMenuTrigger,
} from "@hypr/ui/components/ui/dropdown-menu";
import { toast } from "@hypr/ui/components/ui/toast";
import { cn } from "@hypr/ui/lib/utils";

export function SettingsButton() {
const [open, setOpen] = useState(false);
const { userId } = useHypr();

const { getLicense } = useLicense();
const isPro = !!getLicense.data?.valid;

const versionQuery = useQuery({
queryKey: ["appVersion"],
queryFn: async () => {
Expand All @@ -52,21 +46,6 @@ export function SettingsButton() {
});
};

const handleClickPlans = () => {
setOpen(false);

windowsCommands.windowShow({ type: "settings" }).then(() => {
const params = { to: "/app/settings", search: { tab: "billing" } } as const satisfies LinkProps;

setTimeout(() => {
windowsCommands.windowEmitNavigate({ type: "settings" }, {
path: params.to,
search: params.search,
});
}, 500);
});
};

const handleClickChangelog = async () => {
setOpen(false);
try {
Expand Down Expand Up @@ -124,7 +103,7 @@ export function SettingsButton() {
</DropdownMenuTrigger>

<DropdownMenuContent align="start" className="w-52 p-0">
<DropdownHeader handleClick={handleClickPlans} isPro={isPro} />
{/* <DropdownHeader handleClick={handleClickPlans} isPro={isPro} /> */}

<div className="p-1">
<DropdownMenuItem
Expand Down Expand Up @@ -163,37 +142,3 @@ export function SettingsButton() {
</DropdownMenu>
);
}

function DropdownHeader({
isPro,
handleClick,
}: {
isPro: boolean;
handleClick: () => void;
}) {
return (
<div
onClick={handleClick}
className={cn([
"px-3 py-2 bg-gradient-to-r rounded-t-md relative overflow-hidden cursor-pointer",
isPro
? "from-blue-700 to-blue-800 hover:from-blue-600 hover:to-blue-700"
: "from-gray-800 to-gray-900 hover:from-gray-700 hover:to-gray-800",
])}
>
<div className="absolute inset-0 opacity-70">
</div>
<div className="flex items-center gap-3 text-white relative z-10">
{isPro ? <CastleIcon className="size-8 animate-pulse" /> : <ShieldIcon className="size-8 animate-pulse" />}
<div>
<div className="font-medium">
{isPro ? "Pro Plan" : "Free Plan"}
</div>
<div className="text-xs text-white/80 mt-0.5">
{isPro ? "Full features" : "Basic features"}
</div>
</div>
</div>
</div>
);
}
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
import { LmStudio } from "@lobehub/icons";
import { useQuery, useQueryClient } from "@tanstack/react-query";
import { openPath } from "@tauri-apps/plugin-opener";
import { open } from "@tauri-apps/plugin-shell";
import { CloudIcon, DownloadIcon, FolderIcon } from "lucide-react";
import { DownloadIcon, FolderIcon } from "lucide-react";
import { useEffect } from "react";

import { useLicense } from "@/hooks/use-license";
import { commands as localLlmCommands, type CustomModelInfo, type ModelSelection } from "@hypr/plugin-local-llm";
import { commands as windowsCommands } from "@hypr/plugin-windows";
import { Button } from "@hypr/ui/components/ui/button";
import { cn } from "@hypr/ui/lib/utils";
import { type LLMModel, SharedLLMProps } from "./shared";
Expand All @@ -26,11 +23,8 @@ export function LLMLocalView({
handleModelDownload,
configureCustomEndpoint,
setOpenAccordion,
hyprCloudEnabled,
setHyprCloudEnabledMutation,
}: ExtendedSharedLLMProps) {
const { getLicense } = useLicense();
const isPro = !!getLicense.data?.valid;
const queryClient = useQueryClient();

const currentModelSelection = useQuery({
Expand Down Expand Up @@ -89,99 +83,12 @@ export function LLMLocalView({
localLlmCommands.restartServer();
};

const handleHyprCloudSelection = () => {
setSelectedLLMModel("hyprcloud");
configureCustomEndpoint({
provider: "hyprcloud",
api_base: "https://pro.hyprnote.com",
api_key: "",
model: "",
});
setOpenAccordion(null);
};

const isHyprCloudSelected = hyprCloudEnabled.data;
const buttonResetClass = "appearance-none border-0 outline-0 bg-transparent p-0 m-0 font-inherit text-left w-full";

return (
<div className="space-y-6">
<div className="max-w-2xl">
<div className="space-y-2">
<div
className={cn(
"group relative p-3 rounded-lg border-2 transition-all",
isHyprCloudSelected
? "border-solid border-blue-500 bg-blue-50"
: "border-dashed border-gray-300 hover:border-gray-400 bg-white",
)}
>
<div className="flex items-center justify-between">
<div className="relative flex-1">
<button
onClick={handleHyprCloudSelection}
disabled={!isPro}
className={cn(
buttonResetClass,
isPro ? "cursor-pointer" : "cursor-not-allowed",
"block w-full",
)}
>
<div className="flex items-center gap-4">
<div className="min-w-0">
<h3 className="font-semibold text-base text-gray-900 flex items-center gap-2">
<CloudIcon className={cn("w-4 h-4", isPro ? "" : "opacity-50")} />
<span className={isPro ? "" : "opacity-50"}>HyprCloud</span>
</h3>
<p className={cn("text-sm text-gray-600", isPro ? "" : "opacity-50")}>
Connect to Hyprnote's Cloud hosted AI model.
</p>
</div>
</div>
</button>

<button
onClick={(e) => {
e.stopPropagation();
open("https://docs.hyprnote.com/pro/cloud");
}}
className="absolute top-[-2px] left-[113px] z-10"
>
<span className="inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium bg-blue-200 text-blue-800 hover:bg-blue-100 transition-colors">
Pro
</span>
</button>
</div>

{!isPro && (
<Button
onClick={() => {
windowsCommands.windowShow({ type: "settings" }).then(() => {
setTimeout(() => {
windowsCommands.windowEmitNavigate({ type: "settings" }, {
path: "/app/settings",
search: { tab: "billing" },
});
}, 500);
});
}}
size="sm"
className="ml-4 bg-blue-600 hover:bg-blue-700 text-white"
>
Upgrade to Pro
</Button>
)}
</div>
</div>

<div className="relative py-2">
<div className="absolute inset-0 flex items-center">
<div className="w-full border-t border-gray-200"></div>
</div>
<div className="relative flex justify-center text-xs">
<span className="px-2 bg-gray-50 text-gray-500">or use local models</span>
</div>
</div>

{llmModelsState.map((model) => (
<button
key={model.key}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { DownloadIcon, FolderIcon, InfoIcon } from "lucide-react";
import { useEffect, useMemo } from "react";

import { useHypr } from "@/contexts";
import { useLicense } from "@/hooks/use-license";
import { commands as analyticsCommands } from "@hypr/plugin-analytics";
import { commands as localSttCommands, ServerHealth, type SupportedSttModel } from "@hypr/plugin-local-stt";
import { Button } from "@hypr/ui/components/ui/button";
Expand Down Expand Up @@ -229,8 +228,6 @@ function ProModelsSection({
setProviderToLocal,
userId,
}: Omit<ModelSectionProps, "modelsToShow">) {
const { getLicense } = useLicense();

const handleShowFileLocation = async () => {
const path = await localSttCommands.modelsDir();
openPath(path);
Expand Down Expand Up @@ -262,7 +259,7 @@ function ProModelsSection({
<section className="max-w-2xl">
<SectionHeader
title="Pro Models"
description="Resource and latency optimized. Only for pro users."
description="Resource and latency optimized."
status={status}
docsUrl="https://docs.hyprnote.com/models"
/>
Expand All @@ -272,7 +269,7 @@ function ProModelsSection({
{proModels.data?.map((model) => (
<ModelEntry
key={model.key}
disabled={!getLicense.data?.valid}
disabled={false}
model={model}
selectedSTTModel={selectedSTTModel}
setSelectedSTTModel={setSelectedSTTModel}
Expand Down
15 changes: 1 addition & 14 deletions apps/desktop/src/components/settings/components/types.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,5 @@
import type { LucideIcon } from "lucide-react";
import {
Bell,
Calendar,
CreditCard,
HelpCircle,
LayoutTemplate,
MessageSquare,
NetworkIcon,
Settings,
Sparkles,
Volume2,
} from "lucide-react";
import { Bell, Calendar, HelpCircle, LayoutTemplate, MessageSquare, Settings, Sparkles, Volume2 } from "lucide-react";

export type Tab =
| "general"
Expand All @@ -34,7 +23,5 @@ export const TABS: { name: Tab; icon: LucideIcon }[] = [
{ name: "sound", icon: Volume2 },
{ name: "templates", icon: LayoutTemplate },
{ name: "integrations", icon: MessageSquare },
{ name: "mcp", icon: NetworkIcon },
{ name: "billing", icon: CreditCard },
{ name: "help-support", icon: HelpCircle },
];
Loading
Loading