diff --git a/apps/desktop/src/db/transcriptions.ts b/apps/desktop/src/db/transcriptions.ts index e001fdd..ae400e7 100644 --- a/apps/desktop/src/db/transcriptions.ts +++ b/apps/desktop/src/db/transcriptions.ts @@ -1,4 +1,4 @@ -import { eq, desc, asc, and, like, count, gte, lte } from "drizzle-orm"; +import { eq, desc, asc, and, ilike, count, gte, lte } from "drizzle-orm"; import { db } from "."; import { transcriptions, @@ -55,7 +55,7 @@ export async function getTranscriptions( return await db .select() .from(transcriptions) - .where(like(transcriptions.text, `%${search}%`)) + .where(ilike(transcriptions.text, `%${search}%`)) .orderBy(orderFn(sortColumn)) .limit(limit) .offset(offset); @@ -113,7 +113,7 @@ export async function getTranscriptionsCount(search?: string) { const result = await db .select({ count: count() }) .from(transcriptions) - .where(like(transcriptions.text, `%${search}%`)); + .where(ilike(transcriptions.text, `%${search}%`)); return result[0]?.count || 0; } else { const result = await db.select({ count: count() }).from(transcriptions); @@ -152,7 +152,7 @@ export async function searchTranscriptions(searchTerm: string, limit = 20) { return await db .select() .from(transcriptions) - .where(like(transcriptions.text, `%${searchTerm}%`)) + .where(ilike(transcriptions.text, `%${searchTerm}%`)) .orderBy(desc(transcriptions.timestamp)) .limit(limit); } diff --git a/apps/desktop/src/renderer/main/pages/notes/components/note.tsx b/apps/desktop/src/renderer/main/pages/notes/components/note.tsx index 54b51d5..059122a 100644 --- a/apps/desktop/src/renderer/main/pages/notes/components/note.tsx +++ b/apps/desktop/src/renderer/main/pages/notes/components/note.tsx @@ -420,14 +420,14 @@ export default function Note({ */} - + {/* Transcription coming soon - + */} {/* More actions dropdown */} diff --git a/apps/desktop/src/renderer/main/pages/settings/history/index.tsx b/apps/desktop/src/renderer/main/pages/settings/history/index.tsx index 8a9440c..081cf90 100644 --- a/apps/desktop/src/renderer/main/pages/settings/history/index.tsx +++ b/apps/desktop/src/renderer/main/pages/settings/history/index.tsx @@ -323,7 +323,6 @@ export default function HistorySettingsPage() { }); const transcriptions = transcriptionsQuery.data || []; - const loading = transcriptionsQuery.isLoading; function handleCopy(text: string) { navigator.clipboard.writeText(text); @@ -351,30 +350,6 @@ export default function HistorySettingsPage() { const groupedHistory = groupHistoryByDate(transcriptions); - // Loading state - if (loading) { - return ( -
-
-

History

-

- Your recent transcription history -

-
- - -
-
-

- Loading transcription history... -

-
-
-
-
- ); - } - return (
{/* Header Section */} diff --git a/apps/desktop/src/services/telemetry-service.ts b/apps/desktop/src/services/telemetry-service.ts index 17b5b79..0182ca5 100644 --- a/apps/desktop/src/services/telemetry-service.ts +++ b/apps/desktop/src/services/telemetry-service.ts @@ -65,9 +65,11 @@ export class TelemetryService { } try { - // Check if telemetry is enabled via environment variable - const apiKey = process.env.POSTHOG_API_KEY; - const telemetryEnabled = process.env.TELEMETRY_ENABLED !== "false"; + // Check runtime env first, then fall back to bundled values + const apiKey = process.env.POSTHOG_API_KEY || __BUNDLED_POSTHOG_API_KEY; + const telemetryEnabled = process.env.TELEMETRY_ENABLED + ? process.env.TELEMETRY_ENABLED !== "false" + : __BUNDLED_TELEMETRY_ENABLED; if (!apiKey || !telemetryEnabled) { logger.main.info("Telemetry disabled or no API key provided"); @@ -84,7 +86,7 @@ export class TelemetryService { logger.main.info("System information collected for telemetry"); // Initialize PostHog - const host = process.env.POSTHOG_HOST || "https://app.posthog.com"; + const host = process.env.POSTHOG_HOST || __BUNDLED_POSTHOG_HOST; this.posthog = new PostHog(apiKey, { host, flushAt: 1, diff --git a/apps/desktop/src/types/bundled-env.d.ts b/apps/desktop/src/types/bundled-env.d.ts new file mode 100644 index 0000000..27e7d76 --- /dev/null +++ b/apps/desktop/src/types/bundled-env.d.ts @@ -0,0 +1,3 @@ +declare const __BUNDLED_POSTHOG_API_KEY: string; +declare const __BUNDLED_POSTHOG_HOST: string; +declare const __BUNDLED_TELEMETRY_ENABLED: boolean; diff --git a/apps/desktop/vite.main.config.mts b/apps/desktop/vite.main.config.mts index eec150f..fe823c1 100644 --- a/apps/desktop/vite.main.config.mts +++ b/apps/desktop/vite.main.config.mts @@ -4,9 +4,13 @@ import { resolve } from "path"; // https://vitejs.dev/config export default defineConfig({ define: { - 'process.env.POSTHOG_API_KEY': JSON.stringify(process.env.POSTHOG_API_KEY || ''), - 'process.env.POSTHOG_HOST': JSON.stringify(process.env.POSTHOG_HOST || 'https://app.posthog.com'), - 'process.env.TELEMETRY_ENABLED': JSON.stringify(process.env.TELEMETRY_ENABLED || 'false'), + __BUNDLED_POSTHOG_API_KEY: JSON.stringify( + process.env.POSTHOG_API_KEY || "", + ), + __BUNDLED_POSTHOG_HOST: JSON.stringify(process.env.POSTHOG_HOST || ""), + __BUNDLED_TELEMETRY_ENABLED: JSON.stringify( + process.env.TELEMETRY_ENABLED !== "false", + ), }, build: { rollupOptions: { diff --git a/packages/native-helpers/windows-helper/WindowsHelper.csproj b/packages/native-helpers/windows-helper/WindowsHelper.csproj index 202693a..b088e9d 100644 --- a/packages/native-helpers/windows-helper/WindowsHelper.csproj +++ b/packages/native-helpers/windows-helper/WindowsHelper.csproj @@ -2,7 +2,8 @@ Exe - net9.0 + net6.0 + Major enable win-x64 true