Task Tree

Assistants with the tasks each one owns, starred first, as a sidebar.

Installation

pnpm dlx shadcn@latest add checkfu/uicontext/task-tree

Usage

import { TaskTree } from "./ui/uicontext/components/kit/TaskTree.ts"
const Message = UiSchema.TaggedEnum({ ToggledStar: { assistant: Schema.String, on: Schema.Boolean } })// starring is the app's: the star asks, and your update moves the assistant between sectionsexport const Assistants = (h: Html.H<typeof Message.Type>, starred: boolean) =>	TaskTree(h, {		label: "Assistants",		sections: [{			id: starred ? "starred" : "all",			label: starred ? "Starred" : "Your assistants",			assistants: [{				id: "accounts", name: "Accounts", persona: { shape: "hexagon", color: "teal" }, href: "/assistants/accounts", age: "now", starred,				onStar: Message.ToggledStar({ assistant: "accounts", on: !starred }),				tasks: [{ id: "alder-4410", title: "Alder Supply says 4410 is paid", href: "/tasks/alder-4410", age: "now", unread: true }],			}],		}],	})

API reference

Options

TaskTree options
NameTypeDescription
labelrequiredstring—
sectionsrequiredTreeSection<Message>[]—

Source