feat: dashboard - add sorting and scope
This commit is contained in:
@@ -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 };
|
||||
|
||||
Reference in New Issue
Block a user