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
26 changes: 4 additions & 22 deletions .claude/settings.local.json
Original file line number Diff line number Diff line change
@@ -1,29 +1,11 @@
{
"permissions": {
"allow": [
"WebSearch",
"Bash(pnpm init:*)",
"Bash(npm init:*)",
"Bash(npm install:*)",
"Bash(npx tailwindcss:*)",
"Bash(git init:*)",
"Bash(npm run dev:*)",
"Bash(git commit:*)",
"Bash(npm run build:*)",
"Bash(find:*)",
"Bash(npm uninstall:*)",
"Read(//c/Users/jasie/OneDrive/Pictures/Screenshots/**)",
"Bash(npx electron-builder install-app-deps)",
"Bash(npx electron-rebuild -f -w better-sqlite3)",
"Bash(git log:*)",
"Bash(npm run lint)",
"Bash(npm run lint:*)",
"Bash(curl:*)",
"Bash(unzip:*)",
"Bash(chmod:*)",
"Bash(npm run format:*)",
"Bash(npx electron-rebuild:*)",
"WebFetch(domain:ollama.com)",
"Bash(npm run lint:fix:*)"
"Bash(git add:*)",
"WebSearch",
"WebFetch(domain:www.electronjs.org)"
],
"deny": [],
"ask": []
Expand Down
19 changes: 18 additions & 1 deletion src/main/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { fileURLToPath } from 'url';
import { databaseService } from './services/database';
import { ollamaService } from './services/ollama';
import { downloadService } from './services/download';
import { tabWindowManager } from './services/tabWindowManager';
import { registerIpcHandlers } from './ipc/handlers';

// Polyfill __dirname for ESM
Expand Down Expand Up @@ -301,6 +302,12 @@ app.whenReady().then(async () => {

createWindow();

// Initialize tab window manager after main window is created
if (mainWindow) {
tabWindowManager.initialize(mainWindow);
console.log('[Main] TabWindowManager initialized');
}

// On macOS, re-create window when dock icon is clicked and no windows are open
app.on('activate', () => {
if (BrowserWindow.getAllWindows().length === 0) {
Expand Down Expand Up @@ -329,6 +336,14 @@ async function performCleanup(): Promise<void> {
cleanupPerformed = true;
console.log('[Main] Performing cleanup...');

try {
// Cleanup tab windows
tabWindowManager.cleanup();
console.log('[Main] Tab windows cleaned up');
} catch (error) {
console.error('[Main] Error cleaning up tab windows:', error);
}

try {
// Stop Ollama service first
await ollamaService.stop();
Expand Down Expand Up @@ -547,7 +562,9 @@ app.on('web-contents-created', (event, contents) => {
);
console.log('[Context Menu] User selected save path:', savePath);
if (savePath) {
console.log('[Context Menu] Registering custom save path and triggering download');
console.log(
'[Context Menu] Registering custom save path and triggering download'
);
// Register the custom save path for this URL
downloadService.setCustomSavePath(linkUrl, savePath);
// Trigger download - will use the custom path
Expand Down
Loading