feat: dashboard - add sorting and scope

This commit is contained in:
2026-07-15 03:15:44 +05:00
parent e46437a512
commit 9b27e94d04
10 changed files with 445 additions and 31 deletions
+22 -4
View File
@@ -1,16 +1,34 @@
import { AppError } from "@/error";
import { Task } from "@/model/task";
import { TaskScope } from "@/model/taskLocation";
import { TaskFilter } from "./filterTasks";
import { GroupBy, TaskGroup } from "./groupTasks";
import { GroupBy } from "./groupBy";
import { DashboardScopeFilter } from "./messages";
import { TaskSortDirection } from "./sortTasks";
/** Task row for the list (domain task + scope for display). */
export type DashboardListTask = Task & {
scope: TaskScope;
};
export type DashboardListGroup = {
key: string;
label: string;
tasks: DashboardListTask[];
};
/** Host → webview messages (presentation payload only). */
export type DashboardOutboundMessage =
| { variant: "state";
| {
variant: "state";
filter: TaskFilter;
groupBy: GroupBy;
selectedId: string | undefined;
groups: TaskGroup[];
selected: Task | null;
groups: DashboardListGroup[];
selected: DashboardListTask | null;
scopeFilter: DashboardScopeFilter;
sortDirection: TaskSortDirection;
availableScopes: TaskScope[];
}
| { variant: "error"; error: AppError }
| { variant: "saved"; task: Task };