@mechane-ai/elements 0.64.0 → 0.67.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 +39 -27
- package/dist/ai.js +285 -203
- package/dist/{article-BopqPz1K.js → article-anMy8fA5.js} +6 -6
- package/dist/article.js +1 -1
- package/dist/catalog.json +137 -46
- package/dist/{categorical-values-8LA9KXhi.js → categorical-values-Bh7ZkEQn.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-DbW_t9U4.js} +1 -1
- package/dist/collections.js +1 -1
- package/dist/{commands-BI9rWGpb.js → commands-C7Zrp-tG.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-BN4NPp0u.js} +1 -1
- package/dist/content.js +1 -1
- package/dist/{dates-D1v_jiva.js → dates-OTq-xU33.js} +2 -2
- package/dist/{dumbbell-plot-QGjFMk0X.js → dumbbell-plot-BQDGe0sQ.js} +3 -3
- package/dist/{embedding-map-D_RNxsCD.js → embedding-map-DmmknG7A.js} +6 -6
- package/dist/feedback.js +1 -1
- package/dist/{figure-frame-CF3298LZ.js → figure-frame-DlyNTDzh.js} +22 -21
- package/dist/forms/dates.js +1 -1
- package/dist/{forms-DlKhXUlc.js → forms-iAOjGRTO.js} +1 -1
- package/dist/forms.js +2 -2
- package/dist/{image-grid-BXsgVBnB.js → image-grid-CxEAQvTf.js} +3 -3
- package/dist/index.js +1 -1
- package/dist/kits/evaluation.js +13 -13
- package/dist/kits/interpretability.js +47 -43
- package/dist/kits/operations.js +80 -79
- package/dist/kits/research.js +364 -520
- package/dist/kits/training.js +108 -107
- package/dist/layout.js +1 -1
- package/dist/lesson.js +3 -3
- package/dist/{markdown-B92daSMP.js → markdown-Diffqqm7.js} +2 -2
- package/dist/mdx.js +6 -6
- package/dist/navigation/commands.js +1 -1
- package/dist/{navigation-D3vnWiVv.js → navigation-CTnYtVD8.js} +1 -1
- package/dist/navigation.js +4 -4
- package/dist/packages/ai/src/index.d.ts +2 -0
- package/dist/packages/ai/src/message-reactions.d.ts +51 -0
- package/dist/packages/ai/src/message.d.ts +3 -1
- package/dist/packages/collections/src/card-columns-model.d.ts +50 -0
- package/dist/packages/collections/src/card-columns.d.ts +30 -0
- package/dist/packages/collections/src/collection-page.d.ts +43 -0
- package/dist/packages/collections/src/column-card.d.ts +15 -0
- package/dist/packages/collections/src/data-table-layout.d.ts +2 -0
- package/dist/packages/collections/src/data-table-rows.d.ts +4 -3
- package/dist/packages/collections/src/data-table.d.ts +2 -2
- package/dist/packages/collections/src/index.d.ts +5 -0
- package/dist/packages/collections/src/table-query.d.ts +13 -4
- package/dist/packages/collections/src/use-collection-controls.d.ts +6 -0
- package/dist/packages/feedback/src/feedback.d.ts +0 -4
- package/dist/packages/feedback/src/index.d.ts +1 -1
- package/dist/packages/kits/src/research/index.d.ts +0 -2
- 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-CKr8EYxF.js} +1 -1
- package/dist/{pierre-diff-DP_TXXIt.js → pierre-diff-DXVIwW7o.js} +1 -1
- package/dist/{plot-layout-BfXmAi71.js → plot-layout-CVzSbcU7.js} +24 -23
- package/dist/{plot-surface-UQgDiTVe.js → plot-surface-CBhI1alw.js} +1 -1
- package/dist/{reference-lines-BRHB78Wb.js → reference-lines-C970JwWZ.js} +1 -1
- package/dist/{scene-DlVQupfw.js → scene-C3dCxckI.js} +6 -6
- package/dist/scene.js +1 -1
- package/dist/{slope-chart-CjXcvoRJ.js → slope-chart-DekEJxsy.js} +4 -4
- package/dist/{src-DojhQZKX.js → src-BCAelv4f.js} +376 -399
- package/dist/{src-BYmv3_AL.js → src-Bkov5TTa.js} +204 -191
- package/dist/{src-BdQGb362.js → src-BsqbWDxS.js} +4 -4
- package/dist/{src-DPcnDU5H.js → src-CIyuaSCi.js} +101 -107
- package/dist/src-Dc1t1ugL.js +2612 -0
- package/dist/{src-BYnmQkDq.js → src-DceyVyL0.js} +2 -2
- package/dist/{src-BI1xQE7D.js → src-Dlh99sPD.js} +46 -32
- package/dist/styles2.css +35 -41
- package/dist/{time-series-Dg3DZRGx.js → time-series-BSNnijxf.js} +8 -8
- package/dist/{timeline-C2IVroD3.js → timeline-CnxfYSIg.js} +4 -4
- package/dist/{token-heatmap-CZtIPU60.js → token-heatmap-CJaXo56P.js} +3 -3
- package/dist/{token-predictions-BJ5L-Lrm.js → token-predictions-Bi7aKPnh.js} +3 -3
- package/dist/{transport-D9e0H2we.js → transport-CXj0DV6o.js} +4 -4
- package/dist/{tree-diagram-DRAJiqjW.js → tree-diagram-BxOZsjr1.js} +4 -4
- package/dist/{treemap-BdELCV7E.js → treemap-B2yOAetT.js} +4 -4
- package/dist/{use-tween-COV8bEYL.js → use-tween-C1TWJwce.js} +1 -1
- package/dist/{violin-plot-DuxqWnuD.js → violin-plot-W2L_2JRo.js} +3 -3
- package/dist/{waterfall-D4ewGb4u.js → waterfall-Bt73N2Ng.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 +66 -58
- 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 +21 -0
- package/skills/review-elements/SKILL.md +20 -13
- package/skills/upgrade-elements/SKILL.md +3 -1
- package/skills/upgrade-elements/references/releases.md +36 -0
- package/skills/use-elements/SKILL.md +13 -7
- package/skills/use-elements/references/collections.md +67 -14
- package/skills/use-elements/references/conversations.md +32 -0
- package/skills/use-elements/references/editorial-restraint.md +17 -34
- package/skills/use-elements/references/figures.md +6 -2
- package/skills/use-elements/references/reports.md +4 -1
- package/skills/use-elements/references/workspace.md +18 -14
- package/dist/packages/kits/src/research/collection-page.d.ts +0 -72
- package/dist/packages/layout/src/detail-page.d.ts +0 -9
- package/dist/packages/layout/src/page-content.d.ts +0 -5
- package/dist/src-P19zz_aO.js +0 -2235
|
@@ -2,6 +2,42 @@
|
|
|
2
2
|
|
|
3
3
|
Newest first. Each section lists what an application must change, then what it may adopt.
|
|
4
4
|
|
|
5
|
+
## 0.67.0
|
|
6
|
+
|
|
7
|
+
- Import `CollectionPage` and `CollectionSection` from `@mechane-ai/elements/collections`. Give the collection its read
|
|
8
|
+
state and choose a local query for complete authorized rows or a controlled query for paged records. Its title owns
|
|
9
|
+
the search and filter controls even when the page has navigation.
|
|
10
|
+
- Move record detail to a link. For simultaneous inspection, compose a dedicated `Workbench`. Move scope selection into
|
|
11
|
+
the application's route and actions. Replace a collection notice with the specific failure or mutation feedback the
|
|
12
|
+
user needs.
|
|
13
|
+
|
|
14
|
+
## 0.66.0
|
|
15
|
+
|
|
16
|
+
No change is required. Two parts are new.
|
|
17
|
+
|
|
18
|
+
- **`CardColumns` from `/collections`** shows records as cards in named columns, such as tasks by state. It takes
|
|
19
|
+
`columns`, `getCardId`, `getCard` and a `locale`. Pass `onMoveCard` for a move menu on each card, and a card's
|
|
20
|
+
`moveTargets` to limit its destinations. It has no drag and drop. `status` marks a pending or failed read.
|
|
21
|
+
- **`MessageReactions` from `/ai`** and a new `Message` `reactions` slot. The row shows reaction chips with counts and
|
|
22
|
+
an add control over the emoji your app supplies as `choices`. It reports every change through `onReactionToggle`.
|
|
23
|
+
Existing `Message` uses are unchanged.
|
|
24
|
+
|
|
25
|
+
## 0.65.0
|
|
26
|
+
|
|
27
|
+
- Remove `showNavigation` from page toolbars. In a workspace, the shell supplies navigation alongside a leading back
|
|
28
|
+
action. Standalone pages and the shell's focus mode automatically omit the toggle.
|
|
29
|
+
- Provide a table, calendar grid or other full-width surface as `PageSection` children. Move a former `breakdown` value
|
|
30
|
+
into children. Use `summary` for inset metrics. Wrap a form or reading block that relied on the old child inset in
|
|
31
|
+
`PageInset`. Replace an existing `PageContent` wrapper with `PageInset` only where a local inset is intended.
|
|
32
|
+
- Remove wide or full-bleed `DetailPage` wrappers. Put sections directly in the layout. Replace centered `DetailPage`
|
|
33
|
+
uses with `ReadingColumn` when the content needs a bounded line length.
|
|
34
|
+
- Remove `isFlush` from `WorkbenchScroll`. Its children and `RecordPage.Body` now span their pane. Wrap only the leaf
|
|
35
|
+
form or explanation in `PageInset` when it needs space.
|
|
36
|
+
- Supply an inspector to `Workbench` when it is needed. Its desktop split is resizable by default. Remove `isResizable`
|
|
37
|
+
and `inspectorInitialPercent`. Use `PageInset` for inset text inside the inspector.
|
|
38
|
+
- Move workspace selectors into `AppShell.sidebarControls`. The shell aligns controls with the navigation rows and
|
|
39
|
+
handles the collapsed sidebar and the phone drawer.
|
|
40
|
+
|
|
5
41
|
## 0.49.1
|
|
6
42
|
|
|
7
43
|
Fixes from the first essay ported onto the teaching layers. No import changes. An essay written for 0.48 type checks
|
|
@@ -55,29 +55,35 @@ persistence and every asynchronous operation.
|
|
|
55
55
|
| The page needs | Use | Read |
|
|
56
56
|
| ------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------- |
|
|
57
57
|
| An app frame, a page, sections, a record page | `AppShell`, `PageLayout`, `PageSection`, `RecordPage` | [workspace](references/workspace.md) |
|
|
58
|
-
| A
|
|
58
|
+
| A full-width collection page or titled section | `CollectionPage` or `CollectionSection` from `/collections` | [workspace](references/workspace.md) |
|
|
59
59
|
| Records compared across columns, search, filters | `DataTable` with a `query` | [collections](references/collections.md) |
|
|
60
|
-
|
|
|
60
|
+
| Compare a detail while operating on its list | `Inspector`, `Details` | [collections](references/collections.md) |
|
|
61
|
+
| Records as cards in columns by state (a kanban board) | `CardColumns` with `onMoveCard` | [collections](references/collections.md) |
|
|
61
62
|
| Fields, choices, dates, files, a save | `Field`, the `/forms` controls, `FormActions`, `ConfirmButton` | [forms](references/forms.md) |
|
|
62
63
|
| A trend, comparison, distribution or relationship | One chart from a `/charts/*` entry | [charts](references/charts.md) |
|
|
63
64
|
| A figure an agent or a server writes as JSON | `Figure`, `validateFigureSpec`, `describeFigure` and `chartGuide` from `/charts/figure` | [figures](references/figures.md) |
|
|
64
65
|
| A run, evaluation, research, service or feature | A kit from `/kits/training`, `/kits/evaluation`, `/kits/research`, `/kits/operations`, `/kits/interpretability` | [kits](references/kits.md) |
|
|
65
66
|
| Page focus, zero-card layout, anti-slop copy | Flat `MetricGrid`, hairline sections, `CollectionPage`, concise titles | [editorial restraint](references/editorial-restraint.md) |
|
|
66
67
|
| An explorable essay, a lesson, a moving diagram | `/lesson`, `/scene`, `/article` and `/mdx`, planned with `/lesson/spec` | [teaching](references/teaching.md) |
|
|
67
|
-
| A first read, a refresh, an empty or failed read | `AsyncRegion`, `LoadingScope`, `EmptyState`, `
|
|
68
|
+
| A first read, a refresh, an empty or failed read | `AsyncRegion`, `LoadingScope`, `EmptyState`, `Toaster` / `toast` | [reports](references/reports.md) |
|
|
68
69
|
| A command menu, a decision, an anchored panel | `Menu`, `AlertDialog`, `Dialog`, `Drawer`, `Popover`, `Tooltip` | the catalog |
|
|
69
70
|
| Route destinations or panels inside one view | `PageNavigation` for links, `Tabs` or `ContentTabs` for panels | [workspace](references/workspace.md) |
|
|
70
71
|
| A transcript, a prompt, tool activity, approvals | `Conversation`, `Message`, `PromptInput`, `Approval` | [conversations](references/conversations.md) |
|
|
72
|
+
| Emoji reactions on a message | `MessageReactions` in `Message`'s `reactions` slot | [conversations](references/conversations.md) |
|
|
71
73
|
| Markdown, source, a diff, a file tree, a log, playback | `/content/markdown`, `/content/code`, `/content/diff`, `/content/tree`, `/content` | the catalog |
|
|
72
74
|
| A model or browser agent that reads and acts | `createAgent` and `registerTools` from `/agent` | [agent access](references/agent.md) |
|
|
73
75
|
|
|
74
76
|
## Start from a recipe
|
|
75
77
|
|
|
76
|
-
- **
|
|
77
|
-
|
|
78
|
-
|
|
78
|
+
- **Workspace dashboard.** Look up `workspace-report` for linked charts, metrics and a drill-down table inside a
|
|
79
|
+
persistent shell. Look up `workspace-files` for loading, empty and detail views, or `session-timeline` for agent
|
|
80
|
+
activity. Each recipe's catalog entry names a runnable Storybook example.
|
|
81
|
+
- **Searchable collection.** Start with the `searchable-collection` recipe. The collection owns its heading, query
|
|
82
|
+
controls and read boundary. Supply all authorized rows for local search, or a controlled query for paged data. Link
|
|
83
|
+
each record to its detail route and restore the query and position on Back.
|
|
79
84
|
- **Sectioned report.** Mount the shell around the router outlet. Put each heading and its body in a sibling
|
|
80
|
-
`PageSection`.
|
|
85
|
+
`PageSection`. Headers and tables span the pane by default. Use `PageInset` around local prose or forms and
|
|
86
|
+
`AppShell.sidebarControls` for a workspace picker.
|
|
81
87
|
- **Linked figures.** Give each model, run or series one id. Wrap the figures in `ToneScope` and `ChartLink` so a thing
|
|
82
88
|
keeps one hue and inspecting it in one figure marks it in the others.
|
|
83
89
|
- **A chart you cannot name.** Read `chartGuide` from `/charts/figure`, or the chooser in
|
|
@@ -5,30 +5,38 @@ application owns requests, URL state, permissions and saved preferences.
|
|
|
5
5
|
|
|
6
6
|
## Declare the query
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
Use `CollectionPage` or `CollectionSection` for a titled collection. Supply its read state and a local or controlled
|
|
9
|
+
query. The composition places the search and filter controls in its title row and renders the table and its matching
|
|
10
|
+
placeholder. Start with the installed catalog's `searchable-collection` recipe.
|
|
9
11
|
|
|
10
|
-
|
|
11
|
-
| ------------ | ------------------------------------------------------------------------------------------------------- |
|
|
12
|
-
| `local` | The app holds every row. Supply a search accessor and filter dimensions; the table filters and windows. |
|
|
13
|
-
| `controlled` | A server pages the rows. Supply search and filter values with callbacks, and reset the page on change. |
|
|
14
|
-
| `frame` | A shared header already holds the controls. Declare them once with `TableQueryFrame`. |
|
|
15
|
-
| `static` | The table is a fixed reference. Give a concrete `reason`. |
|
|
12
|
+
For example, a finite project list supplies its rows and search fields together.
|
|
16
13
|
|
|
17
14
|
```tsx
|
|
18
|
-
<
|
|
19
|
-
|
|
15
|
+
<CollectionPage
|
|
16
|
+
title="Projects"
|
|
20
17
|
columns={columns}
|
|
21
|
-
rows={projects}
|
|
22
18
|
getRowId={(project) => project.id}
|
|
19
|
+
read={{ state: 'ready', rows: projects }}
|
|
23
20
|
empty="No projects."
|
|
24
21
|
query={{
|
|
25
22
|
mode: 'local',
|
|
26
23
|
search: (project) => project.name,
|
|
27
24
|
filters: [{ id: 'status', label: 'Status', value: (project) => project.status }],
|
|
28
25
|
}}
|
|
26
|
+
rowAction={{ href: (project) => projectHref(project.id) }}
|
|
29
27
|
/>
|
|
30
28
|
```
|
|
31
29
|
|
|
30
|
+
A lower-level `DataTable` can also present rows inside a custom report. It takes a stable `getRowId`, a `caption`, an
|
|
31
|
+
`empty` state and a `query`.
|
|
32
|
+
|
|
33
|
+
| Query mode | Use it when |
|
|
34
|
+
| ------------ | ------------------------------------------------------------------------------------------------------- |
|
|
35
|
+
| `local` | The app holds every row. Supply a search accessor and filter dimensions; the table filters and windows. |
|
|
36
|
+
| `controlled` | A server pages the rows. Supply search and filter values with callbacks, and reset the page on change. |
|
|
37
|
+
| `frame` | An explicit custom report owns a shared query frame for several representations of the same result. |
|
|
38
|
+
| `static` | The table is a fixed reference. Give a concrete `reason`. |
|
|
39
|
+
|
|
32
40
|
To leave out only search or only filters, replace that capability with `{ reason: '…' }`. For a paged source, apply
|
|
33
41
|
search, filters and sort to the whole result before the server takes a page, with a unique key as the last sort field.
|
|
34
42
|
|
|
@@ -49,7 +57,8 @@ An explicit type annotation widens the columns and then requires the controlled
|
|
|
49
57
|
- Rows are 48px and text truncates. Set `rowSizing="content"` for records that need several lines.
|
|
50
58
|
- Use `DataTableText` for a primary string with an optional second line.
|
|
51
59
|
- Mark a column `isSecondary` to hide it at the compact breakpoint.
|
|
52
|
-
- The table owns its cell insets.
|
|
60
|
+
- The table owns its cell insets. Place it directly inside the page or section. Wrap an adjacent form or prose block in
|
|
61
|
+
`PageInset` when it needs an inset.
|
|
53
62
|
|
|
54
63
|
## Opening, selecting and paging
|
|
55
64
|
|
|
@@ -61,7 +70,8 @@ An explicit type annotation widens the columns and then requires the controlled
|
|
|
61
70
|
from the row count.
|
|
62
71
|
- `window` limits the mounted rows of a long page. It does not fetch. Use `CollectionEnd` for loading more, with its
|
|
63
72
|
ready, loading, retry and complete states.
|
|
64
|
-
- Pass `resultStatus` while a read is pending or failed
|
|
73
|
+
- Pass `resultStatus` while a read is pending or failed. Keep rows during a refresh of the same collection. Clear them
|
|
74
|
+
when switching destination, workspace or viewer.
|
|
65
75
|
|
|
66
76
|
## The control row
|
|
67
77
|
|
|
@@ -69,6 +79,10 @@ A local or controlled query renders its own search and filters. For a custom hea
|
|
|
69
79
|
the current values and callbacks. It returns `actions`, `chips`, `onKeyDown` and `openSearch`. Put the actions in the
|
|
70
80
|
page or section header and the chips below them in a `CollectionToolbar`.
|
|
71
81
|
|
|
82
|
+
A `CollectionPage` exposes its search and filters even beside route navigation. In a custom collection using
|
|
83
|
+
`useCollectionControls`, spread `controls.findRegion` on the element enclosing the results and controls to enable its
|
|
84
|
+
scoped Find shortcuts. A menu or editor keeps its own keys.
|
|
85
|
+
|
|
72
86
|
The control row is one toolbar. Tab enters it once, and the arrow keys move between chips, find, filters and display
|
|
73
87
|
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
88
|
key handler around it.
|
|
@@ -81,9 +95,48 @@ key handler around it.
|
|
|
81
95
|
- Register a shortcut with `useCommandShortcuts` from `/navigation/commands`, beside the action's owner, with an
|
|
82
96
|
explicit `isEnabled`. `CommandPalette` lists the same action records and registers nothing by mounting.
|
|
83
97
|
|
|
98
|
+
## Cards in columns
|
|
99
|
+
|
|
100
|
+
Use `CardColumns` for records grouped by a state the reader moves them between, such as tasks. Use `DataTable` when
|
|
101
|
+
records are compared across shared columns, and `Timeline` for events in time order.
|
|
102
|
+
|
|
103
|
+
```tsx
|
|
104
|
+
<CardColumns
|
|
105
|
+
label="Tasks by state"
|
|
106
|
+
locale="en-US"
|
|
107
|
+
columns={states.map((state) => ({
|
|
108
|
+
id: state.id,
|
|
109
|
+
title: state.title,
|
|
110
|
+
items: tasks.filter((t) => t.state === state.id),
|
|
111
|
+
}))}
|
|
112
|
+
getCardId={(task) => task.id}
|
|
113
|
+
getCard={(task) => ({
|
|
114
|
+
title: task.title,
|
|
115
|
+
href: `/tasks/${task.id}`,
|
|
116
|
+
status: <Badge tone={task.tone}>{task.stateTitle}</Badge>,
|
|
117
|
+
meta: <Timestamp dateTime={task.updated} label={task.updatedLabel} />,
|
|
118
|
+
moveTargets: task.allowedStates,
|
|
119
|
+
})}
|
|
120
|
+
onMoveCard={({ item, toColumnId }) => requestMove(item.id, toColumnId)}
|
|
121
|
+
/>
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
- The app filters and orders the records into columns, in display order. `CardColumns` neither sorts nor counts for you.
|
|
125
|
+
- `onMoveCard` reports a request. Nothing moves until the app supplies new `columns`, so show a pending or failed move
|
|
126
|
+
in the card's `status` or `actions`. Leave `onMoveCard` out for a read-only board.
|
|
127
|
+
- `moveTargets` lists the column ids a card may move to. The app computes it from its rules. An empty list removes the
|
|
128
|
+
card's move control.
|
|
129
|
+
- Pass `status="pending"` or `"failed"` while the read is not ready. A column with no cards then shows a placeholder or
|
|
130
|
+
an error and a dash for its count, never an empty message. Cards already supplied stay visible during a refresh.
|
|
131
|
+
- `columnHeight="bounded"` (the default) caps each column and scrolls its cards. `"fill"` takes the height of the
|
|
132
|
+
parent.
|
|
133
|
+
- There is no drag and drop. Each card's move button is its own Tab stop, so a board with many cards has many stops.
|
|
134
|
+
- Take every word through `labels`, and pass `empty` on a column that needs its own empty text.
|
|
135
|
+
|
|
84
136
|
## A selected record
|
|
85
137
|
|
|
86
|
-
|
|
87
|
-
|
|
138
|
+
Use a detail link for reading one record. If the task requires inspecting a record while operating on the list,
|
|
139
|
+
`Inspector` puts the list in `master` and the selected record in `detail`, side by side when there is room and stacked
|
|
140
|
+
in a narrow container. Change `revealKey` when the selection changes so a stacked detail scrolls into view. `Details`
|
|
88
141
|
renders labeled fields. `Metric` and `MetricGrid` summarize a record or a period; pass `isLoading` to reserve their
|
|
89
142
|
space. `Timestamp` takes an ISO datetime and a label the app formatted with an explicit locale and time zone.
|
|
@@ -19,6 +19,38 @@ Compose `Conversation.Root`, `Viewport`, `Content` and one `Item` per message, w
|
|
|
19
19
|
end-aligned user messages. Render text with `Markdown` from `/content/markdown`. `MessageAction` is a named icon button
|
|
20
20
|
that shows on hover and focus. `ReplyIndicator` shows a supplied waiting label; remove it when real output arrives.
|
|
21
21
|
|
|
22
|
+
## Reactions
|
|
23
|
+
|
|
24
|
+
Pass `MessageReactions` to a `Message`'s `reactions` slot. Unlike `actions`, which appear on hover, reactions stay
|
|
25
|
+
visible.
|
|
26
|
+
|
|
27
|
+
```tsx
|
|
28
|
+
<Message
|
|
29
|
+
author="Ada Example"
|
|
30
|
+
reactions={
|
|
31
|
+
<MessageReactions
|
|
32
|
+
locale="en-US"
|
|
33
|
+
reactions={[{ emoji: '👍', name: 'Thumbs up', count: 3, isReacted: true }]}
|
|
34
|
+
choices={[
|
|
35
|
+
{ emoji: '👍', name: 'Thumbs up' },
|
|
36
|
+
{ emoji: '🎉', name: 'Party popper' },
|
|
37
|
+
]}
|
|
38
|
+
onReactionToggle={({ emoji, isReacted }) => requestReaction(messageId, emoji, isReacted)}
|
|
39
|
+
/>
|
|
40
|
+
}
|
|
41
|
+
>
|
|
42
|
+
Done.
|
|
43
|
+
</Message>
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
- `reactions` holds only emoji with at least one person, in display order. Give each a `name` in words. A button is
|
|
47
|
+
named from it and the count, such as "Thumbs up, 3", and reports whether it is pressed.
|
|
48
|
+
- `choices` is the app's list of emoji for the add control. Elements ships no emoji data or picker. With no choices the
|
|
49
|
+
add control is left out.
|
|
50
|
+
- Both a chip and a menu choice call `onReactionToggle` with the emoji and the state the viewer asks for. Nothing
|
|
51
|
+
changes until the app supplies new `reactions`, so it owns counts, permission and failed writes. `isDisabled` keeps
|
|
52
|
+
counts visible and stops reacting.
|
|
53
|
+
|
|
22
54
|
## The prompt
|
|
23
55
|
|
|
24
56
|
`PromptInput` takes `value`, `onValueChange` and `onSubmit`. The app owns the draft, the request identity, the result
|
|
@@ -1,40 +1,23 @@
|
|
|
1
|
-
#
|
|
1
|
+
# One task per page
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Lead with the action the reader came to take. A collection opens with its titled list. Link each record to its detail
|
|
4
|
+
route so people can copy the address, open another tab and return to their place. Give an independent investigation its
|
|
5
|
+
own destination. Keep a chart and its breakdown together when both answer the same question. A persistent inspector is
|
|
6
|
+
appropriate when the task requires simultaneous context, such as inspecting a trace while scrubbing it.
|
|
4
7
|
|
|
5
|
-
##
|
|
8
|
+
## Surfaces and copy
|
|
6
9
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
`PageLayout.navigation` tabs.
|
|
11
|
-
- Prefer smaller, click-through pages and right-hand `Workbench` / `Drawer` inspectors over vertical stacks of four or
|
|
12
|
-
more charts.
|
|
10
|
+
Use the collection directly in its working pane. Its heading and row dividers span both edges. The heading and cells own
|
|
11
|
+
their inner padding. Use a reading column for an article or form. Compare both outer edges and the first text position
|
|
12
|
+
independently before adding a wrapper.
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
Give each sentence a job. A label identifies a choice. A qualification identifies a material limit on the data. A
|
|
15
|
+
validation or access error explains what the user can do. Put optional methods and long identifiers in the detail view
|
|
16
|
+
or a named disclosure. Remove copy that narrates ordinary controls, repeats the heading or describes internal matching
|
|
17
|
+
rules. Chart descriptions can identify a non-obvious sample, split or source.
|
|
15
18
|
|
|
16
|
-
|
|
17
|
-
automatically).
|
|
18
|
-
- Place tabular lists edge-to-edge using `CollectionPage` or `PageSection.breakdown`.
|
|
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.
|
|
19
|
+
## Background updates
|
|
21
20
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
write UI instructions (`"Hover to inspect..."`, `"Click any cell..."`, `"Check rows to filter"`) or restate what the
|
|
26
|
-
title, axes, and legend already show (`"Dashed curve marks..."`, `"Higher is better..."`).
|
|
27
|
-
- Keep table rows scannable: concise single-line primary labels, short badge tokens, and tabular numbers. Put long prose
|
|
28
|
-
and raw metadata in the click-through inspector pane or drawer.
|
|
29
|
-
- Never show raw backend slugs (`w5_v3_d1536_t115...`) in primary labels; map them to short human labels and keep the
|
|
30
|
-
raw identifier in the inspector with `CopyValue`.
|
|
31
|
-
|
|
32
|
-
## Shell & collection Lego blocks
|
|
33
|
-
|
|
34
|
-
- **Area-forking rail:** Put top-level areas in `AppShell.rail` and Settings/account controls in `AppShell.railFooter`.
|
|
35
|
-
Swap `AppShell.sidebar` to show only the active area's pages—never duplicate every page on both the rail and sidebar.
|
|
36
|
-
- **No sync/status clutter:** Use silent background polling for live telemetry; omit manual `Sync` / `Refresh` buttons
|
|
37
|
-
and footer timestamp pills from primary pages. Keep theme and environment controls under Settings.
|
|
38
|
-
- **Use `CollectionPage` for tables:** One component gives you `PageLayout`, top-bar `Find in view` & `Filters` (`/` and
|
|
39
|
-
`⌘F`), `CollectionToolbar` filter chips, full-width `DataTable`, and an optional resizable `Workbench` inspector.
|
|
40
|
-
Never hand-wire search inputs or filter dropdowns in the page body.
|
|
21
|
+
Keep a usable authorized collection in place during a refresh. An explicit refresh reports progress on its trigger. When
|
|
22
|
+
stale data matters to the task, expose its status and recovery on an existing stable control. Preserve a visible
|
|
23
|
+
recovery path for a failed initial read. A reconnect or status change must leave the row under the pointer in place.
|
|
@@ -78,7 +78,7 @@ The last bin has `"count": null`. The chart draws it hollow, not as zero.
|
|
|
78
78
|
## Check and draw it
|
|
79
79
|
|
|
80
80
|
```tsx
|
|
81
|
-
import {
|
|
81
|
+
import { Status } from '@mechane-ai/elements';
|
|
82
82
|
import { useState } from 'react';
|
|
83
83
|
|
|
84
84
|
function AgentFigure({ input }: { readonly input: unknown }) {
|
|
@@ -86,7 +86,11 @@ function AgentFigure({ input }: { readonly input: unknown }) {
|
|
|
86
86
|
const result = validateFigureSpec(input);
|
|
87
87
|
|
|
88
88
|
if (result.kind === 'invalid') {
|
|
89
|
-
return
|
|
89
|
+
return (
|
|
90
|
+
<Status tone="negative" role="alert">
|
|
91
|
+
{result.message}
|
|
92
|
+
</Status>
|
|
93
|
+
);
|
|
90
94
|
}
|
|
91
95
|
|
|
92
96
|
return <Figure spec={result.spec} selected={selected} onSelectedChange={(id) => setSelected(id)} />;
|
|
@@ -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 `/collections` for the primary list, or `CollectionSection` under a page heading. Search and
|
|
27
|
+
filters belong to the collection title row. The collection handles pending geometry, focus and query controls. The app
|
|
28
|
+
supplies the local or controlled query and the row's destination. For distinct reading or editing tasks use linked
|
|
29
|
+
routes. Use a `Workbench` when the reader needs simultaneous context, such as inspecting a trace while scrubbing its
|
|
30
|
+
timeline.
|
|
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,72 +0,0 @@
|
|
|
1
|
-
import type { ComponentProps, ReactNode } from 'react';
|
|
2
|
-
import type { DataTableColumn, DataTableRowAction, DataTableSort, DataTableSortDetails, TableFilterDimension, TableQueryException } from '../../../collections/src/index.ts';
|
|
3
|
-
import { PageLayout } from '../../../layout/src/index.ts';
|
|
4
|
-
export type CollectionStatus = 'loading' | 'ready' | 'failed';
|
|
5
|
-
/** A named scope partition shown as a segmented switcher in the collection header with live item counts. */
|
|
6
|
-
export type CollectionScope<Row> = {
|
|
7
|
-
readonly id: string;
|
|
8
|
-
readonly label: string;
|
|
9
|
-
readonly match: (row: Row) => boolean;
|
|
10
|
-
};
|
|
11
|
-
type SortableColumns<Row> = {
|
|
12
|
-
readonly columns: ReadonlyArray<DataTableColumn<Row>>;
|
|
13
|
-
readonly sort: DataTableSort | undefined;
|
|
14
|
-
readonly onSortChange: (sort: DataTableSort | undefined, details: DataTableSortDetails) => void;
|
|
15
|
-
} | {
|
|
16
|
-
readonly columns: ReadonlyArray<DataTableColumn<Row> & {
|
|
17
|
-
readonly canSort?: false;
|
|
18
|
-
}>;
|
|
19
|
-
readonly sort?: never;
|
|
20
|
-
readonly onSortChange?: never;
|
|
21
|
-
};
|
|
22
|
-
type SharedCollectionProps<Row extends object> = SortableColumns<Row> & {
|
|
23
|
-
readonly title: string;
|
|
24
|
-
readonly caption?: string;
|
|
25
|
-
readonly rows: ReadonlyArray<Row>;
|
|
26
|
-
readonly getRowId: (row: Row) => string;
|
|
27
|
-
/** Local full-text search accessor, or an explicit exception reason when search is omitted. */
|
|
28
|
-
readonly search: ((row: Row) => string) | TableQueryException;
|
|
29
|
-
/** Local filter dimensions rendered in the top toolbar filter menu, or an explicit exception reason. */
|
|
30
|
-
readonly filters: ReadonlyArray<TableFilterDimension<Row>> | TableQueryException;
|
|
31
|
-
/** Optional custom row transformer (e.g. sorting) applied after local search and filtering. */
|
|
32
|
-
readonly transformRows?: (rows: ReadonlyArray<Row>) => ReadonlyArray<Row>;
|
|
33
|
-
/** Optional segmented scopes (e.g. Active / All) that partition rows before local search and filtering. */
|
|
34
|
-
readonly scopes?: ReadonlyArray<CollectionScope<Row>> | undefined;
|
|
35
|
-
readonly defaultScopeId?: string | undefined;
|
|
36
|
-
readonly actions?: ReactNode;
|
|
37
|
-
readonly notice?: ReactNode;
|
|
38
|
-
readonly rowAction?: DataTableRowAction<Row> | undefined;
|
|
39
|
-
readonly activeRowId?: string | undefined;
|
|
40
|
-
readonly rowSizing?: 'fixed' | 'content' | undefined;
|
|
41
|
-
readonly empty: ReactNode;
|
|
42
|
-
readonly filteredEmpty?: ReactNode;
|
|
43
|
-
/** Read lifecycle state: `'loading'` reserves geometry with `DataTablePlaceholder` inside `AsyncRegion`. */
|
|
44
|
-
readonly status?: CollectionStatus;
|
|
45
|
-
readonly failure?: ReactNode;
|
|
46
|
-
readonly placeholderRows?: number;
|
|
47
|
-
};
|
|
48
|
-
export type CollectionPageProps<Row extends object> = SharedCollectionProps<Row> & {
|
|
49
|
-
readonly navigation?: ComponentProps<typeof PageLayout>['navigation'];
|
|
50
|
-
/** Optional right-hand inspector pane rendered inside a resizable Workbench split when open. */
|
|
51
|
-
readonly inspector?: {
|
|
52
|
-
readonly label: string;
|
|
53
|
-
readonly content: ReactNode;
|
|
54
|
-
} | undefined;
|
|
55
|
-
readonly inspectorInitialPercent?: number | undefined;
|
|
56
|
-
};
|
|
57
|
-
export type CollectionSectionProps<Row extends object> = SharedCollectionProps<Row> & {
|
|
58
|
-
readonly id?: string;
|
|
59
|
-
readonly meta?: ReactNode;
|
|
60
|
-
};
|
|
61
|
-
/**
|
|
62
|
-
* Full-width collection page Lego block: wires `PageLayout`, top-bar search and filter controls (`/` and `⌘F`), active
|
|
63
|
-
* filter chips, `AsyncRegion` + `DataTablePlaceholder` loading states, edge-to-edge `CollectionLayout`, and an optional
|
|
64
|
-
* resizable `Workbench` inspector.
|
|
65
|
-
*/
|
|
66
|
-
export declare function CollectionPage<Row extends object>(props: CollectionPageProps<Row>): ReactNode;
|
|
67
|
-
/**
|
|
68
|
-
* Full-width collection section for tabbed or multi-section views. Wires `SectionHeading`, top-bar search and filters,
|
|
69
|
-
* active filter chips, `AsyncRegion` loading placeholders, and edge-to-edge `DataTable`.
|
|
70
|
-
*/
|
|
71
|
-
export declare function CollectionSection<Row extends object>(props: CollectionSectionProps<Row>): ReactNode;
|
|
72
|
-
export {};
|
|
@@ -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 {};
|