@spunto/design-system 0.55.0 → 0.56.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -132,6 +132,8 @@ export function TaskDetails({
|
|
|
132
132
|
}: TaskDetailsProps) {
|
|
133
133
|
const sheet = useContext(TaskDetailsSheetContext)
|
|
134
134
|
const meta = task.meta && Object.keys(task.meta).length > 0 ? task.meta : null
|
|
135
|
+
const links = task.links && task.links.length > 0 ? task.links : null
|
|
136
|
+
const metadata = task.metadata && Object.keys(task.metadata).length > 0 ? Object.entries(task.metadata) : null
|
|
135
137
|
const ran = task.completedAt ? taskSpan(task.startedAt ?? task.createdAt, task.completedAt) : null
|
|
136
138
|
|
|
137
139
|
return (
|
|
@@ -155,6 +157,28 @@ export function TaskDetails({
|
|
|
155
157
|
)}
|
|
156
158
|
|
|
157
159
|
<div className={cn("grid grid-cols-2 gap-3", variant === "sidebar" && "mt-3")}>
|
|
160
|
+
{/* First: where the work came from is what a reader arriving from a list asks before anything else. */}
|
|
161
|
+
{links && (
|
|
162
|
+
<div className="col-span-2">
|
|
163
|
+
<Fact label={links.length === 1 ? "Link" : "Links"}>
|
|
164
|
+
<span className="flex flex-wrap gap-x-3 gap-y-1">
|
|
165
|
+
{links.map((link, i) => (
|
|
166
|
+
<a
|
|
167
|
+
key={`${i}-${link.url}`}
|
|
168
|
+
href={link.url}
|
|
169
|
+
target="_blank"
|
|
170
|
+
rel="noreferrer"
|
|
171
|
+
title={link.url}
|
|
172
|
+
className="flex min-w-0 items-center gap-1 text-primary hover:underline"
|
|
173
|
+
>
|
|
174
|
+
<span className="truncate">{link.label}</span>
|
|
175
|
+
<ExternalLinkIcon className="h-3 w-3 shrink-0" />
|
|
176
|
+
</a>
|
|
177
|
+
))}
|
|
178
|
+
</span>
|
|
179
|
+
</Fact>
|
|
180
|
+
</div>
|
|
181
|
+
)}
|
|
158
182
|
{/* Not truncated: a branch name ends in the part that identifies the task. */}
|
|
159
183
|
{task.branch && (
|
|
160
184
|
<div className="col-span-2">
|
|
@@ -229,6 +253,20 @@ export function TaskDetails({
|
|
|
229
253
|
)}
|
|
230
254
|
</Block>
|
|
231
255
|
|
|
256
|
+
{/* For machines, not people — folded, but there to check what an integration attached. */}
|
|
257
|
+
{metadata && (
|
|
258
|
+
<Block variant={variant} title="Metadata" hint={`${metadata.length} key${metadata.length === 1 ? "" : "s"}`} defaultOpen={false}>
|
|
259
|
+
<dl className="grid grid-cols-[auto_1fr] gap-x-3 gap-y-1 font-mono text-[11px]">
|
|
260
|
+
{metadata.map(([key, value]) => (
|
|
261
|
+
<div key={key} className="contents">
|
|
262
|
+
<dt className="text-muted-foreground">{key}</dt>
|
|
263
|
+
<dd className="min-w-0 break-all">{value}</dd>
|
|
264
|
+
</div>
|
|
265
|
+
))}
|
|
266
|
+
</dl>
|
|
267
|
+
</Block>
|
|
268
|
+
)}
|
|
269
|
+
|
|
232
270
|
{/* Only ever filled by a status command that no longer exists — kept for the tasks that ran under it. */}
|
|
233
271
|
{meta && (
|
|
234
272
|
<Block variant={variant} title="Reported" hint="from a removed setting" defaultOpen={false}>
|
|
@@ -19,6 +19,12 @@ export type TaskState = "queued" | "running" | "in-review" | "done" | "failed"
|
|
|
19
19
|
*/
|
|
20
20
|
export type TaskPendingAction = "accepting" | "dropping" | "replying"
|
|
21
21
|
|
|
22
|
+
/** One of a task's `links`: `label` → `url` (http(s)). */
|
|
23
|
+
export interface TaskLink {
|
|
24
|
+
label: string
|
|
25
|
+
url: string
|
|
26
|
+
}
|
|
27
|
+
|
|
22
28
|
/** A task as the list rows, the cockpit and its sidebar draw it. */
|
|
23
29
|
export interface TaskItem {
|
|
24
30
|
id: string
|
|
@@ -33,6 +39,10 @@ export interface TaskItem {
|
|
|
33
39
|
outcomeLabel?: string | null
|
|
34
40
|
/** Legacy: what a removed status command once reported. Drawn as JSON when present. */
|
|
35
41
|
meta?: Record<string, unknown> | null
|
|
42
|
+
/** Pages about the task elsewhere — the card or issue it came from — set by whoever delegated it. */
|
|
43
|
+
links?: TaskLink[] | null
|
|
44
|
+
/** String pairs its caller attached, for machines. Drawn as a key/value list, never interpreted. */
|
|
45
|
+
metadata?: Record<string, string> | null
|
|
36
46
|
error?: string | null
|
|
37
47
|
createdAt: string
|
|
38
48
|
/** When the task last moved — a turn, a state change. What lists sort and date rows on. */
|