mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-06-22 21:28:12 +02:00
Add PostHog analytics to desktop main process
This commit is contained in:
parent
e85c355592
commit
8566b03c91
7 changed files with 75 additions and 1 deletions
|
|
@ -5,6 +5,7 @@ import { checkAccessibilityPermission, getFrontmostApp, simulateCopy, simulatePa
|
|||
import { getServerPort } from './server';
|
||||
import { getShortcuts } from './shortcuts';
|
||||
import { getActiveSearchSpaceId } from './active-search-space';
|
||||
import { trackEvent } from './analytics';
|
||||
|
||||
let currentShortcut = '';
|
||||
let quickAskWindow: BrowserWindow | null = null;
|
||||
|
|
@ -120,6 +121,7 @@ async function quickAskHandler(): Promise<void> {
|
|||
|
||||
sourceApp = getFrontmostApp();
|
||||
console.log('[quick-ask] Source app:', sourceApp, '| Opening Quick Assist with', text.length, 'chars', selected ? '(selected)' : text ? '(clipboard fallback)' : '(empty)');
|
||||
trackEvent('desktop_quick_ask_opened', { has_selected_text: !!selected });
|
||||
openQuickAsk(text);
|
||||
}
|
||||
|
||||
|
|
@ -151,6 +153,7 @@ function registerIpcHandlers(): void {
|
|||
|
||||
if (!checkAccessibilityPermission()) return;
|
||||
|
||||
trackEvent('desktop_quick_ask_replaced');
|
||||
clipboard.writeText(text);
|
||||
destroyQuickAsk();
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue