fix(KB-043): fix type errors and test failures across all packages
- Add mergeRetries field to updateTask type signature alongside model overrides - Fix GitManagerModal type imports and error handling - Update Column, ListView, and GitManagerModal tests for type compatibility - Fix tsconfig.app.json path references - Adjust CLI build settings for proper bundling
This commit is contained in:
@@ -95,7 +95,13 @@ if (!existsSync(dashboardClientSrc)) {
|
|||||||
// Express.static requires a real filesystem directory, so we co-locate
|
// Express.static requires a real filesystem directory, so we co-locate
|
||||||
// the pre-built SPA next to the binary rather than embedding blobs.
|
// the pre-built SPA next to the binary rather than embedding blobs.
|
||||||
function copyClientAssets() {
|
function copyClientAssets() {
|
||||||
if (existsSync(dashboardClientDest)) rmSync(dashboardClientDest, { recursive: true });
|
try {
|
||||||
|
if (existsSync(dashboardClientDest)) {
|
||||||
|
rmSync(dashboardClientDest, { recursive: true, force: true });
|
||||||
|
}
|
||||||
|
} catch {
|
||||||
|
// Ignore cleanup errors - directory might not exist or be accessible
|
||||||
|
}
|
||||||
console.log("Copying dashboard client assets...");
|
console.log("Copying dashboard client assets...");
|
||||||
mkdirSync(dashboardClientDest, { recursive: true });
|
mkdirSync(dashboardClientDest, { recursive: true });
|
||||||
cpSync(dashboardClientSrc, dashboardClientDest, { recursive: true });
|
cpSync(dashboardClientSrc, dashboardClientDest, { recursive: true });
|
||||||
|
|||||||
@@ -340,7 +340,7 @@ export class TaskStore extends EventEmitter<TaskStoreEvents> {
|
|||||||
|
|
||||||
async updateTask(
|
async updateTask(
|
||||||
id: string,
|
id: string,
|
||||||
updates: { title?: string; description?: string; prompt?: string; worktree?: string; status?: string | null; dependencies?: string[]; blockedBy?: string | null; paused?: boolean; baseBranch?: string; size?: "S" | "M" | "L"; reviewLevel?: number; modelProvider?: string | null; modelId?: string | null; validatorModelProvider?: string | null; validatorModelId?: string | null },
|
updates: { title?: string; description?: string; prompt?: string; worktree?: string; status?: string | null; dependencies?: string[]; blockedBy?: string | null; paused?: boolean; baseBranch?: string; size?: "S" | "M" | "L"; reviewLevel?: number; mergeRetries?: number; modelProvider?: string | null; modelId?: string | null; validatorModelProvider?: string | null; validatorModelId?: string | null },
|
||||||
): Promise<Task> {
|
): Promise<Task> {
|
||||||
return this.withTaskLock(id, async () => {
|
return this.withTaskLock(id, async () => {
|
||||||
const dir = this.taskDir(id);
|
const dir = this.taskDir(id);
|
||||||
@@ -382,6 +382,7 @@ export class TaskStore extends EventEmitter<TaskStoreEvents> {
|
|||||||
if (updates.baseBranch !== undefined) task.baseBranch = updates.baseBranch;
|
if (updates.baseBranch !== undefined) task.baseBranch = updates.baseBranch;
|
||||||
if (updates.size !== undefined) task.size = updates.size;
|
if (updates.size !== undefined) task.size = updates.size;
|
||||||
if (updates.reviewLevel !== undefined) task.reviewLevel = updates.reviewLevel;
|
if (updates.reviewLevel !== undefined) task.reviewLevel = updates.reviewLevel;
|
||||||
|
if (updates.mergeRetries !== undefined) task.mergeRetries = updates.mergeRetries;
|
||||||
if (updates.modelProvider === null) {
|
if (updates.modelProvider === null) {
|
||||||
task.modelProvider = undefined;
|
task.modelProvider = undefined;
|
||||||
} else if (updates.modelProvider !== undefined) {
|
} else if (updates.modelProvider !== undefined) {
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ import {
|
|||||||
} from "../api";
|
} from "../api";
|
||||||
import {
|
import {
|
||||||
GitBranch as GitBranchIcon,
|
GitBranch as GitBranchIcon,
|
||||||
GitCommit,
|
GitCommit as GitCommitIcon,
|
||||||
GitPullRequest,
|
GitPullRequest,
|
||||||
GitMerge,
|
GitMerge,
|
||||||
RefreshCw,
|
RefreshCw,
|
||||||
@@ -47,7 +47,7 @@ type SectionId = "status" | "commits" | "branches" | "worktrees" | "remotes";
|
|||||||
|
|
||||||
const SECTIONS = [
|
const SECTIONS = [
|
||||||
{ id: "status" as SectionId, label: "Status", icon: Radio },
|
{ id: "status" as SectionId, label: "Status", icon: Radio },
|
||||||
{ id: "commits" as SectionId, label: "Commits", icon: GitCommit },
|
{ id: "commits" as SectionId, label: "Commits", icon: GitCommitIcon },
|
||||||
{ id: "branches" as SectionId, label: "Branches", icon: GitBranchIcon },
|
{ id: "branches" as SectionId, label: "Branches", icon: GitBranchIcon },
|
||||||
{ id: "worktrees" as SectionId, label: "Worktrees", icon: HardDrive },
|
{ id: "worktrees" as SectionId, label: "Worktrees", icon: HardDrive },
|
||||||
{ id: "remotes" as SectionId, label: "Remotes", icon: GitMerge },
|
{ id: "remotes" as SectionId, label: "Remotes", icon: GitMerge },
|
||||||
|
|||||||
@@ -25,10 +25,12 @@ function makeTask(id: string): Task {
|
|||||||
column: "triage" as ColumnType,
|
column: "triage" as ColumnType,
|
||||||
status: undefined as any,
|
status: undefined as any,
|
||||||
steps: [],
|
steps: [],
|
||||||
|
currentStep: 0,
|
||||||
dependencies: [],
|
dependencies: [],
|
||||||
description: "",
|
description: "",
|
||||||
created: new Date().toISOString(),
|
log: [],
|
||||||
updated: new Date().toISOString(),
|
createdAt: new Date().toISOString(),
|
||||||
|
updatedAt: new Date().toISOString(),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -37,8 +37,8 @@ import {
|
|||||||
const mockAddToast = vi.fn();
|
const mockAddToast = vi.fn();
|
||||||
|
|
||||||
const mockTasks: Task[] = [
|
const mockTasks: Task[] = [
|
||||||
{ id: "KB-001", description: "Test task 1", column: "in-progress", dependencies: [], worktree: "/worktrees/kb-001" },
|
{ id: "KB-001", description: "Test task 1", column: "in-progress", dependencies: [], worktree: "/worktrees/kb-001", steps: [], currentStep: 0, log: [], createdAt: new Date().toISOString(), updatedAt: new Date().toISOString() },
|
||||||
{ id: "KB-002", description: "Test task 2", column: "todo", dependencies: [] },
|
{ id: "KB-002", description: "Test task 2", column: "todo", dependencies: [], steps: [], currentStep: 0, log: [], createdAt: new Date().toISOString(), updatedAt: new Date().toISOString() },
|
||||||
];
|
];
|
||||||
|
|
||||||
describe("GitManagerModal", () => {
|
describe("GitManagerModal", () => {
|
||||||
|
|||||||
@@ -795,15 +795,15 @@ describe("ListView Column Visibility", () => {
|
|||||||
|
|
||||||
// Uncheck all but one
|
// Uncheck all but one
|
||||||
for (let i = 0; i < checkboxes.length - 1; i++) {
|
for (let i = 0; i < checkboxes.length - 1; i++) {
|
||||||
if (checkboxes[i].checked) {
|
if ((checkboxes[i] as HTMLInputElement).checked) {
|
||||||
fireEvent.click(checkboxes[i]);
|
fireEvent.click(checkboxes[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// The last checkbox should be disabled (check the disabled property)
|
// The last checkbox should be disabled (check the disabled property)
|
||||||
const lastCheckbox = checkboxes[checkboxes.length - 1];
|
const lastCheckbox = checkboxes[checkboxes.length - 1];
|
||||||
if (lastCheckbox.checked) {
|
if ((lastCheckbox as HTMLInputElement).checked) {
|
||||||
expect(lastCheckbox.disabled).toBe(true);
|
expect((lastCheckbox as HTMLInputElement).disabled).toBe(true);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,8 @@
|
|||||||
"jsx": "react-jsx",
|
"jsx": "react-jsx",
|
||||||
"moduleResolution": "bundler",
|
"moduleResolution": "bundler",
|
||||||
"module": "ESNext",
|
"module": "ESNext",
|
||||||
"noEmit": true
|
"noEmit": true,
|
||||||
|
"types": ["vitest/globals", "@testing-library/jest-dom", "node"]
|
||||||
},
|
},
|
||||||
"include": ["app"]
|
"include": ["app"]
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user