New workspace create page (#710)
* New workspace page with agent catalog, composer modal, and terminal integration * fix lint * better blank state * fix: resolve typecheck errors in new-workspace flow - widen activateAndRevealWorktree's issueCommand to accept direct command shape used by NewWorkspacePage, not just the main-process runner-script variant - use a ref object in pty-connection tests to dodge TS narrowing the captured callback to never across the mock closure boundary * fix: bound worktree name auto-suffix loop to prevent OOM in tests The auto-suffix loop in createLocalWorktree had no termination cap. When tests (or a misconfigured env) mocked getBranchConflictKind / getPRForBranch to always return a collision, the loop ran forever and the vitest worker crashed with "Ineffective mark-compacts near heap limit". Cap the search at 100 suffixes, and if all fail, fall back to the original specific error messages (branch already exists / PR already owns the name) instead of a generic failure. Update the two tests that asserted the old throw-on-first-conflict behavior to verify the new auto-suffix path end-to-end.
This commit is contained in:
@@ -6,7 +6,10 @@ import type { StatsCollector } from '../stats/collector'
|
||||
import {
|
||||
getPRForBranch,
|
||||
getIssue,
|
||||
getRepoSlug,
|
||||
listIssues,
|
||||
listWorkItems,
|
||||
getWorkItem,
|
||||
getAuthenticatedViewer,
|
||||
getPRChecks,
|
||||
getPRComments,
|
||||
@@ -56,6 +59,24 @@ export function registerGitHubHandlers(store: Store, stats: StatsCollector): voi
|
||||
return listIssues(repo.path, args.limit)
|
||||
})
|
||||
|
||||
ipcMain.handle(
|
||||
'gh:listWorkItems',
|
||||
(_event, args: { repoPath: string; limit?: number; query?: string }) => {
|
||||
const repo = assertRegisteredRepo(args.repoPath, store)
|
||||
return listWorkItems(repo.path, args.limit, args.query)
|
||||
}
|
||||
)
|
||||
|
||||
ipcMain.handle('gh:workItem', (_event, args: { repoPath: string; number: number }) => {
|
||||
const repo = assertRegisteredRepo(args.repoPath, store)
|
||||
return getWorkItem(repo.path, args.number)
|
||||
})
|
||||
|
||||
ipcMain.handle('gh:repoSlug', (_event, args: { repoPath: string }) => {
|
||||
const repo = assertRegisteredRepo(args.repoPath, store)
|
||||
return getRepoSlug(repo.path)
|
||||
})
|
||||
|
||||
ipcMain.handle(
|
||||
'gh:prChecks',
|
||||
(
|
||||
|
||||
Reference in New Issue
Block a user