- {/* Total Sessions Card */}
-
-
-
-
- {insights?.totalSessions}
-
-
Total sessions
-
-
-
+ <>
+
+
+
+
+ {/* Total Sessions Card */}
+
+
+
+
+ {insights?.totalSessions}
+
+
Total sessions
+
+
+
- {/* Average Duration Card */}
-
-
-
-
- {insights?.avgSessionDuration?.toFixed(1)}m
-
-
Avg. duration
-
-
-
+ {/* Average Duration Card */}
+
+
+
+
+ {insights?.avgSessionDuration?.toFixed(1)}m
+
+
Avg. duration
+
+
+
- {/* Total Tokens Card */}
-
-
-
-
- {insights?.totalTokens ? `${(insights.totalTokens / 1000000).toFixed(2)}M` : ''}
-
-
Total tokens (millions)
-
-
-
+ {/* Total Tokens Card */}
+
+
+
+
+ {insights?.totalTokens ? `${(insights.totalTokens / 1000000).toFixed(2)}M` : ''}
+
+
Total tokens (millions)
+
+
+
- {/* Activity Heatmap Card */}
- {/*
+ {/* Activity Heatmap Card */}
+ {/*
Activity Heatmap
@@ -102,25 +136,26 @@ export function SessionInsights() {
*/}
- {/* Most Active Directories Card */}
-
-
-
- Active directories
-
-
- {insights.mostActiveDirs.map(([dir, count], index) => (
-
-
-
-
{dir}
+ {/* Most Active Directories Card */}
+
+
+
+ Active directories
+
+
+ {insights.mostActiveDirs.map(([dir, count], index) => (
+
+
+
+ {dir}
+
+
{count} sessions
-
{count} sessions
-
- ))}
-
-
-
-
+ ))}
+
+
+
+
+ >
);
}
diff --git a/ui/desktop/src/main.ts b/ui/desktop/src/main.ts
index b60e4bbd7f..8a53c3e287 100644
--- a/ui/desktop/src/main.ts
+++ b/ui/desktop/src/main.ts
@@ -11,6 +11,7 @@ import {
Tray,
App,
globalShortcut,
+ shell,
} from 'electron';
import type { OpenDialogReturnValue } from 'electron';
import { Buffer } from 'node:buffer';
@@ -528,12 +529,18 @@ const createChat = async (
mainWindow.webContents.setWindowOpenHandler(({ url }) => {
// Open all links in external browser
if (url.startsWith('http:') || url.startsWith('https:')) {
- electron.shell.openExternal(url);
+ shell.openExternal(url);
return { action: 'deny' };
}
return { action: 'allow' };
});
+ // Handle new-window events (alternative approach for external links)
+ mainWindow.webContents.on('new-window', (event, url) => {
+ event.preventDefault();
+ shell.openExternal(url);
+ });
+
// Load the index.html of the app.
let queryParams = '';
if (query) {
@@ -1756,18 +1763,10 @@ app.whenReady().then(async () => {
return;
}
- // On macOS, use the 'open' command with Chrome
- if (process.platform === 'darwin') {
- spawn('open', ['-a', 'Google Chrome', url]);
- } else if (process.platform === 'win32') {
- // On Windows, start is built-in command of cmd.exe
- spawn('cmd.exe', ['/c', 'start', '', 'chrome', url]);
- } else {
- // On Linux, use xdg-open with chrome
- spawn('xdg-open', [url]);
- }
+ // Use shell.openExternal to open URL in user's default browser
+ shell.openExternal(url);
} catch (error) {
- console.error('Error opening URL in Chrome:', error);
+ console.error('Error opening URL in browser:', error);
}
});
diff --git a/ui/desktop/src/styles/main.css b/ui/desktop/src/styles/main.css
index 57dd111eff..abc5f1609d 100644
--- a/ui/desktop/src/styles/main.css
+++ b/ui/desktop/src/styles/main.css
@@ -12,7 +12,7 @@
--color-black: #000000;
--color-neutral-100: #e8eaf2;
- --color-neutral-200: #ccd2dd;
+ --color-neutral-200: #d4dae2;
--color-neutral-300: #a1a7b0;
--color-neutral-400: #6e747e;
--color-neutral-500: #32353b;