Skip to content
Draft
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
4 changes: 3 additions & 1 deletion electron/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,9 @@ function verifyPreloadAllowlist(): void {
const preloadPath = path.join(__dirname, '..', 'electron', 'preload.cjs');
const preloadSrc = fs.readFileSync(preloadPath, 'utf8');
const enumValues = new Set(Object.values(IPC));
const missing = [...enumValues].filter((v) => !preloadSrc.includes(`"${v}"`));
const hasChannel = (channel: string) =>
preloadSrc.includes(`'${channel}'`) || preloadSrc.includes(`"${channel}"`);
const missing = [...enumValues].filter((v) => !hasChannel(v));
if (missing.length > 0) {
console.warn(
`[preload-sync] IPC channels missing from preload.cjs ALLOWED_CHANNELS: ${missing.join(', ')}`,
Expand Down
10 changes: 10 additions & 0 deletions electron/vite.config.electron.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,22 @@
import path from 'path';
import { defineConfig } from 'vite';
import solid from 'vite-plugin-solid';

const rootDir = path.resolve(process.cwd());
const siblingWorktreesDir = path.resolve(rootDir, '..');

export default defineConfig({
base: './',
plugins: [solid()],
clearScreen: false,
server: {
port: 1421,
strictPort: true,
watch: {
ignored: (watchedPath) => {
const resolvedPath = path.resolve(watchedPath);
return resolvedPath.startsWith(siblingWorktreesDir) && !resolvedPath.startsWith(rootDir);
},
},
},
});
3 changes: 3 additions & 0 deletions src/store/tasks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { produce } from 'solid-js/store';
import { invoke } from '../lib/ipc';
import { IPC } from '../../electron/ipc/channels';
import { store, setStore, updateWindowTitle, cleanupPanelEntries } from './core';
import { saveState } from './persistence';
import { setTaskFocusedPanel } from './focus';
import { getProject, getProjectPath, getProjectBranchPrefix, isProjectMissing } from './projects';
import { setPendingShellCommand } from '../lib/bookmarks';
Expand Down Expand Up @@ -125,6 +126,7 @@ export async function createTask(opts: CreateTaskOptions): Promise<string> {
// Mark as busy immediately; terminal output may arrive later.
markAgentSpawned(agentId);
rescheduleTaskStatusPolling();
await saveState();
updateWindowTitle(name);
return result.id;
}
Expand Down Expand Up @@ -194,6 +196,7 @@ export async function createDirectTask(opts: CreateDirectTaskOptions): Promise<s

markAgentSpawned(agentId);
rescheduleTaskStatusPolling();
await saveState();
updateWindowTitle(name);
return id;
}
Expand Down