Files
xboct-flow/src/dashboard/outboundMessages.ts
T

34 lines
964 B
TypeScript

import { AppError } from "@/error";
import { Task } from "@/model/task";
import { TaskScope } from "@/model/taskLocation";
import { TaskFilter } from "./filterTasks";
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";
filter: TaskFilter;
groupBy: GroupBy;
selectedId: string | undefined;
groups: DashboardListGroup[];
selected: DashboardListTask | null;
scopeFilter: DashboardScopeFilter;
sortDirection: TaskSortDirection;
availableScopes: TaskScope[];
}
| { variant: "error"; error: AppError };