Skip to content
Merged
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
24 changes: 23 additions & 1 deletion ui/desktop/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -410,6 +410,16 @@ if (process.platform !== 'darwin') {
return; // Skip the rest of the handler
}

// Handle new-session URL by creating a fresh chat window
if (parsedUrl.hostname === 'new-session') {
app.whenReady().then(async () => {
const recentDirs = loadRecentDirs();
const openDir = recentDirs.length > 0 ? recentDirs[0] : null;
await createChat(app, { dir: openDir || undefined });
});
return;
}

// For non-bot URLs, continue with normal handling
handleProtocolUrl(protocolUrl);
}
Expand Down Expand Up @@ -448,7 +458,11 @@ async function handleProtocolUrl(url: string) {
const recentDirs = loadRecentDirs();
const openDir = recentDirs.length > 0 ? recentDirs[0] : null;

if (parsedUrl.hostname === 'bot' || parsedUrl.hostname === 'recipe') {
if (parsedUrl.hostname === 'new-session') {
await createChat(app, { dir: openDir || undefined });
pendingDeepLink = null;
return;
} else if (parsedUrl.hostname === 'bot' || parsedUrl.hostname === 'recipe') {
// For bot/recipe URLs, get existing window or create new one
const existingWindows = BrowserWindow.getAllWindows();
const targetWindow =
Expand Down Expand Up @@ -518,6 +532,14 @@ app.on('open-url', async (_event, url) => {
const recentDirs = loadRecentDirs();
const openDir = recentDirs.length > 0 ? recentDirs[0] : null;

// Handle new-session URL by creating a fresh chat window
if (parsedUrl.hostname === 'new-session') {
log.info('[Main] Detected new-session URL, creating new chat window');
openUrlHandledLaunch = true;
await createChat(app, { dir: openDir || undefined });
return;
}

// Handle bot/recipe URLs by directly creating a new window
if (parsedUrl.hostname === 'bot' || parsedUrl.hostname === 'recipe') {
log.info('[Main] Detected bot/recipe URL, creating new chat window');
Expand Down
Loading