feat: add dashboard ui view
This commit is contained in:
+10
-3
@@ -15,8 +15,15 @@ export type TaskCommandDeps = {
|
||||
repo: ITaskRepository;
|
||||
config: IConfigProvider;
|
||||
tree: TaskTreeProvider;
|
||||
/** Refresh dashboard (and any other listeners) after task mutations. */
|
||||
onTasksMutated?: () => void;
|
||||
};
|
||||
|
||||
function notifyMutated(deps: TaskCommandDeps): void {
|
||||
deps.tree.refresh();
|
||||
deps.onTasksMutated?.();
|
||||
}
|
||||
|
||||
export async function runCreateTask(deps: TaskCommandDeps): Promise<void> {
|
||||
const title = await vscode.window.showInputBox({
|
||||
prompt: "Task title",
|
||||
@@ -37,7 +44,7 @@ export async function runCreateTask(deps: TaskCommandDeps): Promise<void> {
|
||||
return;
|
||||
}
|
||||
|
||||
deps.tree.refresh();
|
||||
notifyMutated(deps);
|
||||
void vscode.window.showInformationMessage(
|
||||
`Task created: ${result.value.title}`,
|
||||
);
|
||||
@@ -98,7 +105,7 @@ export async function runDeleteTask(
|
||||
return;
|
||||
}
|
||||
|
||||
deps.tree.refresh();
|
||||
notifyMutated(deps);
|
||||
void vscode.window.showInformationMessage("Task deleted");
|
||||
}
|
||||
|
||||
@@ -138,7 +145,7 @@ export async function runChangeStatus(
|
||||
return;
|
||||
}
|
||||
|
||||
deps.tree.refresh();
|
||||
notifyMutated(deps);
|
||||
void vscode.window.showInformationMessage(
|
||||
`Status: ${TASK_STATUS_LABELS[result.value.status]}`,
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user