@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.
Files changed (130) hide show
  1. package/README.md +39 -27
  2. package/dist/ai.js +285 -203
  3. package/dist/{article-BopqPz1K.js → article-anMy8fA5.js} +6 -6
  4. package/dist/article.js +1 -1
  5. package/dist/catalog.json +137 -46
  6. package/dist/{categorical-values-8LA9KXhi.js → categorical-values-Bh7ZkEQn.js} +1 -1
  7. package/dist/charts/cartesian.js +1 -1
  8. package/dist/charts/comparison.js +1 -1
  9. package/dist/charts/distribution.js +1 -1
  10. package/dist/charts/figure.js +12 -12
  11. package/dist/charts/graph.js +1 -1
  12. package/dist/charts/hierarchy.js +1 -1
  13. package/dist/charts/image.js +1 -1
  14. package/dist/charts/matrix.js +1 -1
  15. package/dist/charts/plot.js +3 -3
  16. package/dist/charts/relationship.js +1 -1
  17. package/dist/charts/text.js +1 -1
  18. package/dist/charts/timeline.js +2 -2
  19. package/dist/charts/trend.js +1 -1
  20. package/dist/charts.js +2 -2
  21. package/dist/{code-block-BjQUIvvw.js → code-block-DbW_t9U4.js} +1 -1
  22. package/dist/collections.js +1 -1
  23. package/dist/{commands-BI9rWGpb.js → commands-C7Zrp-tG.js} +2 -2
  24. package/dist/content/code.js +1 -1
  25. package/dist/content/diff.js +3 -3
  26. package/dist/content/link.js +1 -1
  27. package/dist/content/markdown.js +1 -1
  28. package/dist/content/tree.js +2 -2
  29. package/dist/{content-link-C3RAJ2kP.js → content-link-BN4NPp0u.js} +1 -1
  30. package/dist/content.js +1 -1
  31. package/dist/{dates-D1v_jiva.js → dates-OTq-xU33.js} +2 -2
  32. package/dist/{dumbbell-plot-QGjFMk0X.js → dumbbell-plot-BQDGe0sQ.js} +3 -3
  33. package/dist/{embedding-map-D_RNxsCD.js → embedding-map-DmmknG7A.js} +6 -6
  34. package/dist/feedback.js +1 -1
  35. package/dist/{figure-frame-CF3298LZ.js → figure-frame-DlyNTDzh.js} +22 -21
  36. package/dist/forms/dates.js +1 -1
  37. package/dist/{forms-DlKhXUlc.js → forms-iAOjGRTO.js} +1 -1
  38. package/dist/forms.js +2 -2
  39. package/dist/{image-grid-BXsgVBnB.js → image-grid-CxEAQvTf.js} +3 -3
  40. package/dist/index.js +1 -1
  41. package/dist/kits/evaluation.js +13 -13
  42. package/dist/kits/interpretability.js +47 -43
  43. package/dist/kits/operations.js +80 -79
  44. package/dist/kits/research.js +364 -520
  45. package/dist/kits/training.js +108 -107
  46. package/dist/layout.js +1 -1
  47. package/dist/lesson.js +3 -3
  48. package/dist/{markdown-B92daSMP.js → markdown-Diffqqm7.js} +2 -2
  49. package/dist/mdx.js +6 -6
  50. package/dist/navigation/commands.js +1 -1
  51. package/dist/{navigation-D3vnWiVv.js → navigation-CTnYtVD8.js} +1 -1
  52. package/dist/navigation.js +4 -4
  53. package/dist/packages/ai/src/index.d.ts +2 -0
  54. package/dist/packages/ai/src/message-reactions.d.ts +51 -0
  55. package/dist/packages/ai/src/message.d.ts +3 -1
  56. package/dist/packages/collections/src/card-columns-model.d.ts +50 -0
  57. package/dist/packages/collections/src/card-columns.d.ts +30 -0
  58. package/dist/packages/collections/src/collection-page.d.ts +43 -0
  59. package/dist/packages/collections/src/column-card.d.ts +15 -0
  60. package/dist/packages/collections/src/data-table-layout.d.ts +2 -0
  61. package/dist/packages/collections/src/data-table-rows.d.ts +4 -3
  62. package/dist/packages/collections/src/data-table.d.ts +2 -2
  63. package/dist/packages/collections/src/index.d.ts +5 -0
  64. package/dist/packages/collections/src/table-query.d.ts +13 -4
  65. package/dist/packages/collections/src/use-collection-controls.d.ts +6 -0
  66. package/dist/packages/feedback/src/feedback.d.ts +0 -4
  67. package/dist/packages/feedback/src/index.d.ts +1 -1
  68. package/dist/packages/kits/src/research/index.d.ts +0 -2
  69. package/dist/packages/layout/src/app-shell.d.ts +3 -1
  70. package/dist/packages/layout/src/index.d.ts +4 -4
  71. package/dist/packages/layout/src/page-inset.d.ts +5 -0
  72. package/dist/packages/layout/src/page-layout.d.ts +4 -9
  73. package/dist/packages/layout/src/page-toolbar.d.ts +1 -2
  74. package/dist/packages/layout/src/reading-column.d.ts +4 -0
  75. package/dist/packages/layout/src/record-page.d.ts +4 -6
  76. package/dist/packages/layout/src/sidebar.d.ts +3 -1
  77. package/dist/packages/layout/src/workbench.d.ts +2 -6
  78. package/dist/packages/navigation/src/current-page-click.d.ts +3 -0
  79. package/dist/packages/navigation/src/index.d.ts +1 -0
  80. package/dist/{param-DfOYi9wL.js → param-CKr8EYxF.js} +1 -1
  81. package/dist/{pierre-diff-DP_TXXIt.js → pierre-diff-DXVIwW7o.js} +1 -1
  82. package/dist/{plot-layout-BfXmAi71.js → plot-layout-CVzSbcU7.js} +24 -23
  83. package/dist/{plot-surface-UQgDiTVe.js → plot-surface-CBhI1alw.js} +1 -1
  84. package/dist/{reference-lines-BRHB78Wb.js → reference-lines-C970JwWZ.js} +1 -1
  85. package/dist/{scene-DlVQupfw.js → scene-C3dCxckI.js} +6 -6
  86. package/dist/scene.js +1 -1
  87. package/dist/{slope-chart-CjXcvoRJ.js → slope-chart-DekEJxsy.js} +4 -4
  88. package/dist/{src-DojhQZKX.js → src-BCAelv4f.js} +376 -399
  89. package/dist/{src-BYmv3_AL.js → src-Bkov5TTa.js} +204 -191
  90. package/dist/{src-BdQGb362.js → src-BsqbWDxS.js} +4 -4
  91. package/dist/{src-DPcnDU5H.js → src-CIyuaSCi.js} +101 -107
  92. package/dist/src-Dc1t1ugL.js +2612 -0
  93. package/dist/{src-BYnmQkDq.js → src-DceyVyL0.js} +2 -2
  94. package/dist/{src-BI1xQE7D.js → src-Dlh99sPD.js} +46 -32
  95. package/dist/styles2.css +35 -41
  96. package/dist/{time-series-Dg3DZRGx.js → time-series-BSNnijxf.js} +8 -8
  97. package/dist/{timeline-C2IVroD3.js → timeline-CnxfYSIg.js} +4 -4
  98. package/dist/{token-heatmap-CZtIPU60.js → token-heatmap-CJaXo56P.js} +3 -3
  99. package/dist/{token-predictions-BJ5L-Lrm.js → token-predictions-Bi7aKPnh.js} +3 -3
  100. package/dist/{transport-D9e0H2we.js → transport-CXj0DV6o.js} +4 -4
  101. package/dist/{tree-diagram-DRAJiqjW.js → tree-diagram-BxOZsjr1.js} +4 -4
  102. package/dist/{treemap-BdELCV7E.js → treemap-B2yOAetT.js} +4 -4
  103. package/dist/{use-tween-COV8bEYL.js → use-tween-C1TWJwce.js} +1 -1
  104. package/dist/{violin-plot-DuxqWnuD.js → violin-plot-W2L_2JRo.js} +3 -3
  105. package/dist/{waterfall-D4ewGb4u.js → waterfall-Bt73N2Ng.js} +4 -4
  106. package/package.json +1 -1
  107. package/recipes/allocation-report.tsx +4 -4
  108. package/recipes/calendar-workspace.tsx +14 -10
  109. package/recipes/consequential-form.tsx +4 -4
  110. package/recipes/searchable-collection.tsx +66 -58
  111. package/recipes/sectioned-report.tsx +17 -18
  112. package/recipes/session-timeline.tsx +59 -0
  113. package/recipes/tabbed-workspace.tsx +7 -8
  114. package/recipes/workspace-files.tsx +94 -0
  115. package/recipes/workspace-report.tsx +130 -0
  116. package/skills/extend-elements/SKILL.md +21 -0
  117. package/skills/review-elements/SKILL.md +20 -13
  118. package/skills/upgrade-elements/SKILL.md +3 -1
  119. package/skills/upgrade-elements/references/releases.md +36 -0
  120. package/skills/use-elements/SKILL.md +13 -7
  121. package/skills/use-elements/references/collections.md +67 -14
  122. package/skills/use-elements/references/conversations.md +32 -0
  123. package/skills/use-elements/references/editorial-restraint.md +17 -34
  124. package/skills/use-elements/references/figures.md +6 -2
  125. package/skills/use-elements/references/reports.md +4 -1
  126. package/skills/use-elements/references/workspace.md +18 -14
  127. package/dist/packages/kits/src/research/collection-page.d.ts +0 -72
  128. package/dist/packages/layout/src/detail-page.d.ts +0 -9
  129. package/dist/packages/layout/src/page-content.d.ts +0 -5
  130. 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 searchable, filterable full-width table page | `CollectionPage` (wires top-bar search, filters, chips, shortcuts & optional inspector) | [workspace](references/workspace.md) |
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
- | A selected record's fields beside its list | `Inspector`, `Details` | [collections](references/collections.md) |
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`, `Notice` | [reports](references/reports.md) |
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
- - **Searchable collection.** Use local query mode for a complete finite collection. For a paged source, send search and
77
- filters to the data owner before it takes a page. Keep the query and current page together in route state when users
78
- need to return to the same results.
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`. The shell and sections own the sticky geometry.
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
- Every `DataTable` takes a stable `getRowId`, a `caption`, an `empty` state and a `query`.
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
- | Query mode | Use it when |
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
- <DataTable
19
- caption="Projects"
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. Keep a full-width table outside `PageContent`, or use `PageSection`'s `breakdown`.
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, and keep the previous rows on screen.
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
- `Inspector` puts a list in `master` and the selected record in `detail`, side by side when there is room and stacked in
87
- a narrow container. Change `revealKey` when the selection changes so a stacked detail scrolls into view. `Details`
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
- # Editorial restraint & Lego-block defaults
1
+ # One task per page
2
2
 
3
- Elements apps are calm, hairline-divided analytical workspaces—not card grids or prose-heavy dashboards.
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
- ## One page, one question
8
+ ## Surfaces and copy
6
9
 
7
- - Give every route a single job.
8
- - **Overview** answers _"Where do things stand?"_ with one flat `MetricGrid` and one primary visual (fitting cleanly on
9
- a single desktop viewport). Move deep attribution charts, comparison tables, and logs onto dedicated routes or
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
- ## Zero-card default
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
- - Place `MetricGrid`, charts, and Markdown directly inside `PageSection` (which supplies the standard gutter
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
- ## Zero-slop copy budget
23
-
24
- - Omit chart `description` unless it communicates non-obvious data provenance (sample window, split, or filter). Never
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 { Notice } from '@mechane-ai/elements/feedback';
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 <Notice hasError>{result.message}</Notice>;
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`. Its `summary` and `children` slots supply the standard inset gutter,
15
- and `breakdown` spans the pane for a `DataTable` or `EventMonth`. The `calendar-workspace` recipe uses the grid as a
16
- breakdown and shows the selected day's full event names in the inset body of a sibling section. `PageContent` inside an
17
- already inset slot adds no second gutter.
18
-
19
- Use `DetailPage isWide` for a wide standalone working surface with the standard inset. Use `isBleed` when the entire
20
- detail fills the pane. Constrain prose and individual forms locally. Keep a wide plot's horizontal scroll inside its
21
- figure. At a wide desktop viewport, compare the right edge of a report header with its table and the edge of the pane.
22
-
23
- Use `CollectionPage` from `/kits/research` for full-width searchable/filterable table pages. It wires `PageLayout`,
24
- top-bar search & filter controls (`/` and `⌘F`), `CollectionToolbar` filter chips, full-width `DataTable`, and an
25
- optional resizable `Workbench` inspector in one component. Never put inline search inputs or filter dropdowns in the
26
- page body.
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 {};
@@ -1,5 +0,0 @@
1
- import type { ReactNode } from 'react';
2
- export type PageContentProps = {
3
- readonly children: ReactNode;
4
- };
5
- export declare function PageContent({ children }: PageContentProps): ReactNode;