From 69d3ffcb7abe538a4994727bb50079a445519242 Mon Sep 17 00:00:00 2001 From: "exe.dev user" Date: Thu, 19 Nov 2026 19:22:49 +0000 Subject: [PATCH] Redesign the agent Dashboard as a visual board Each widget is now a section whose blocks render as separate tiles on a responsive grid, instead of one long stacked card. - Metrics become stat tiles; placeholder values render quietly. - New SVG renderer for line, area, bar and stacked-bar dataset charts (Fluent stays for donut and scatter), with goal bands and gaps for missing values instead of zeros. - Tables preview six rows with "Show all", notes clamp with "Show more", task lists get a progress summary. - Toolbar uses view pills and hosts Add tracker; data sources move to the bottom; widget times are relative and local. - New: metrics progress/trend/tone, an item-status block with a stage stepper, and an optional dataset-chart goal. Agent guidance steers boards toward stat tiles and charts. - iOS skips missing chart values instead of dropping the chart. Co-Authored-By: Claude Opus 5.5 (1M context) --- apps/ios/Roost/DashboardView.swift | 6 +- .../web/src/components/adaptive-dashboard.tsx | 194 ++-- apps/web/src/components/create-tracker.tsx | 17 +- apps/web/src/components/dashboard-chart.tsx | 82 +- apps/web/src/components/dashboard-data.tsx | 2 +- .../src/components/dashboard-svg-chart.tsx | 409 ++++++++ apps/web/src/components/dashboard-widget.tsx | 892 +++++++++++++----- .../web/src/features/dashboards/chart-data.ts | 7 +- .../src/features/dashboards/presentation.ts | 1 + apps/web/src/features/dashboards/schema.ts | 55 +- .../src/routes/agents.$agentId_.dashboard.tsx | 54 +- .../src/server/codex/conversation.server.ts | 2 +- .../web/src/server/dashboards/tools.server.ts | 2 +- .../tests/browser/dashboard-presentation.ts | 22 +- apps/web/tests/browser/trackers.ts | 8 +- apps/web/tests/browser/weather.ts | 8 +- apps/web/tests/dashboard-datasets.test.ts | 14 +- apps/web/tests/dashboards.test.ts | 65 ++ .../dashboard-dark.png | Bin 0 -> 262169 bytes .../dashboard-mobile.png | Bin 0 -> 225407 bytes .../dashboard-redesign-evidence/dashboard.png | Bin 0 -> 256212 bytes 21 files changed, 1432 insertions(+), 408 deletions(-) create mode 100644 apps/web/src/components/dashboard-svg-chart.tsx create mode 100644 docs/dashboard-redesign-evidence/dashboard-dark.png create mode 100644 docs/dashboard-redesign-evidence/dashboard-mobile.png create mode 100644 docs/dashboard-redesign-evidence/dashboard.png diff --git a/apps/ios/Roost/DashboardView.swift b/apps/ios/Roost/DashboardView.swift index d20674a..6956719 100644 --- a/apps/ios/Roost/DashboardView.swift +++ b/apps/ios/Roost/DashboardView.swift @@ -409,9 +409,9 @@ struct DashboardChart: View { return [] } for row in dataset.rows { - guard row.indices.contains(x), row.indices.contains(index), - let value = row[index].number - else { return [] } + guard row.indices.contains(x), row.indices.contains(index) else { return [] } + // Line and bar data may leave a value empty; it is a gap, not zero. + guard let value = row[index].number else { continue } result.append( Point( id: result.count, label: row[x].text, x: row[x].number, value: value, diff --git a/apps/web/src/components/adaptive-dashboard.tsx b/apps/web/src/components/adaptive-dashboard.tsx index cb00a6e..385b9d2 100644 --- a/apps/web/src/components/adaptive-dashboard.tsx +++ b/apps/web/src/components/adaptive-dashboard.tsx @@ -1,13 +1,19 @@ import * as stylex from "@stylexjs/stylex"; import { createRenderer } from "juxi/react"; -import { createContext, useContext, useEffect, useRef, useState } from "react"; +import { + createContext, + type ReactNode, + useContext, + useEffect, + useRef, + useState, +} from "react"; import { changeDashboardPresentation } from "../features/dashboards/functions"; import { DASHBOARD_FOCUS_LABELS, type DashboardFocus, type DashboardPresentation, type DashboardViewProps, - dashboardFocusSchema, dashboardUI, filterDashboardWidgets, validateDashboardPlan, @@ -16,7 +22,7 @@ import type { DashboardDataset, DashboardWidget as Widget, } from "../features/dashboards/schema"; -import { colors } from "../styles/tokens.stylex"; +import { colors, radii } from "../styles/tokens.stylex"; import { DashboardDataSources } from "./dashboard-data"; import { DashboardWidget } from "./dashboard-widget"; import { Button } from "./ui/button"; @@ -65,9 +71,6 @@ function DashboardContents({ }: DashboardContent & { showDataSources?: boolean }) { return ( <> - {showDataSources && datasets.length > 0 && ( - - )}
{widgets.map((widget) => ( ))}
+ {showDataSources && datasets.length > 0 && ( + + )} ); } @@ -109,9 +115,12 @@ export function AdaptiveDashboard({ agentId, presentation, onPresentation, + actions, ...content }: DashboardContent & { agentId: string; + /** Page-level buttons, such as Add tracker, that share the toolbar row. */ + actions?: ReactNode; presentation: DashboardPresentation; onPresentation: (value: DashboardPresentation) => void; onReload: () => Promise; @@ -190,56 +199,63 @@ export function AdaptiveDashboard({ const ordinary = ; return ( - {(presentation.availableFocus.length > 1 || - presentation.canAdapt || - presentation.widgetKey) && ( -
-
- - - {presentation.canAdapt && ( - - )} - {presentation.focus !== null && ( - - )} - {saving && ( - - Updating view… - - )} -
+ Describe a view + + )} + {presentation.focus !== null && ( + + )} + {saving && ( + + Updating view… + + )} + + {actions} {describing && presentation.canAdapt && (
)}
- )} + {error && (

{error} @@ -306,31 +322,51 @@ export function AdaptiveDashboard({ } const styles = stylex.create({ - toolbar: { - marginBottom: 24, - paddingBottom: 16, - borderBottomWidth: 1, - borderBottomStyle: "solid", - borderBottomColor: colors.border, + toolbar: { marginBottom: 22 }, + controls: { + display: "flex", + alignItems: "center", + flexWrap: "wrap", + gap: 8, }, - controls: { display: "flex", alignItems: "center", flexWrap: "wrap", gap: 8 }, - label: { color: colors.muted, fontSize: 12 }, - select: { - fontFamily: "inherit", + pills: { display: "flex", flexWrap: "wrap", gap: 6 }, + pill: { + font: "inherit", fontSize: 13, - color: colors.foreground, - backgroundColor: colors.surface, + minHeight: { default: 32, "@media (max-width: 700px)": 40 }, + paddingInline: 14, + borderRadius: radii.full, borderWidth: 1, borderStyle: "solid", borderColor: colors.border, - borderRadius: 6, - paddingInline: 10, - minHeight: { default: 32, "@media (max-width: 700px)": 44 }, - maxWidth: "100%", - outlineOffset: 3, + backgroundColor: { + default: colors.background, + "@media (hover: hover)": { ":not(:disabled):hover": colors.bubble }, + }, + color: colors.foreground, + cursor: { default: "pointer", ":disabled": "default" }, + outlineOffset: 2, + }, + pillOn: { + borderColor: colors.action, + backgroundColor: { + default: colors.action, + "@media (hover: hover)": { ":not(:disabled):hover": colors.action }, + }, + color: colors.onAccent, + }, + describe: { + borderStyle: "dashed", + borderColor: colors.faint, + backgroundColor: { + default: "transparent", + "@media (hover: hover)": { ":not(:disabled):hover": colors.bubble }, + }, + color: colors.muted, }, + spacer: { flex: 1 }, status: { fontSize: 12, color: colors.muted }, - form: { marginTop: 16, maxWidth: 580 }, + form: { flexBasis: "100%", order: 2, marginTop: 8, maxWidth: 580 }, intentLabel: { display: "block", fontSize: 13, @@ -361,7 +397,9 @@ const styles = stylex.create({ color: colors.onAccent, }, intent: { - marginTop: 12, + flexBasis: "100%", + order: 2, + marginTop: 4, marginBottom: 0, fontSize: 12, color: colors.muted, @@ -373,10 +411,10 @@ const styles = stylex.create({ color: colors.muted, marginBlock: 12, }, + // Each widget is a full-width section; its blocks form the tile grid. grid: { - display: "grid", - gridTemplateColumns: "repeat(auto-fit, minmax(min(100%, 340px), 1fr))", - gap: 20, - alignItems: "start", + display: "flex", + flexDirection: "column", + gap: 40, }, }); diff --git a/apps/web/src/components/create-tracker.tsx b/apps/web/src/components/create-tracker.tsx index 8952da2..5111264 100644 --- a/apps/web/src/components/create-tracker.tsx +++ b/apps/web/src/components/create-tracker.tsx @@ -30,11 +30,13 @@ export function CreateTracker({ return (

{open && ( import("./dashboard-fluent-chart")); @@ -41,17 +34,7 @@ export function DashboardChart({ chart: DatasetChart; dataset?: DashboardDataset; }) { - const container = useRef(null); - const [width, setWidth] = useState(0); - useEffect(() => { - const element = container.current; - if (!element) return; - const observer = new ResizeObserver((entries) => - setWidth(Math.floor(entries[0]?.contentRect.width ?? 0)), - ); - observer.observe(element); - return () => observer.disconnect(); - }, []); + const [container, width] = useElementWidth(); const error = chartDataError(chart, dataset); return (
@@ -65,13 +48,20 @@ export function DashboardChart({ - Loading chart…

}> - {width > 0 ? ( + {width <= 0 ? ( +

Loading chart…

+ ) : chart.style === "donut" || chart.style === "scatter" ? ( + Loading chart…

}> - ) : ( -

Loading chart…

- )} -
+
+ ) : ( + + )}
)}
@@ -79,8 +69,46 @@ export function DashboardChart({ ); } +function DatasetSvgChart({ + chart, + style, + dataset, + width, +}: { + chart: DatasetChart; + style: "line" | "area" | "bar" | "stacked-bar"; + dataset: DashboardDataset; + width: number; +}) { + const x = dataset.columns.findIndex((column) => column.key === chart.x); + const rows = + dataset.columns[x]?.type === "number" + ? [...dataset.rows].sort((a, b) => Number(a[x]) - Number(b[x])) + : dataset.rows; + return ( + String(row[x]))} + series={chart.series.map((series) => { + const index = dataset.columns.findIndex( + (column) => column.key === series.column, + ); + return { + label: series.label, + values: rows.map((row) => + typeof row[index] === "number" ? row[index] : null, + ), + }; + })} + /> + ); +} + const styles = stylex.create({ figure: { margin: 0, minWidth: 0 }, - title: { fontSize: 13, fontWeight: 500, marginBottom: 12 }, + title: { fontSize: 15, fontWeight: 600, marginBottom: 14 }, container: { width: "100%", minWidth: 0, overflowX: "auto" }, }); diff --git a/apps/web/src/components/dashboard-data.tsx b/apps/web/src/components/dashboard-data.tsx index 9706481..826bd9e 100644 --- a/apps/web/src/components/dashboard-data.tsx +++ b/apps/web/src/components/dashboard-data.tsx @@ -104,7 +104,7 @@ const styles = stylex.create({ borderColor: colors.border, borderRadius: 12, padding: 16, - marginBottom: 20, + marginTop: 32, fontSize: 12, backgroundColor: colors.surface, }, diff --git a/apps/web/src/components/dashboard-svg-chart.tsx b/apps/web/src/components/dashboard-svg-chart.tsx new file mode 100644 index 0000000..3071b04 --- /dev/null +++ b/apps/web/src/components/dashboard-svg-chart.tsx @@ -0,0 +1,409 @@ +// biome-ignore-all lint/suspicious/noArrayIndexKey: Chart marks are positional and never reordered. +import * as stylex from "@stylexjs/stylex"; +import { type RefObject, useEffect, useRef, useState } from "react"; +import { colors, fonts } from "../styles/tokens.stylex"; + +export type ChartSeries = { + label: string; + values: readonly (number | null)[]; +}; + +export type ChartGoal = { min: number; max?: number; label?: string }; + +// Theme-derived so every preset and manual light/dark mode stays legible. +export const seriesColors = [ + colors.accent, + colors.review, + colors.action, + colors.muted, +]; + +/** Tracks an element's content width so SVG charts draw at true pixel size. */ +export function useElementWidth(): [ + RefObject, + number, +] { + const element = useRef(null); + const [width, setWidth] = useState(0); + useEffect(() => { + const current = element.current; + if (!current) return; + const observer = new ResizeObserver((entries) => + setWidth(Math.floor(entries[0]?.contentRect.width ?? 0)), + ); + observer.observe(current); + return () => observer.disconnect(); + }, []); + return [element, width]; +} + +const HEIGHT = 200; +const TOP = 14; +const BOTTOM = 26; +const LEFT = 40; +const RIGHT = 8; + +const compact = new Intl.NumberFormat("en", { + notation: "compact", + maximumFractionDigits: 1, +}); +const full = new Intl.NumberFormat("en", { maximumFractionDigits: 2 }); + +function niceStep(range: number, count: number) { + const raw = range / count; + const power = 10 ** Math.floor(Math.log10(raw)); + const fraction = raw / power; + return ( + (fraction <= 1 ? 1 : fraction <= 2 ? 2 : fraction <= 5 ? 5 : 10) * power + ); +} + +/** Shortens ISO dates such as 2026-11-18 to "Nov 18"; other labels pass through. */ +export function axisLabel(label: string) { + const date = /^(\d{4})-(\d{2})-(\d{2})$/.exec(label); + if (date) { + const value = new Date( + Date.UTC(Number(date[1]), Number(date[2]) - 1, Number(date[3])), + ); + return value.toLocaleDateString("en", { + month: "short", + day: "numeric", + timeZone: "UTC", + }); + } + return label.length > 14 ? `${label.slice(0, 13)}…` : label; +} + +// Every `every`th label, plus the last one when it will not crowd its neighbour. +function showLabel(index: number, count: number, every: number) { + if (index % every === 0) + return count - 1 - index >= every || index === count - 1 || every === 1; + return index === count - 1; +} + +export function SvgChart({ + title, + labels, + series, + style, + goal, + width, +}: { + title: string; + labels: readonly string[]; + series: readonly ChartSeries[]; + style: "line" | "area" | "bar" | "stacked-bar"; + goal?: ChartGoal; + width: number; +}) { + const stacked = style === "stacked-bar"; + const totals = labels.map((_, index) => + series.reduce((sum, item) => sum + (item.values[index] ?? 0), 0), + ); + const values = [ + ...(stacked + ? totals + : series.flatMap((item) => + item.values.filter((value) => value !== null), + )), + ...(goal ? [goal.min, goal.max ?? goal.min] : []), + ]; + const step = niceStep( + Math.max(...values, 0) - Math.min(...values, 0) || 1, + 3, + ); + const min = Math.floor(Math.min(0, ...values) / step) * step; + const max = Math.ceil(Math.max(0, ...values) / step) * step || step; + const ticks: number[] = []; + for (let tick = min; tick <= max + step / 2; tick += step) ticks.push(tick); + const plotWidth = Math.max(120, width - LEFT - RIGHT); + const plotHeight = HEIGHT - TOP - BOTTOM; + const y = (value: number) => + TOP + plotHeight - ((value - min) / (max - min)) * plotHeight; + const band = plotWidth / Math.max(1, labels.length); + const center = (index: number) => + style === "line" || style === "area" + ? labels.length === 1 + ? LEFT + plotWidth / 2 + : LEFT + (index / (labels.length - 1)) * plotWidth + : LEFT + band * index + band / 2; + const labelCount = Math.max(2, Math.floor(plotWidth / 72)); + const every = Math.max(1, Math.ceil(labels.length / labelCount)); + const zero = y(Math.max(min, Math.min(0, max))); + const groups = stacked ? 1 : series.length; + const barWidth = Math.max( + 2, + Math.min(28, (band * 0.72) / groups - (groups > 1 ? 2 : 0)), + ); + const missing = labels.map((_, index) => + series.every((item) => item.values[index] === null), + ); + const description = `${title}. ${labels + .map( + (label, index) => + `${label}: ${series + .map( + (item) => + `${series.length > 1 ? `${item.label} ` : ""}${ + item.values[index] === null + ? "not recorded" + : full.format(item.values[index] ?? 0) + }`, + ) + .join(", ")}`, + ) + .join("; ")}${ + goal + ? `. Goal ${full.format(goal.min)}${goal.max === undefined ? "" : `–${full.format(goal.max)}`}` + : "" + }`; + + return ( +
+ {(series.length > 1 || goal || missing.some(Boolean)) && ( +
    + {series.length > 1 && + series.map((item, index) => ( +
  • +
  • + ))} + {goal && ( +
  • +
  • + )} + {missing.some(Boolean) && ( +
  • +
  • + )} +
+ )} + + {ticks.map((tick) => ( + + + + {compact.format(tick)} + + + ))} + {goal && + (goal.max !== undefined && goal.max > goal.min ? ( + + ) : ( + + ))} + {(style === "bar" || style === "stacked-bar") && + labels.map((label, index) => { + if (missing[index]) + return ( + + {`${label}: not recorded`} + + ); + let base = 0; + return series.map((item, seriesIndex) => { + const value = item.values[index]; + if (value === null || value === undefined) return null; + const from = stacked ? base : 0; + const to = from + value; + if (stacked) base = to; + const left = stacked + ? center(index) - barWidth / 2 + : center(index) - + (groups * (barWidth + 2) - 2) / 2 + + seriesIndex * (barWidth + 2); + return ( + + {`${label} · ${item.label}: ${full.format(value)}`} + + ); + }); + })} + {(style === "line" || style === "area") && + series.map((item, seriesIndex) => { + const color = seriesColors[seriesIndex % seriesColors.length]; + // Split at missing values so a gap is never drawn through. + const segments: { x: number; y: number; index: number }[][] = [[]]; + item.values.forEach((value, index) => { + if (value === null) segments.push([]); + else + segments.at(-1)?.push({ x: center(index), y: y(value), index }); + }); + const showDots = labels.length <= 16; + return ( + + {segments + .filter((segment) => segment.length > 0) + .map((segment, index) => ( + + {style === "area" && segment.length > 1 && ( + `L${point.x},${point.y}`) + .join(" ")} L${segment.at(-1)?.x},${zero}Z`} + fill={color} + opacity={0.16} + /> + )} + {segment.length > 1 && ( + `${point.x},${point.y}`) + .join(" ")} + fill="none" + stroke={color} + strokeWidth={2.25} + strokeLinejoin="round" + strokeLinecap="round" + /> + )} + {(showDots || segment.length === 1) && + segment.map((point) => ( + + {`${labels[point.index]} · ${item.label}: ${full.format(item.values[point.index] ?? 0)}`} + + ))} + + ))} + + ); + })} + {labels.map((label, index) => + showLabel(index, labels.length, every) ? ( + + {axisLabel(label)} + + ) : null, + )} + +
+ ); +} + +const styles = stylex.create({ + svg: { display: "block", overflow: "visible", maxWidth: "100%" }, + tick: { + fill: colors.muted, + fontSize: 11, + fontFamily: fonts.sans, + fontVariantNumeric: "tabular-nums", + }, + legend: { + listStyle: "none", + margin: 0, + marginBottom: 10, + padding: 0, + display: "flex", + flexWrap: "wrap", + gap: "4px 14px", + fontSize: 12, + color: colors.muted, + }, + legendItem: { display: "inline-flex", alignItems: "center", gap: 6 }, + swatch: { width: 10, height: 10, borderRadius: 3, flexShrink: 0 }, + goalSwatch: { + backgroundColor: `color-mix(in srgb, ${colors.review} 28%, transparent)`, + }, + missingSwatch: { + borderWidth: 1.5, + borderStyle: "dashed", + borderColor: colors.faint, + boxSizing: "border-box", + }, + goalBand: { + fill: `color-mix(in srgb, ${colors.review} 20%, transparent)`, + }, + goalLine: { stroke: colors.review }, + missing: { + fill: "none", + stroke: colors.faint, + strokeWidth: 1.5, + strokeDasharray: "3 3", + }, +}); diff --git a/apps/web/src/components/dashboard-widget.tsx b/apps/web/src/components/dashboard-widget.tsx index fd827ba..3c56c91 100644 --- a/apps/web/src/components/dashboard-widget.tsx +++ b/apps/web/src/components/dashboard-widget.tsx @@ -1,127 +1,385 @@ // biome-ignore-all lint/suspicious/noArrayIndexKey: Read-only report snapshots allow duplicate labels and cells, with no editable row state to preserve. import * as stylex from "@stylexjs/stylex"; import { Link } from "@tanstack/react-router"; +import { type ReactNode, useEffect, useRef, useState } from "react"; import type { DashboardBlock, DashboardDataset, DashboardWidget as Widget, } from "../features/dashboards/schema"; -import { colors } from "../styles/tokens.stylex"; +import { colors, radii } from "../styles/tokens.stylex"; import { MessageContent } from "./conversation/message-content"; import { DashboardChart } from "./dashboard-chart"; +import { SvgChart, seriesColors, useElementWidth } from "./dashboard-svg-chart"; import { DashboardTracker } from "./dashboard-tracker"; import { DashboardWeather } from "./dashboard-weather"; +import { Badge } from "./ui/badge"; import { Button } from "./ui/button"; +import { cardStyles } from "./ui/card"; + +type Tone = "neutral" | "positive" | "attention"; +type Metric = Extract["items"][number]; +type StatusItem = Extract< + DashboardBlock, + { type: "item-status" } +>["items"][number]; + +const TABLE_PREVIEW_ROWS = 6; function Chart({ block, }: { block: Extract; }) { - const min = Math.min(0, ...block.points.map((point) => point.value)); - const max = Math.max(0, ...block.points.map((point) => point.value)); - const range = max - min || 1; - const y = (value: number) => 150 - ((value - min) / range) * 130; - - const x = (index: number) => - block.points.length === 1 - ? 230 - : 50 + (index / (block.points.length - 1)) * 380; - const width = Math.min(30, 340 / block.points.length); - const axisLabel = (label: string) => - label.length > 20 ? `${label.slice(0, 19)}…` : label; + const [container, width] = useElementWidth(); return (
-
- {block.title} -
- `${point.label}: ${point.value}`).join(", ")}`} - viewBox="0 0 460 185" - {...stylex.props(styles.chart)} - > - - - {new Intl.NumberFormat("en", { notation: "compact" }).format(max)} - - - {new Intl.NumberFormat("en", { notation: "compact" }).format(min)} - - {block.style === "line" && ( +
{block.title}
+
+ {width > 0 && ( + point.label)} + series={[ + { + label: block.title, + values: block.points.map((point) => point.value), + }, + ]} + /> + )} +
+
+ ); +} + +function Sparkline({ values }: { values: readonly (number | null)[] }) { + const numbers = values.filter((value) => value !== null); + const min = Math.min(...numbers); + const range = Math.max(...numbers) - min || 1; + const segments: string[][] = [[]]; + values.forEach((value, index) => { + if (value === null) segments.push([]); + else + segments + .at(-1) + ?.push( + `${(index / (values.length - 1)) * 100},${26 - ((value - min) / range) * 24}`, + ); + }); + return ( +
+
{item.label}
+
+ {item.value} +
+ {percent !== null && ( +
+
+ )} + {item.trend?.some((value) => value !== null) && ( +
+ +
+ )} + {item.note && ( +
+ {item.note} +
+ )} +
+ ); +} + +function TableBlock({ + block, +}: { + block: Extract; +}) { + const [expanded, setExpanded] = useState(false); + const rows = expanded ? block.rows : block.rows.slice(0, TABLE_PREVIEW_ROWS); + return ( + <> +
+ + + {block.columns.map((column, index) => ( + + ))} + + - {block.points.map((point, index) => ( + {rows.map((row, index) => ( - - + {row.map((cell, column) => ( + + ))} ))}
+ {column} +
- {point.label} - {point.value} + {cell} +
- - +
+ {!block.rows.length && ( +

Nothing recorded yet.

+ )} + {block.rows.length > TABLE_PREVIEW_ROWS && ( + + )} + + ); +} + +function NoteBlock({ text }: { text: string }) { + const content = useRef(null); + const [expanded, setExpanded] = useState(false); + const [overflows, setOverflows] = useState(false); + useEffect(() => { + const element = content.current; + if (!element) return; + const measure = () => + setOverflows(element.scrollHeight > element.clientHeight + 2); + measure(); + const observer = new ResizeObserver(measure); + observer.observe(element); + return () => observer.disconnect(); + }, []); + return ( + <> +
+ {text} +
+ {(overflows || expanded) && ( + + )} + + ); +} + +function TasksBlock({ + block, +}: { + block: Extract; +}) { + const done = block.items.filter((item) => item.status === "done").length; + return ( + <> +
+ + {done} of{" "} + {block.items.length} done + +
+