@mechane-ai/elements 0.64.0 → 0.65.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/README.md +18 -17
- package/dist/ai.js +7 -7
- package/dist/{article-BopqPz1K.js → article-BrUa4Wz1.js} +6 -6
- package/dist/article.js +1 -1
- package/dist/catalog.json +59 -15
- package/dist/{categorical-values-8LA9KXhi.js → categorical-values-AXJkMt-Y.js} +1 -1
- package/dist/charts/cartesian.js +1 -1
- package/dist/charts/comparison.js +1 -1
- package/dist/charts/distribution.js +1 -1
- package/dist/charts/figure.js +12 -12
- package/dist/charts/graph.js +1 -1
- package/dist/charts/hierarchy.js +1 -1
- package/dist/charts/image.js +1 -1
- package/dist/charts/matrix.js +1 -1
- package/dist/charts/plot.js +3 -3
- package/dist/charts/relationship.js +1 -1
- package/dist/charts/text.js +1 -1
- package/dist/charts/timeline.js +2 -2
- package/dist/charts/trend.js +1 -1
- package/dist/charts.js +2 -2
- package/dist/{code-block-BjQUIvvw.js → code-block-BDRmjlES.js} +1 -1
- package/dist/collections.js +1 -1
- package/dist/{commands-BI9rWGpb.js → commands-rzsDElrG.js} +2 -2
- package/dist/content/code.js +1 -1
- package/dist/content/diff.js +3 -3
- package/dist/content/link.js +1 -1
- package/dist/content/markdown.js +1 -1
- package/dist/content/tree.js +2 -2
- package/dist/{content-link-C3RAJ2kP.js → content-link-DRaNf1mD.js} +1 -1
- package/dist/content.js +1 -1
- package/dist/{dates-D1v_jiva.js → dates-wu-gKO2C.js} +2 -2
- package/dist/{dumbbell-plot-QGjFMk0X.js → dumbbell-plot-VFajQtEW.js} +3 -3
- package/dist/{embedding-map-D_RNxsCD.js → embedding-map-BqDEmy88.js} +6 -6
- package/dist/feedback.js +1 -1
- package/dist/{figure-frame-CF3298LZ.js → figure-frame-Dd-pOeZN.js} +3 -3
- package/dist/forms/dates.js +1 -1
- package/dist/{forms-DlKhXUlc.js → forms-Bjx7JQ30.js} +1 -1
- package/dist/forms.js +2 -2
- package/dist/{image-grid-BXsgVBnB.js → image-grid-Dpyqxgwy.js} +3 -3
- package/dist/index.js +1 -1
- package/dist/kits/evaluation.js +4 -4
- package/dist/kits/interpretability.js +11 -11
- package/dist/kits/operations.js +6 -6
- package/dist/kits/research.js +128 -149
- package/dist/kits/training.js +5 -5
- package/dist/layout.js +1 -1
- package/dist/lesson.js +3 -3
- package/dist/{markdown-B92daSMP.js → markdown--nfaDoR1.js} +2 -2
- package/dist/mdx.js +6 -6
- package/dist/navigation/commands.js +1 -1
- package/dist/{navigation-D3vnWiVv.js → navigation-Cp3p0gss.js} +1 -1
- package/dist/navigation.js +4 -4
- package/dist/packages/collections/src/table-query.d.ts +4 -3
- package/dist/packages/collections/src/use-collection-controls.d.ts +6 -0
- package/dist/packages/kits/src/research/collection-page.d.ts +3 -4
- package/dist/packages/layout/src/app-shell.d.ts +3 -1
- package/dist/packages/layout/src/index.d.ts +4 -4
- package/dist/packages/layout/src/page-inset.d.ts +5 -0
- package/dist/packages/layout/src/page-layout.d.ts +4 -9
- package/dist/packages/layout/src/page-toolbar.d.ts +1 -2
- package/dist/packages/layout/src/reading-column.d.ts +4 -0
- package/dist/packages/layout/src/record-page.d.ts +4 -6
- package/dist/packages/layout/src/sidebar.d.ts +3 -1
- package/dist/packages/layout/src/workbench.d.ts +2 -6
- package/dist/packages/navigation/src/current-page-click.d.ts +3 -0
- package/dist/packages/navigation/src/index.d.ts +1 -0
- package/dist/{param-DfOYi9wL.js → param-CwT1RvUS.js} +1 -1
- package/dist/{pierre-diff-DP_TXXIt.js → pierre-diff-DuvK3kLF.js} +1 -1
- package/dist/{plot-layout-BfXmAi71.js → plot-layout-CvkeUuG6.js} +2 -2
- package/dist/{plot-surface-UQgDiTVe.js → plot-surface-yy37R4vs.js} +1 -1
- package/dist/{reference-lines-BRHB78Wb.js → reference-lines-AMeDkYlo.js} +1 -1
- package/dist/{scene-DlVQupfw.js → scene-BRhI8XSy.js} +6 -6
- package/dist/scene.js +1 -1
- package/dist/{slope-chart-CjXcvoRJ.js → slope-chart-BMOCaa8R.js} +4 -4
- package/dist/{src-DojhQZKX.js → src-9n2M1V_y.js} +376 -399
- package/dist/{src-DPcnDU5H.js → src-BdyO4PgQ.js} +1 -1
- package/dist/{src-BYmv3_AL.js → src-BgmAkau8.js} +37 -31
- package/dist/{src-BdQGb362.js → src-Bns-5joF.js} +4 -4
- package/dist/{src-BYnmQkDq.js → src-C5SH3jjU.js} +2 -2
- package/dist/{src-BI1xQE7D.js → src-C_E29-DX.js} +46 -32
- package/dist/{src-P19zz_aO.js → src-Tu6d_Pm8.js} +535 -531
- package/dist/styles2.css +14 -40
- package/dist/{time-series-Dg3DZRGx.js → time-series-CTNVqoUQ.js} +8 -8
- package/dist/{timeline-C2IVroD3.js → timeline-DrsDtEIW.js} +4 -4
- package/dist/{token-heatmap-CZtIPU60.js → token-heatmap-DddArdH8.js} +3 -3
- package/dist/{token-predictions-BJ5L-Lrm.js → token-predictions-CBykmPID.js} +3 -3
- package/dist/{transport-D9e0H2we.js → transport-r1QgELf8.js} +4 -4
- package/dist/{tree-diagram-DRAJiqjW.js → tree-diagram-BIJFK4pl.js} +4 -4
- package/dist/{treemap-BdELCV7E.js → treemap-DgmEw_mr.js} +4 -4
- package/dist/{use-tween-COV8bEYL.js → use-tween-BWf44Jy4.js} +1 -1
- package/dist/{violin-plot-DuxqWnuD.js → violin-plot-BYJnv6sG.js} +3 -3
- package/dist/{waterfall-D4ewGb4u.js → waterfall-BNseqMas.js} +4 -4
- package/package.json +1 -1
- package/recipes/allocation-report.tsx +4 -4
- package/recipes/calendar-workspace.tsx +14 -10
- package/recipes/consequential-form.tsx +4 -4
- package/recipes/searchable-collection.tsx +69 -59
- package/recipes/sectioned-report.tsx +17 -18
- package/recipes/session-timeline.tsx +59 -0
- package/recipes/tabbed-workspace.tsx +7 -8
- package/recipes/workspace-files.tsx +94 -0
- package/recipes/workspace-report.tsx +130 -0
- package/skills/extend-elements/SKILL.md +20 -0
- package/skills/review-elements/SKILL.md +10 -7
- package/skills/upgrade-elements/references/releases.md +16 -0
- package/skills/use-elements/SKILL.md +6 -2
- package/skills/use-elements/references/collections.md +8 -2
- package/skills/use-elements/references/editorial-restraint.md +13 -18
- package/skills/use-elements/references/reports.md +4 -1
- package/skills/use-elements/references/workspace.md +18 -14
- package/dist/packages/layout/src/detail-page.d.ts +0 -9
- package/dist/packages/layout/src/page-content.d.ts +0 -5
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { Waterfall } from '@mechane-ai/elements/charts/timeline';
|
|
2
|
+
import type { WaterfallItem } from '@mechane-ai/elements/charts/timeline';
|
|
3
|
+
import { Details } from '@mechane-ai/elements/collections';
|
|
4
|
+
import { PageLayout, PageSection } from '@mechane-ai/elements/layout';
|
|
5
|
+
import { useId, useState } from 'react';
|
|
6
|
+
|
|
7
|
+
type SessionProps = {
|
|
8
|
+
readonly title: string;
|
|
9
|
+
readonly steps: ReadonlyArray<WaterfallItem>;
|
|
10
|
+
readonly durationMs: number;
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
const milliseconds = { style: 'unit', unit: 'millisecond', unitDisplay: 'short' } as const;
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Inspect an agent session's measured activity on a waterfall timeline. Selecting a step by mouse or keyboard reveals
|
|
17
|
+
* its exact recorded result. A step with missing endpoints stays unavailable.
|
|
18
|
+
*/
|
|
19
|
+
export function SessionTimeline({ title, steps, durationMs }: SessionProps) {
|
|
20
|
+
const detailsId = useId();
|
|
21
|
+
const [selectedId, select] = useState<string | null>(null);
|
|
22
|
+
const selected = steps.find((step) => step.id === selectedId);
|
|
23
|
+
|
|
24
|
+
return (
|
|
25
|
+
<PageLayout title={title}>
|
|
26
|
+
<PageSection title="Execution">
|
|
27
|
+
<Waterfall
|
|
28
|
+
title="Session timeline"
|
|
29
|
+
items={steps.map((step) => ({ ...step, controls: detailsId }))}
|
|
30
|
+
start={0}
|
|
31
|
+
end={durationMs}
|
|
32
|
+
locale="en-US"
|
|
33
|
+
rowLabel="Step"
|
|
34
|
+
summaryLabel="Duration"
|
|
35
|
+
emptyLabel="No recorded activity."
|
|
36
|
+
offsetFormat={milliseconds}
|
|
37
|
+
selected={selectedId}
|
|
38
|
+
onSelectedChange={select}
|
|
39
|
+
onClearSelection={() => select(null)}
|
|
40
|
+
/>
|
|
41
|
+
</PageSection>
|
|
42
|
+
<div id={detailsId}>
|
|
43
|
+
{selected !== undefined && (
|
|
44
|
+
<PageSection
|
|
45
|
+
title={selected.label}
|
|
46
|
+
summary={
|
|
47
|
+
<Details
|
|
48
|
+
items={[
|
|
49
|
+
{ label: 'Result', value: selected.detail },
|
|
50
|
+
{ label: 'Duration', value: selected.summary },
|
|
51
|
+
]}
|
|
52
|
+
/>
|
|
53
|
+
}
|
|
54
|
+
/>
|
|
55
|
+
)}
|
|
56
|
+
</div>
|
|
57
|
+
</PageLayout>
|
|
58
|
+
);
|
|
59
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Text } from '@mechane-ai/elements';
|
|
2
2
|
import { useCollectionControls } from '@mechane-ai/elements/collections';
|
|
3
3
|
import { EmptyState } from '@mechane-ai/elements/feedback';
|
|
4
|
-
import {
|
|
4
|
+
import { PageInset, PageLayout } from '@mechane-ai/elements/layout';
|
|
5
5
|
import { ContentTabs } from '@mechane-ai/elements/navigation';
|
|
6
6
|
import type { PageNavigationItem } from '@mechane-ai/elements/navigation';
|
|
7
7
|
import { useState } from 'react';
|
|
@@ -37,7 +37,6 @@ export function TabbedWorkspace({ project, summary, owner, events, views, curren
|
|
|
37
37
|
return (
|
|
38
38
|
<PageLayout
|
|
39
39
|
title={project}
|
|
40
|
-
showNavigation={false}
|
|
41
40
|
navigation={{
|
|
42
41
|
label: 'Project views',
|
|
43
42
|
selectedId: currentView,
|
|
@@ -54,30 +53,30 @@ export function TabbedWorkspace({ project, summary, owner, events, views, curren
|
|
|
54
53
|
id: 'summary',
|
|
55
54
|
label: 'Summary',
|
|
56
55
|
content: (
|
|
57
|
-
<
|
|
56
|
+
<PageInset>
|
|
58
57
|
<Text>{summary}</Text>
|
|
59
|
-
</
|
|
58
|
+
</PageInset>
|
|
60
59
|
),
|
|
61
60
|
},
|
|
62
61
|
{
|
|
63
62
|
id: 'ownership',
|
|
64
63
|
label: 'Ownership',
|
|
65
64
|
content: (
|
|
66
|
-
<
|
|
65
|
+
<PageInset>
|
|
67
66
|
<Text>{owner}</Text>
|
|
68
|
-
</
|
|
67
|
+
</PageInset>
|
|
69
68
|
),
|
|
70
69
|
},
|
|
71
70
|
]}
|
|
72
71
|
/>
|
|
73
72
|
)}
|
|
74
73
|
{currentView === 'activity' && (
|
|
75
|
-
<
|
|
74
|
+
<PageInset>
|
|
76
75
|
{matching.map((event) => (
|
|
77
76
|
<Text key={event.id}>{event.description}</Text>
|
|
78
77
|
))}
|
|
79
78
|
{matching.length === 0 && <EmptyState title="No matching activity" />}
|
|
80
|
-
</
|
|
79
|
+
</PageInset>
|
|
81
80
|
)}
|
|
82
81
|
</PageLayout>
|
|
83
82
|
);
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { Button } from '@mechane-ai/elements';
|
|
2
|
+
import { DataTable, DataTablePlaceholder, Details } from '@mechane-ai/elements/collections';
|
|
3
|
+
import type { DataTableColumn } from '@mechane-ai/elements/collections';
|
|
4
|
+
import { AsyncRegion, EmptyState } from '@mechane-ai/elements/feedback';
|
|
5
|
+
import { PageLayout, PageSection, RecordPage } from '@mechane-ai/elements/layout';
|
|
6
|
+
|
|
7
|
+
export type WorkspaceFile = {
|
|
8
|
+
readonly id: string;
|
|
9
|
+
readonly name: string;
|
|
10
|
+
readonly kind: string;
|
|
11
|
+
readonly size: string;
|
|
12
|
+
readonly uploader: string;
|
|
13
|
+
readonly modified: string;
|
|
14
|
+
readonly path: string;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export type FileRead =
|
|
18
|
+
| { readonly status: 'pending' }
|
|
19
|
+
| { readonly status: 'failed'; readonly retry: () => void }
|
|
20
|
+
| { readonly status: 'ready'; readonly files: ReadonlyArray<WorkspaceFile> };
|
|
21
|
+
|
|
22
|
+
type FilesProps = {
|
|
23
|
+
readonly read: FileRead;
|
|
24
|
+
readonly selectedFile?: WorkspaceFile;
|
|
25
|
+
readonly fileHref: (file: WorkspaceFile) => string;
|
|
26
|
+
readonly folderHref: string;
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
const columns = [
|
|
30
|
+
{ id: 'name', label: 'Name', role: 'primary', cell: (file) => file.name },
|
|
31
|
+
{ id: 'kind', label: 'Type', role: 'text', cell: (file) => file.kind },
|
|
32
|
+
{ id: 'size', label: 'Size', role: 'number', cell: (file) => file.size },
|
|
33
|
+
{ id: 'modified', label: 'Modified (UTC)', role: 'timestamp', cell: (file) => file.modified },
|
|
34
|
+
{ id: 'uploader', label: 'Uploaded by', role: 'text', cell: (file) => file.uploader },
|
|
35
|
+
] satisfies ReadonlyArray<DataTableColumn<WorkspaceFile>>;
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Browse, search and filter workspace files, then inspect file properties. The full-width table shows an empty folder
|
|
39
|
+
* only after a successful read and offers retry on failure.
|
|
40
|
+
*/
|
|
41
|
+
export function WorkspaceFiles({ read, fileHref, folderHref, selectedFile }: FilesProps) {
|
|
42
|
+
if (selectedFile !== undefined) {
|
|
43
|
+
return (
|
|
44
|
+
<RecordPage.Layout backLabel="Files" backHref={folderHref}>
|
|
45
|
+
<RecordPage.Body>
|
|
46
|
+
<RecordPage.Content>
|
|
47
|
+
<RecordPage.Header title={selectedFile.name} />
|
|
48
|
+
<Details
|
|
49
|
+
items={[
|
|
50
|
+
{ label: 'Path', value: selectedFile.path },
|
|
51
|
+
{ label: 'Type', value: selectedFile.kind },
|
|
52
|
+
{ label: 'Size', value: selectedFile.size },
|
|
53
|
+
{ label: 'Modified (UTC)', value: selectedFile.modified },
|
|
54
|
+
{ label: 'Uploaded by', value: selectedFile.uploader },
|
|
55
|
+
]}
|
|
56
|
+
/>
|
|
57
|
+
</RecordPage.Content>
|
|
58
|
+
</RecordPage.Body>
|
|
59
|
+
</RecordPage.Layout>
|
|
60
|
+
);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
const placeholder = <DataTablePlaceholder columns={columns} caption="Loading files" />;
|
|
64
|
+
|
|
65
|
+
return (
|
|
66
|
+
<PageLayout title="Files">
|
|
67
|
+
<PageSection title="Shared files">
|
|
68
|
+
{read.status === 'pending' ? (
|
|
69
|
+
<AsyncRegion state="pending" label="Loading files" placeholder={placeholder} />
|
|
70
|
+
) : read.status === 'failed' ? (
|
|
71
|
+
<EmptyState title="Files unavailable" action={<Button onClick={read.retry}>Try again</Button>} />
|
|
72
|
+
) : (
|
|
73
|
+
<AsyncRegion state="ready" label="Files" placeholder={placeholder}>
|
|
74
|
+
<DataTable
|
|
75
|
+
caption="Shared files"
|
|
76
|
+
hideCaption
|
|
77
|
+
rows={read.files}
|
|
78
|
+
columns={columns}
|
|
79
|
+
getRowId={(file) => file.id}
|
|
80
|
+
query={{
|
|
81
|
+
mode: 'local',
|
|
82
|
+
search: (file) => file.name,
|
|
83
|
+
filters: [{ id: 'kind', label: 'Type', value: (file) => file.kind }],
|
|
84
|
+
}}
|
|
85
|
+
empty="This folder is empty."
|
|
86
|
+
filteredEmpty="No files match these filters."
|
|
87
|
+
rowAction={{ href: fileHref, label: (file) => `Open ${file.name}` }}
|
|
88
|
+
/>
|
|
89
|
+
</AsyncRegion>
|
|
90
|
+
)}
|
|
91
|
+
</PageSection>
|
|
92
|
+
</PageLayout>
|
|
93
|
+
);
|
|
94
|
+
}
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import { SmallMultiples } from '@mechane-ai/elements/charts/cartesian';
|
|
2
|
+
import { DataTable, Details, Metric, MetricGrid } from '@mechane-ai/elements/collections';
|
|
3
|
+
import type { DataTableColumn } from '@mechane-ai/elements/collections';
|
|
4
|
+
import { PageLayout, PageSection, RecordPage } from '@mechane-ai/elements/layout';
|
|
5
|
+
|
|
6
|
+
export type ReportDay = {
|
|
7
|
+
readonly date: string;
|
|
8
|
+
readonly runs: number;
|
|
9
|
+
readonly failed: number;
|
|
10
|
+
readonly queueSeconds: number | null;
|
|
11
|
+
readonly executionSeconds: number | null;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
type ReportProps = {
|
|
15
|
+
readonly days: ReadonlyArray<ReportDay>;
|
|
16
|
+
readonly selectedDay?: ReportDay;
|
|
17
|
+
readonly dayHref: (day: ReportDay) => string;
|
|
18
|
+
readonly reportHref: string;
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
function duration(value: number | null): string {
|
|
22
|
+
return value === null ? 'Not measured' : `${value} s`;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
const columns = [
|
|
26
|
+
{ id: 'date', label: 'Day (UTC)', role: 'primary', cell: (day) => day.date },
|
|
27
|
+
{ id: 'runs', label: 'Runs', role: 'number', cell: (day) => day.runs },
|
|
28
|
+
{ id: 'failed', label: 'Failed', role: 'number', cell: (day) => day.failed },
|
|
29
|
+
{ id: 'queue', label: 'Median queue', role: 'number', cell: (day) => duration(day.queueSeconds) },
|
|
30
|
+
{ id: 'execution', label: 'Median execution', role: 'number', cell: (day) => duration(day.executionSeconds) },
|
|
31
|
+
] satisfies ReadonlyArray<DataTableColumn<ReportDay>>;
|
|
32
|
+
|
|
33
|
+
const measures = [
|
|
34
|
+
{ id: 'queueSeconds', title: 'Time in queue', tone: 'series1' },
|
|
35
|
+
{ id: 'executionSeconds', title: 'Execution time', tone: 'series2' },
|
|
36
|
+
] as const;
|
|
37
|
+
|
|
38
|
+
const seconds = { style: 'unit', unit: 'second', maximumFractionDigits: 1 } as const;
|
|
39
|
+
const formatDate = new Intl.DateTimeFormat('en-US', { month: 'short', day: 'numeric', timeZone: 'UTC' });
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Build a workspace dashboard with linked charts, metrics and a drill-down table. The sidebar and workspace picker
|
|
43
|
+
* persist across destinations, and missing observations stay unknown.
|
|
44
|
+
*/
|
|
45
|
+
export function WorkspaceReport({ days, selectedDay, dayHref, reportHref }: ReportProps) {
|
|
46
|
+
if (selectedDay !== undefined) {
|
|
47
|
+
return (
|
|
48
|
+
<RecordPage.Layout backLabel="Deployment timings" backHref={reportHref}>
|
|
49
|
+
<RecordPage.Body>
|
|
50
|
+
<RecordPage.Content>
|
|
51
|
+
<RecordPage.Header title={selectedDay.date} description="Deployment timings · UTC" />
|
|
52
|
+
<Details
|
|
53
|
+
items={[
|
|
54
|
+
{ label: 'Completed runs', value: selectedDay.runs },
|
|
55
|
+
{ label: 'Failed runs', value: selectedDay.failed },
|
|
56
|
+
{ label: 'Median queue', value: duration(selectedDay.queueSeconds) },
|
|
57
|
+
{ label: 'Median execution', value: duration(selectedDay.executionSeconds) },
|
|
58
|
+
]}
|
|
59
|
+
/>
|
|
60
|
+
</RecordPage.Content>
|
|
61
|
+
</RecordPage.Body>
|
|
62
|
+
</RecordPage.Layout>
|
|
63
|
+
);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
const charts = measures.map(({ id, title, tone }) => ({
|
|
67
|
+
id,
|
|
68
|
+
title,
|
|
69
|
+
valueFormat: seconds,
|
|
70
|
+
series: [
|
|
71
|
+
{
|
|
72
|
+
id,
|
|
73
|
+
label: 'Median',
|
|
74
|
+
tone,
|
|
75
|
+
points: days.map((day) => ({ timestamp: Date.parse(`${day.date}T00:00:00Z`), value: day[id] })),
|
|
76
|
+
},
|
|
77
|
+
],
|
|
78
|
+
}));
|
|
79
|
+
|
|
80
|
+
return (
|
|
81
|
+
<PageLayout title="Deployment timings">
|
|
82
|
+
<PageSection
|
|
83
|
+
title="Run history"
|
|
84
|
+
summary={
|
|
85
|
+
<MetricGrid layout="columns">
|
|
86
|
+
<Metric
|
|
87
|
+
label="Completed runs"
|
|
88
|
+
value={days.reduce((sum, day) => sum + day.runs, 0).toLocaleString('en-US')}
|
|
89
|
+
/>
|
|
90
|
+
<Metric
|
|
91
|
+
label="Failed runs"
|
|
92
|
+
value={days.reduce((sum, day) => sum + day.failed, 0).toLocaleString('en-US')}
|
|
93
|
+
/>
|
|
94
|
+
</MetricGrid>
|
|
95
|
+
}
|
|
96
|
+
>
|
|
97
|
+
<SmallMultiples
|
|
98
|
+
charts={charts}
|
|
99
|
+
timestampUnit="milliseconds"
|
|
100
|
+
timeFormat={(time) => formatDate.format(time)}
|
|
101
|
+
height="compact"
|
|
102
|
+
locale="en-US"
|
|
103
|
+
/>
|
|
104
|
+
</PageSection>
|
|
105
|
+
<PageSection title="Daily timings">
|
|
106
|
+
<DataTable
|
|
107
|
+
rows={days}
|
|
108
|
+
columns={columns}
|
|
109
|
+
getRowId={(day) => day.date}
|
|
110
|
+
caption="Daily timings"
|
|
111
|
+
hideCaption
|
|
112
|
+
query={{
|
|
113
|
+
mode: 'local',
|
|
114
|
+
search: (day) => day.date,
|
|
115
|
+
filters: [
|
|
116
|
+
{
|
|
117
|
+
id: 'timing',
|
|
118
|
+
label: 'Timing samples',
|
|
119
|
+
value: (day) => (day.queueSeconds === null ? 'Missing' : 'Measured'),
|
|
120
|
+
},
|
|
121
|
+
],
|
|
122
|
+
}}
|
|
123
|
+
empty="No deployments in this workspace."
|
|
124
|
+
filteredEmpty="No days match this search."
|
|
125
|
+
rowAction={{ href: dayHref, label: (day) => `Open timings for ${day.date}` }}
|
|
126
|
+
/>
|
|
127
|
+
</PageSection>
|
|
128
|
+
</PageLayout>
|
|
129
|
+
);
|
|
130
|
+
}
|
|
@@ -16,6 +16,26 @@ is the guide for the pinned SDK. Use an existing UI SDK behavior where one fits.
|
|
|
16
16
|
and agent actions. Use the family's StyleX tokens and density choices and export the supported API from its public
|
|
17
17
|
entry.
|
|
18
18
|
|
|
19
|
+
## Correct the default at its owner
|
|
20
|
+
|
|
21
|
+
For a recurrent consumer bug, start with the ordinary composition in the affected family story. Reproduce it with the
|
|
22
|
+
public props a new user would choose. Include the package recipe or shipped skill that recommended those props.
|
|
23
|
+
|
|
24
|
+
Aim for the global maximum. If we were implementing the current features and the requested change from scratch, which
|
|
25
|
+
component would own this decision? Choose the design with the clearest public API across callers. Replace the old API
|
|
26
|
+
when the better design calls for it. Backwards compatibility is a requirement only on explicit request. Update
|
|
27
|
+
maintained callers and remove the workaround together. Keep product-specific routing, data and permissions in their
|
|
28
|
+
owning application.
|
|
29
|
+
|
|
30
|
+
Use a named slot for a recurring role such as a workspace selector. Put the unusual appearance behind a call that reads
|
|
31
|
+
differently, such as `PageInset` or `ReadingColumn`. If modes require mutually exclusive inputs, express that constraint
|
|
32
|
+
in the type. A family of styling booleans or a warning in the README leaves the decision in every caller.
|
|
33
|
+
|
|
34
|
+
For a geometry regression, compare the bounds of the simplest shared composition with the consumer at desktop and phone
|
|
35
|
+
widths. For a navigation regression, hold the destination read and observe the first frame after activation. Identify
|
|
36
|
+
the boundary where the behavior first diverges. Exercise that boundary in the existing story or consumer check. Update
|
|
37
|
+
the contract and whichever recipe, application skill or review instruction taught the old pattern.
|
|
38
|
+
|
|
19
39
|
## A UI SDK component first
|
|
20
40
|
|
|
21
41
|
Wrap the SDK component when one names the interaction, and add only the Elements styling and the supported props.
|
|
@@ -32,7 +32,9 @@ Hold a slow read, fail one, and return an empty result.
|
|
|
32
32
|
- A refresh keeps the last result, its focus and any draft on screen, with progress or the failure beside it.
|
|
33
33
|
- A failed first read shows a `Notice` with Retry in place. A successful empty result shows an `EmptyState`.
|
|
34
34
|
- Each failure has one presentation. Not a banner and a toast for the same error.
|
|
35
|
-
-
|
|
35
|
+
- Hold a destination read or route module open. Activate its link, then try Back and Forward. On the first rendered
|
|
36
|
+
frame the old heading, rows and record actions have left the changing region, and the shell stays usable. Release
|
|
37
|
+
responses out of order and confirm only the current destination can appear. Repeat for a record selected by URL.
|
|
36
38
|
- A pending save disables a second submit. A failed save keeps the draft.
|
|
37
39
|
|
|
38
40
|
## 3. Width and pointer
|
|
@@ -42,7 +44,10 @@ Check 360 pixels wide, a tablet width and a wide desktop.
|
|
|
42
44
|
- The page never scrolls sideways. A wide table or plot scrolls inside its own region.
|
|
43
45
|
- Toolbar actions wrap below their title. Long labels wrap or truncate with the full value available elsewhere.
|
|
44
46
|
- With a coarse pointer, standalone controls give 44px targets and text fields use 16px text.
|
|
45
|
-
-
|
|
47
|
+
- Compare the left and right bounds of a section heading, its table and the containing pane. All three span the same
|
|
48
|
+
width, including at phone width. Compare text positions inside cells separately.
|
|
49
|
+
- In the expanded sidebar and phone drawer, compare the workspace selector's outer edges with the surrounding navigation
|
|
50
|
+
row backgrounds. Collapse the sidebar and check the selector and its Tab stop disappear.
|
|
46
51
|
|
|
47
52
|
## 4. Theme and motion
|
|
48
53
|
|
|
@@ -121,15 +126,13 @@ and its readout.
|
|
|
121
126
|
|
|
122
127
|
- **Zero floating clutter on hover.** Hovering table rows must not pop tooltips over adjacent rows, and hovering charts
|
|
123
128
|
must use inline readouts that never obscure curves or clip at container edges.
|
|
124
|
-
- **Aligned gutters.** Every section heading aligns vertically with its body content (`PageSection` insets `summary` and
|
|
125
|
-
`children` automatically; `breakdown` and `CollectionPage` tables span full width edge-to-edge).
|
|
126
129
|
- **Zero card bloat.** Metrics use flat `MetricGrid`, lists use full-width `CollectionPage` / `DataTable`, and
|
|
127
130
|
documentation renders flat—not inside stacked bordered `Panel` cards.
|
|
128
131
|
- **Zero instructional slop.** Remove chart `description` text that explains how to hover/click or repeats the
|
|
129
|
-
title/legend/axes. Keep
|
|
132
|
+
title/legend/axes. Keep a dashboard’s charts and tables together when readers need them for the same comparison.
|
|
130
133
|
- **Pinned shell & area-forking rail.** Scrolling `<main>` keeps the rail and sidebar fixed; rail icons fork top-level
|
|
131
|
-
areas rather than duplicating sidebar links; theme/environment controls live behind `railFooter` Settings
|
|
132
|
-
|
|
134
|
+
areas rather than duplicating sidebar links; theme/environment controls live behind `railFooter` Settings while
|
|
135
|
+
explicit refresh actions belong to the data they update.
|
|
133
136
|
|
|
134
137
|
Not covered by this review: a real screen reader, a physical touch device and right-to-left text. Say so in the report
|
|
135
138
|
unless you ran them.
|
|
@@ -2,6 +2,22 @@
|
|
|
2
2
|
|
|
3
3
|
Newest first. Each section lists what an application must change, then what it may adopt.
|
|
4
4
|
|
|
5
|
+
## 0.65.0
|
|
6
|
+
|
|
7
|
+
- Remove `showNavigation` from page toolbars. In a workspace, the shell supplies navigation alongside a leading back
|
|
8
|
+
action. Standalone pages and the shell's focus mode automatically omit the toggle.
|
|
9
|
+
- Provide a table, calendar grid or other full-width surface as `PageSection` children. Move a former `breakdown` value
|
|
10
|
+
into children. Use `summary` for inset metrics. Wrap a form or reading block that relied on the old child inset in
|
|
11
|
+
`PageInset`. Replace an existing `PageContent` wrapper with `PageInset` only where a local inset is intended.
|
|
12
|
+
- Remove wide or full-bleed `DetailPage` wrappers. Put sections directly in the layout. Replace centered `DetailPage`
|
|
13
|
+
uses with `ReadingColumn` when the content needs a bounded line length.
|
|
14
|
+
- Remove `isFlush` from `WorkbenchScroll`. Its children and `RecordPage.Body` now span their pane. Wrap only the leaf
|
|
15
|
+
form or explanation in `PageInset` when it needs space.
|
|
16
|
+
- Supply an inspector to `Workbench` when it is needed. Its desktop split is resizable by default. Remove `isResizable`
|
|
17
|
+
and `inspectorInitialPercent`. Use `PageInset` for inset text inside the inspector.
|
|
18
|
+
- Move workspace selectors into `AppShell.sidebarControls`. The shell aligns controls with the navigation rows and
|
|
19
|
+
handles the collapsed sidebar and the phone drawer.
|
|
20
|
+
|
|
5
21
|
## 0.49.1
|
|
6
22
|
|
|
7
23
|
Fixes from the first essay ported onto the teaching layers. No import changes. An essay written for 0.48 type checks
|
|
@@ -73,11 +73,15 @@ persistence and every asynchronous operation.
|
|
|
73
73
|
|
|
74
74
|
## Start from a recipe
|
|
75
75
|
|
|
76
|
-
- **
|
|
76
|
+
- **Workspace dashboard.** Look up `workspace-report` for linked charts, metrics and a drill-down table inside a
|
|
77
|
+
persistent shell. Look up `workspace-files` for loading, empty and detail views, or `session-timeline` for agent
|
|
78
|
+
activity. Each recipe's catalog entry names a runnable Storybook example.
|
|
79
|
+
- **Searchable collection.** Use `CollectionPage` for a complete finite collection. For a paged source, send search and
|
|
77
80
|
filters to the data owner before it takes a page. Keep the query and current page together in route state when users
|
|
78
81
|
need to return to the same results.
|
|
79
82
|
- **Sectioned report.** Mount the shell around the router outlet. Put each heading and its body in a sibling
|
|
80
|
-
`PageSection`.
|
|
83
|
+
`PageSection`. Headers and tables span the pane by default. Use `PageInset` around local prose or forms and
|
|
84
|
+
`AppShell.sidebarControls` for a workspace picker.
|
|
81
85
|
- **Linked figures.** Give each model, run or series one id. Wrap the figures in `ToneScope` and `ChartLink` so a thing
|
|
82
86
|
keeps one hue and inspecting it in one figure marks it in the others.
|
|
83
87
|
- **A chart you cannot name.** Read `chartGuide` from `/charts/figure`, or the chooser in
|
|
@@ -49,7 +49,8 @@ An explicit type annotation widens the columns and then requires the controlled
|
|
|
49
49
|
- Rows are 48px and text truncates. Set `rowSizing="content"` for records that need several lines.
|
|
50
50
|
- Use `DataTableText` for a primary string with an optional second line.
|
|
51
51
|
- Mark a column `isSecondary` to hide it at the compact breakpoint.
|
|
52
|
-
- The table owns its cell insets.
|
|
52
|
+
- The table owns its cell insets. Place it directly inside the page or section. Wrap an adjacent form or prose block in
|
|
53
|
+
`PageInset` when it needs an inset.
|
|
53
54
|
|
|
54
55
|
## Opening, selecting and paging
|
|
55
56
|
|
|
@@ -61,7 +62,8 @@ An explicit type annotation widens the columns and then requires the controlled
|
|
|
61
62
|
from the row count.
|
|
62
63
|
- `window` limits the mounted rows of a long page. It does not fetch. Use `CollectionEnd` for loading more, with its
|
|
63
64
|
ready, loading, retry and complete states.
|
|
64
|
-
- Pass `resultStatus` while a read is pending or failed
|
|
65
|
+
- Pass `resultStatus` while a read is pending or failed. Keep rows during a refresh of the same collection. Clear them
|
|
66
|
+
when switching destination, workspace or viewer.
|
|
65
67
|
|
|
66
68
|
## The control row
|
|
67
69
|
|
|
@@ -69,6 +71,10 @@ A local or controlled query renders its own search and filters. For a custom hea
|
|
|
69
71
|
the current values and callbacks. It returns `actions`, `chips`, `onKeyDown` and `openSearch`. Put the actions in the
|
|
70
72
|
page or section header and the chips below them in a `CollectionToolbar`.
|
|
71
73
|
|
|
74
|
+
A `CollectionPage` exposes its search and filters even beside route navigation. In a custom collection using
|
|
75
|
+
`useCollectionControls`, spread `controls.findRegion` on the element enclosing the results and controls to enable its
|
|
76
|
+
scoped Find shortcuts. A menu or editor keeps its own keys.
|
|
77
|
+
|
|
72
78
|
The control row is one toolbar. Tab enters it once, and the arrow keys move between chips, find, filters and display
|
|
73
79
|
options. The search field releases the arrows only from the end of its text. Do not add a second Tab stop or a custom
|
|
74
80
|
key handler around it.
|
|
@@ -2,22 +2,18 @@
|
|
|
2
2
|
|
|
3
3
|
Elements apps are calm, hairline-divided analytical workspaces—not card grids or prose-heavy dashboards.
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## Dashboard composition
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
- Prefer smaller, click-through pages and right-hand `Workbench` / `Drawer` inspectors over vertical stacks of four or
|
|
12
|
-
more charts.
|
|
7
|
+
Group the views a reader needs for one decision. For a usage dashboard, headline metrics and time series help the reader
|
|
8
|
+
locate a spike. Keep the per-day breakdown directly below when the user needs to inspect that spike. Link to a record or
|
|
9
|
+
open an inspector for its details. The `workspace-report` catalog recipe shows this composition. Give an independent
|
|
10
|
+
investigation its own route.
|
|
13
11
|
|
|
14
|
-
##
|
|
12
|
+
## Section geometry
|
|
15
13
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
- Do **not** wrap metric strips, tables, list items, or documentation in bordered `Panel` cards. Hairline dividers and
|
|
20
|
-
consistent gutters already separate sections cleanly.
|
|
14
|
+
Place a full-width table directly inside `PageSection`. Keep an inset summary in `PageSection.summary`, and reading
|
|
15
|
+
content in `PageInset`. Headers, tables and plots supply their own visual structure. Use a `Panel` for a unit that needs
|
|
16
|
+
its own boundary, such as a separate decision.
|
|
21
17
|
|
|
22
18
|
## Zero-slop copy budget
|
|
23
19
|
|
|
@@ -33,8 +29,7 @@ Elements apps are calm, hairline-divided analytical workspaces—not card grids
|
|
|
33
29
|
|
|
34
30
|
- **Area-forking rail:** Put top-level areas in `AppShell.rail` and Settings/account controls in `AppShell.railFooter`.
|
|
35
31
|
Swap `AppShell.sidebar` to show only the active area's pages—never duplicate every page on both the rail and sidebar.
|
|
36
|
-
-
|
|
37
|
-
|
|
38
|
-
-
|
|
39
|
-
|
|
40
|
-
Never hand-wire search inputs or filter dropdowns in the page body.
|
|
32
|
+
- Keep successful background reads quiet. A pending explicit refresh belongs on the action the user pressed. Show
|
|
33
|
+
stale-data or failure feedback beside affected records with a useful recovery action.
|
|
34
|
+
- Use `CollectionPage` for a finite, locally searchable collection. Use a controlled `DataTable` when a server owns
|
|
35
|
+
paging, filtering or sorting. Searching only the loaded page gives incomplete results.
|
|
@@ -2,7 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
Give the route a `LoadingScope` from `/feedback` with a navigation identity. Keep the shell mounted. Wrap the entering
|
|
4
4
|
page in one `ContentReveal` so its heading and body enter together. A selection change inside a page should preserve the
|
|
5
|
-
controls and focus.
|
|
5
|
+
controls and focus. When a link, history entry or record selection opens a different destination, retire its outgoing
|
|
6
|
+
content immediately, including any actions or agent handles for that content. The destination can render cached content
|
|
7
|
+
or reserve its pending area while the read or route module loads. A placeholder delay controls only when the placeholder
|
|
8
|
+
becomes visible.
|
|
6
9
|
|
|
7
10
|
Render the **same** `AsyncRegion` across a read's pending and ready states. Pass a skeleton matching the result geometry
|
|
8
11
|
as its placeholder. Mounting the region only in the pending branch discards its history and skips the ready fade. Group
|
|
@@ -3,7 +3,9 @@
|
|
|
3
3
|
Mount one `AppShell` around the router outlet. `AppShell` locks the viewport at `100dvh` with an independent scrolling
|
|
4
4
|
`<main>` column so the rail and sidebar stay pinned without custom CSS. Put top-level areas in `rail`, swap `sidebar` to
|
|
5
5
|
show only the active area's pages, and put Settings/account controls in `railFooter`. On a phone use the shell's drawer
|
|
6
|
-
and its navigation callback.
|
|
6
|
+
and its navigation callback. Put the workspace selector in `sidebarControls`. The shell aligns it with navigation rows
|
|
7
|
+
and hides it in icon-only navigation. For a custom internal route adapter, use `isCurrentPageClick` from `/navigation`
|
|
8
|
+
before intercepting an anchor activation. Leave modified clicks, downloads and other browsing contexts to the browser.
|
|
7
9
|
|
|
8
10
|
Place workspace-wide bottom controls in `AppShell.bottomBar`. The row takes its content's actual height, including the
|
|
9
11
|
bottom safe area. Nested pages fill the remaining space. Bottom toasts clear the row even when its height changes. For
|
|
@@ -11,19 +13,21 @@ DevTools, call `useDevToolsBar` once in the signed-in shell with an app-specific
|
|
|
11
13
|
`isVisible ? <DevToolsBar /> : null` to the slot. The shortcut is Command–Option–Shift–Backslash. The bar uses the
|
|
12
14
|
toolbar height by default. Set `--mechane-devtools-bar-height` on the shell's ancestor to change its minimum height.
|
|
13
15
|
|
|
14
|
-
Compose `PageSection` directly inside `PageLayout`.
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
16
|
+
Compose `PageSection` directly inside `PageLayout`. The section heading and ordinary children span the pane. Place a
|
|
17
|
+
`DataTable` or `EventMonth` directly in the children. The table owns the space inside its cells. Use
|
|
18
|
+
`PageSection.summary` for an inset summary or wrap a form or prose block in `PageInset` where it belongs. The
|
|
19
|
+
`calendar-workspace` recipe shows the full-width month and a separate inset agenda.
|
|
20
|
+
|
|
21
|
+
Place a working surface directly in `PageLayout`, `RecordPage.Body` or `WorkbenchScroll`. Use `ReadingColumn` for
|
|
22
|
+
centered prose or a form with a bounded line length. Keep a wide plot's horizontal scroll inside its figure. Compare
|
|
23
|
+
both outer edges of each section header and table to the working pane at each viewport width. An inspector or drawer can
|
|
24
|
+
be its own working pane.
|
|
25
|
+
|
|
26
|
+
Use `CollectionPage` from `/kits/research` when the full collection is in memory. It wires `PageLayout`, top-bar search
|
|
27
|
+
& filter controls (`/` and `⌘F`), `CollectionToolbar` filter chips, full-width `DataTable`, and an optional resizable
|
|
28
|
+
`Workbench` inspector in one component. With route navigation, the navigation row holds the collection controls. For
|
|
29
|
+
server paging, follow the `searchable-collection` recipe. Its controlled `DataTable` sends query and sort changes to the
|
|
30
|
+
data owner before paging.
|
|
27
31
|
|
|
28
32
|
Use `SegmentedControl` from `/forms` to switch between a few views; one item is always checked. Use `ToggleGroup` for
|
|
29
33
|
independent pressed choices. Both size to their content. Put either beside an Elements field and select, compare their
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { ReactNode } from 'react';
|
|
2
|
-
type DetailPageProps = {
|
|
3
|
-
readonly children: ReactNode;
|
|
4
|
-
readonly isWide?: boolean;
|
|
5
|
-
/** Remove outer inset on a wide edge-to-edge canvas. Defaults to false so wide content aligns with page headers. */
|
|
6
|
-
readonly isBleed?: boolean;
|
|
7
|
-
};
|
|
8
|
-
export declare function DetailPage({ children, isWide, isBleed }: DetailPageProps): ReactNode;
|
|
9
|
-
export {};
|