refactor: move from union type to object enum

This commit is contained in:
2026-07-15 02:41:17 +05:00
parent 35465f581f
commit 84f64af62d
30 changed files with 490 additions and 193 deletions
+10 -9
View File
@@ -6,14 +6,17 @@ import { openTask } from "@/commands/openTask";
import { resolveTaskLocations } from "@/commands/resolveTaskLocations";
import { appError, AppErrorVariant } from "@/error";
import { TaskLocation } from "@/model/taskLocation";
import { TaskStatus } from "@/model/task";
import { IConfigProvider, ITaskRepository } from "@/ports";
import { TaskDashboardPanel } from "@/views/taskDashboardPanel";
import { TaskKanbanPanel } from "@/views/taskKanbanPanel";
import { TaskTreeProvider } from "@/views/taskTreeProvider";
import { presentError } from "./presentError";
import { resolveTaskRef } from "./resolveTaskRef";
import { TASK_SCOPE_LABELS, TASK_STATUS_LABELS, TASK_STATUS_ORDER } from "./taskLabels";
import {
TASK_SCOPE_LABELS,
TASK_STATUS_LABELS,
TASK_STATUS_ORDER,
} from "./taskLabels";
export type TaskCommandDeps = {
repo: ITaskRepository;
@@ -163,7 +166,7 @@ export async function runChangeStatus(
const picked = await vscode.window.showQuickPick(
TASK_STATUS_ORDER.map((value) => ({
label: TASK_STATUS_LABELS[value],
status: value as TaskStatus,
status: value,
})),
{ placeHolder: "New status" },
);
@@ -226,13 +229,11 @@ export function registerTaskCommands(
vscode.commands.registerCommand("xboctFlow.createTask", () =>
runCreateTask(deps),
),
vscode.commands.registerCommand(
"xboctFlow.openTask",
(item?: unknown) => runOpenTask(deps, item),
vscode.commands.registerCommand("xboctFlow.openTask", (item?: unknown) =>
runOpenTask(deps, item),
),
vscode.commands.registerCommand(
"xboctFlow.deleteTask",
(item?: unknown) => runDeleteTask(deps, item),
vscode.commands.registerCommand("xboctFlow.deleteTask", (item?: unknown) =>
runDeleteTask(deps, item),
),
vscode.commands.registerCommand(
"xboctFlow.changeStatus",