Records with start and end dates, as bars on a schedule.
Nov 2, 2026 – Mar 28, 2027
Roadmap
◆ Beta
PRJ-1Saved views for every layout
PRJ-2SAML sign-in
PRJ-3Bulk edit in the grid
PRJ-4Triage suggestions
PRJ-5Webhook retries
PRJ-6Offline mode for mobile
No dates · Schedule
import { UiSchema } from "@effect/ui"import { Html } from "@effect/ui/html"import * as stylex from "@stylexjs/stylex"import { Schema } from "effect"import { Outcome } from "./ui/uicontext/components/domain/Outcome.ts"import { Item, type Property, Value } from "./ui/uicontext/components/kit/Property.ts"import { Timeline } from "./ui/uicontext/components/kit/Timeline.ts"import { sx } from "./ui/uicontext/components/Sx.ts"import { Toaster } from "./ui/uicontext/components/Toast.ts"import { people } from "./issues.ts"// A quarter's roadmap. Drag a bar to move it or an edge to change one date, or focus it and press// Left or Right (Alt changes the end). The app refuses a target past March, so that bar goes back// and a toast says why. Earlier, Today and Later ask for another range; the app passes it back.const fields: ReadonlyArray<Property> = [ { key: "status", label: "Status", kind: "select", options: [ { value: "planned", label: "Planned", tone: "gray" }, { value: "building", label: "Building", tone: "blue" }, { value: "shipped", label: "Shipped", tone: "green" }, ], }, { key: "lead", label: "Lead", kind: "person", options: people, empty: "No lead" }, { key: "start", label: "Start", kind: "date" }, { key: "target", label: "Target", kind: "date" },]const project = (n: number, title: string, status: string, lead: string | null, start: string | null, target: string | null): Item => ({ id: `prj-${n}`, prefix: `PRJ-${n}`, title, values: { status, lead, start, target },})const roadmap: ReadonlyArray<Item> = [ project(1, "Saved views for every layout", "building", "ada", "2026-11-16", "2026-12-18"), project(2, "SAML sign-in", "building", "alan", "2026-11-23", "2027-01-15"), project(3, "Bulk edit in the grid", "planned", "grace", "2026-12-07", "2027-01-29"), project(4, "Triage suggestions", "planned", "scout", "2027-01-04", "2027-02-26"), project(5, "Webhook retries", "shipped", "alan", "2026-11-02", "2026-11-27"), project(6, "Offline mode for mobile", "planned", null, null, null),]const styles = stylex.create({ frame: { blockSize: 380, inlineSize: "100%" } })const Message = UiSchema.TaggedEnum({ RequestedEditRoadmap: { request: Schema.String, item: Schema.String, key: Schema.String, value: Value }, RequestedRoadmapRange: { from: Schema.String, to: Schema.String }, RequestedRoadmapScale: { scale: Schema.Literals(["day", "week", "month"]) },})export const Roadmap = Html.component({ name: "Roadmap", model: Schema.Struct({ records: Schema.Array(Item), outcomes: Schema.Array(Outcome), from: Schema.String, to: Schema.String, scale: Schema.Literals(["day", "week", "month"]), }), message: Message,}).make({ init: () => ({ records: roadmap, outcomes: [], from: "2026-11-02", to: "2027-03-28", scale: "week" }), update: { RequestedEditRoadmap: ($, { request, item, key, value }) => key === "target" && typeof value === "string" && value > "2027-03-31" ? $.evolve({ outcomes: (o) => [...o.slice(-20), { _tag: "Refused", request, reason: "Targets stay inside the quarter, by March 31." }] }) : $.evolve({ records: (records) => records.map((r) => (r.id === item ? { ...r, values: { ...r.values, [key]: value } } : r)), outcomes: (o) => [...o.slice(-20), { _tag: "Accepted", request }], }), RequestedRoadmapRange: ($, { from, to }) => $.evolve({ from, to }), RequestedRoadmapScale: ($, { scale }) => $.evolve({ scale }), }, view: (h, { records, outcomes, from, to, scale }) => Toaster(h, { children: [h.div.attrs(sx(styles.frame)).children( Timeline(h, { props: { label: "Roadmap", agentId: "timeline:roadmap", records, fields, view: { start: "start", end: "target" }, colorBy: "status", bar: ["lead"], from, to, scale, today: "2026-12-01", milestones: [{ id: "beta", date: "2027-01-15", label: "Beta" }], dependencies: [{ from: "prj-2", to: "prj-4" }], outcomes, controls: true, locale: "en-US", }, onEmit: { RequestedEdit: (edit) => Message.RequestedEditRoadmap(edit), RequestedRange: ({ from, to }) => Message.RequestedRoadmapRange({ from, to }), RequestedScale: ({ scale }) => Message.RequestedRoadmapScale({ scale }), RequestedOpen: () => undefined, RequestedCreate: () => undefined, RequestedAction: () => undefined, RequestedReorder: () => undefined, RequestedView: () => undefined, Selected: () => undefined, }, }), )], }),})Installation
pnpm dlx shadcn@latest add checkfu/uicontext/timelineUsage
import { type Item, type Property, Value } from "./ui/uicontext/components/kit/Property.ts"import { Timeline } from "./ui/uicontext/components/kit/Timeline.ts"const Message = UiSchema.TaggedEnum({ RequestedEditProject: { request: Schema.String, item: Schema.String, key: Schema.String, value: Value }, RequestedRange: { from: Schema.String, to: Schema.String },})export const ProjectTimeline = ( h: Html.H<typeof Message.Type>, projects: ReadonlyArray<Item>, fields: ReadonlyArray<Property>, range: { readonly from: string; readonly to: string },) => Timeline(h, { props: { label: "Projects", records: projects, fields, view: { start: "start", end: "target" }, ...range, controls: true }, onEmit: { RequestedEdit: (edit) => Message.RequestedEditProject(edit), RequestedRange: (next) => Message.RequestedRange(next), RequestedScale: () => undefined, RequestedOpen: () => undefined, RequestedCreate: () => undefined, RequestedAction: () => undefined, RequestedReorder: () => undefined, RequestedView: () => undefined, Selected: () => undefined, }, })API reference
Props
| Name | Type | Default | Description |
|---|---|---|---|
labelrequired | string | — | The view's accessible name, such as the collection's |
agentId | string | — | The id agents know this view by; the label by default |
recordsrequired | Item[] | — | The records to show, in the order the app gives them |
fieldsrequired | Property[] | — | The fields the records share: their kinds, choices and formats |
view | ViewInput | — | How the records show: start and end are the date fields a bar runs between (the first and second date fields by default), with filter, sort and hidden |
colorBy | string | — | A select or person field whose glyph marks the bar's start ("status") |
bar | string[] | — | Fields shown on each bar after its title, compactly (an assignee's avatar, a rating) |
fromrequired | string | — | The first and last day shown, as ISO dates |
torequired | string | — | The last day the timeline shows, as an ISO date |
scale | "day" | "week" | "month" | week | The width of one column: a day, a week or a month; week by default |
today | string | — | Today, as an ISO date: a line marks it |
milestones | TimelineMilestone[] | — | Dated markers drawn across every row, such as a release |
dependencies | TimelineDependency[] | — | Lines between bars; one that's violated (to starts on or before from ends) is red |
readOnly | string | — | Why nothing can be edited; set, every value shows read-only with this reason |
outcomes | Outcome[] | — | How each requested change settled: pending, accepted, or refused with a reason |
locale | string | — | The locale numbers and dates are formatted in; the browser's by default |
controls | boolean | true | Draw Previous, Today, Next and the scale above the timeline; true by default. Previous and Next ask for the range before or after with RequestedRange, the scale with RequestedScale |
Events
| Event | Payload | Description |
|---|---|---|
RequestedEdit | { request: string; item: string; key: string; value: Value } | A value the person changed; answer through outcomes with the same request |
RequestedOpen | { item: string } | Open the record's page |
RequestedCreate | { group?: string; title?: string; values?: Record<string, Value> } | A new record, in the group it was added from ("" for the empty group) |
RequestedAction | { action: string; items: string[] } | One of the view's actions, on these records |
RequestedReorder | { item: string; before: string | null } | Move item before before, or last when it's null |
RequestedView | { view: View } | The person changed how the view shows records (its sort, grouping, widths); pass it back as view |
Selected | { items: string[] } | The selection changed |
RequestedRange | { from: string; to: string } | Asks to show other days, as ISO dates: Previous, Next, or Today when today is outside the range |
RequestedScale | { scale: Scale } | Asks for another column width: a day, a week or a month |
Agent actions
| Action | Description |
|---|---|
MovedBar | Set a bar's start and end, as ISO dates (YYYY-MM-DD); start on or before end |
ActivatedBar | Open a row's item |
Accessibility
- Each bar is focusable and says its dates and what blocks it. A locked bar says why when it has focus or is tapped.