Skip to content
Merged
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
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
{
"explorer.excludeGitIgnore": false,
"search.useParentIgnoreFiles": false,
"search.useIgnoreFiles": false,
"files.watcherExclude": {
"**/routeTree.gen.ts": true
},
Expand Down
41 changes: 22 additions & 19 deletions apps/desktop/src-tauri/capabilities/default.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,50 +26,41 @@
{
"identifier": "opener:allow-open-path",
"allow": [
{ "path": "$APPDATA/*" },
{ "path": "$APPDATA/**" },
{ "path": "$DOWNLOAD/*" },
{ "path": "$DOWNLOAD/**" }
{ "path": "$DATA/hyprnote/**/*" },
{ "path": "$DOWNLOAD/**/*" }
]
},
{
"identifier": "fs:allow-mkdir",
"allow": [
{ "path": "$APPDATA/*" },
{ "path": "$APPDATA/**" }
{ "path": "$DATA/hyprnote/**/*" }
]
},
{
"identifier": "fs:allow-exists",
"allow": [
{ "path": "/Applications/*" },
{ "path": "$APPDATA/*" },
{ "path": "$APPDATA/**" }
{ "path": "$DATA/hyprnote/**/*" }
]
},
{
"identifier": "fs:allow-read-file",
"allow": [
{ "path": "$APPDATA/*" },
{ "path": "$APPDATA/**" }
{ "path": "$DATA/hyprnote/**/*" }
]
},
{
"identifier": "fs:allow-write-text-file",
"allow": [
{ "path": "$APPDATA/*" },
{ "path": "$APPDATA/**" },
{ "path": "$DOWNLOAD/*" },
{ "path": "$DOWNLOAD/**" }
{ "path": "$DATA/hyprnote/**/*" },
{ "path": "$DOWNLOAD/**/*" }
]
},
{
"identifier": "fs:allow-write-file",
"allow": [
{ "path": "$APPDATA/*" },
{ "path": "$APPDATA/**" },
{ "path": "$DOWNLOAD/*" },
{ "path": "$DOWNLOAD/**" }
{ "path": "$DATA/hyprnote/**/*" },
{ "path": "$DOWNLOAD/**/*" }
]
},
"db2:default",
Expand All @@ -88,7 +79,19 @@
"template:default",
"notification:default",
"shell:allow-open",
"shell:allow-execute",
{
"identifier": "shell:allow-execute",
"allow": [
{
"name": "exec-sh",
"cmd": "sh",
"args": [
"-c",
{ "validator": ".+" }
]
}
]
},
"misc:default",
"os:default",
"detect: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 @@ -16,7 +16,7 @@
"security": {
"assetProtocol": {
"enable": true,
"scope": ["$APPDATA/**", "$APPCACHE/**", "$APPLOCALDATA/**", "$APPLOG/**"]
"scope": ["**/*"]
}
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -296,28 +296,28 @@ export function Header({
editorTabs,
currentTab,
handleTabChange,
isInactive,
isEditing,
setIsEditing,
}: {
sessionId: string;
editorTabs: EditorView[];
currentTab: EditorView;
handleTabChange: (view: EditorView) => void;
isInactive: boolean;
isEditing: boolean;
setIsEditing: (isEditing: boolean) => void;
}) {
const isBatchProcessing = useListener((state) => sessionId in state.batch);
const sessionMode = useListener((state) => state.getSessionMode(sessionId));
const isBatchProcessing = sessionMode === "running_batch";
const isLiveProcessing = sessionMode === "running_active";

if (editorTabs.length === 1 && editorTabs[0].type === "raw") {
return null;
}

const showProgress =
currentTab.type === "transcript" && (isInactive || isBatchProcessing);
currentTab.type === "transcript" && !isLiveProcessing && isBatchProcessing;
const showEditingControls =
currentTab.type === "transcript" && isInactive && !isBatchProcessing;
currentTab.type === "transcript" && isLiveProcessing && !isBatchProcessing;

return (
<div className="flex flex-col">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { useHotkeys } from "react-hotkeys-hook";
import type { TiptapEditor } from "@hypr/tiptap/editor";
import { cn } from "@hypr/utils";

import { useListener } from "../../../../../contexts/listener";
import { useAutoEnhance } from "../../../../../hooks/useAutoEnhance";
import { useAutoTitle } from "../../../../../hooks/useAutoTitle";
import { type Tab, useTabs } from "../../../../../store/zustand/tabs";
Expand All @@ -23,7 +22,6 @@ export function NoteInput({
const editorTabs = useEditorTabs({ sessionId: tab.id });
const updateSessionTabState = useTabs((state) => state.updateSessionTabState);
const editorRef = useRef<{ editor: TiptapEditor | null }>(null);
const inactive = useListener((state) => state.live.status === "inactive");
const [isEditing, setIsEditing] = useState(false);

const sessionId = tab.id;
Expand Down Expand Up @@ -62,7 +60,6 @@ export function NoteInput({
editorTabs={editorTabs}
currentTab={currentTab}
handleTabChange={handleTabChange}
isInactive={inactive}
isEditing={isEditing}
setIsEditing={setIsEditing}
/>
Expand Down
105 changes: 45 additions & 60 deletions apps/desktop/src/components/settings/ai/llm/configure.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,7 @@ import { cn } from "@hypr/utils";
import { useBillingAccess } from "../../../../billing";
import { aiProviderSchema } from "../../../../store/tinybase/main";
import * as main from "../../../../store/tinybase/main";
import {
FormField,
PlanLockMessage,
StyledStreamdown,
useProvider,
} from "../shared";
import { FormField, StyledStreamdown, useProvider } from "../shared";
import { ProviderId, PROVIDERS } from "./shared";

export function ConfigureProviders() {
Expand Down Expand Up @@ -107,56 +102,49 @@ function NonHyprProviderCard({
</AccordionTrigger>
<AccordionContent className="px-4 space-y-6">
<ProviderContext providerId={config.id} />
{locked ? (
<PlanLockMessage message="Upgrade to Pro to configure this provider." />
) : (
<form
className="space-y-4"
onSubmit={(e) => {
e.preventDefault();
e.stopPropagation();
}}
>
{!config.baseUrl && (
<form.Field name="base_url">
{(field) => (
<FormField field={field} label="Base URL" icon="mdi:web" />
)}
</form.Field>
)}
{config?.apiKey && (
<form.Field name="api_key">
{(field) => (
<FormField
field={field}
label="API Key"
icon="mdi:key"
placeholder="Enter your API key"
type="password"
/>
)}
</form.Field>
)}
{config.baseUrl && (
<details className="space-y-4 pt-2">
<summary className="text-xs cursor-pointer text-neutral-600 hover:text-neutral-900 hover:underline">
Advanced
</summary>
<div className="mt-4">
<form.Field name="base_url">
{(field) => (
<FormField
field={field}
label="Base URL"
icon="mdi:web"
/>
)}
</form.Field>
</div>
</details>
)}
</form>
)}

<form
className="space-y-4"
onSubmit={(e) => {
e.preventDefault();
e.stopPropagation();
}}
>
{!config.baseUrl && (
<form.Field name="base_url">
{(field) => (
<FormField field={field} label="Base URL" icon="mdi:web" />
)}
</form.Field>
)}
{config?.apiKey && (
<form.Field name="api_key">
{(field) => (
<FormField
field={field}
label="API Key"
icon="mdi:key"
placeholder="Enter your API key"
type="password"
/>
)}
</form.Field>
)}
{config.baseUrl && (
<details className="space-y-4 pt-2">
<summary className="text-xs cursor-pointer text-neutral-600 hover:text-neutral-900 hover:underline">
Advanced
</summary>
<div className="mt-4">
<form.Field name="base_url">
{(field) => (
<FormField field={field} label="Base URL" icon="mdi:web" />
)}
</form.Field>
</div>
</details>
)}
</form>
</AccordionContent>
</AccordionItem>
);
Expand Down Expand Up @@ -190,15 +178,12 @@ function HyprProviderCard({
{icon}
<span>{providerName}</span>
<span className="text-xs text-neutral-500 font-light border border-neutral-300 rounded-full px-2">
Recommended
{locked ? "Pro Required" : "Recommended"}
</span>
</div>
</AccordionTrigger>
<AccordionContent className="px-4">
<ProviderContext providerId={providerId} />
{locked ? (
<PlanLockMessage message="Upgrade to Pro to use Hyprnote LLMs." />
) : null}
</AccordionContent>
</AccordionItem>
);
Expand Down
6 changes: 1 addition & 5 deletions apps/desktop/src/components/settings/ai/llm/select.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ export function SelectProviderAndModel() {
{PROVIDERS.map((provider) => {
const locked = provider.requiresPro && !billing.isPro;
const configured = configuredProviders[provider.id];

return (
<SelectItem
key={provider.id}
Expand All @@ -121,11 +122,6 @@ export function SelectProviderAndModel() {
{provider.icon}
<span>{provider.displayName}</span>
</div>
{locked ? (
<span className="text-[11px] text-neutral-500">
Upgrade to Pro to use this provider.
</span>
) : null}
</div>
</SelectItem>
);
Expand Down
8 changes: 0 additions & 8 deletions apps/desktop/src/components/settings/ai/shared/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -120,11 +120,3 @@ export function FormField({
</div>
);
}

export function PlanLockMessage({ message }: { message: string }) {
return (
<div className="rounded-md border border-dashed border-amber-200 bg-amber-50 p-3 text-xs text-amber-900">
{message}
</div>
);
}
Loading
Loading