altitude-design 0.2.0 → 0.3.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 (295) hide show
  1. package/README.md +46 -8
  2. package/dist/adapters/codemirror.cjs +88 -0
  3. package/dist/adapters/codemirror.cjs.map +7 -0
  4. package/dist/adapters/codemirror.js +67 -0
  5. package/dist/adapters/codemirror.js.map +7 -0
  6. package/dist/adapters/react-flow.css +102 -0
  7. package/dist/adapters/tiptap.css +71 -0
  8. package/dist/altitude.css +3165 -246
  9. package/dist/altitude.iife.js +33 -5
  10. package/dist/altitude.no-fonts.css +3165 -246
  11. package/dist/chart-themes.cjs +195 -0
  12. package/dist/chart-themes.cjs.map +7 -0
  13. package/dist/chart-themes.js +165 -0
  14. package/dist/chart-themes.js.map +7 -0
  15. package/dist/cli/altitude.mjs +134 -0
  16. package/dist/guidance/README.md +32 -0
  17. package/dist/guidance/agent-setup.md +22 -0
  18. package/dist/guidance/app-skeleton.md +17 -0
  19. package/dist/guidance/evidence.json +95 -0
  20. package/dist/guidance/index.json +493 -0
  21. package/dist/guidance/llms.txt +20 -0
  22. package/dist/guidance/manifest.json +92 -0
  23. package/dist/guidance/pattern.schema.json +181 -0
  24. package/dist/guidance/patterns/agent-action.json +77 -0
  25. package/dist/guidance/patterns/agent-action.md +39 -0
  26. package/dist/guidance/patterns/assistant-conversation.json +77 -0
  27. package/dist/guidance/patterns/assistant-conversation.md +50 -0
  28. package/dist/guidance/patterns/async-collection.json +71 -0
  29. package/dist/guidance/patterns/async-collection.md +29 -0
  30. package/dist/guidance/patterns/audit-log.json +75 -0
  31. package/dist/guidance/patterns/audit-log.md +27 -0
  32. package/dist/guidance/patterns/auth.json +86 -0
  33. package/dist/guidance/patterns/auth.md +29 -0
  34. package/dist/guidance/patterns/billing.json +80 -0
  35. package/dist/guidance/patterns/billing.md +29 -0
  36. package/dist/guidance/patterns/consequential-action.json +76 -0
  37. package/dist/guidance/patterns/consequential-action.md +27 -0
  38. package/dist/guidance/patterns/developer-settings.json +79 -0
  39. package/dist/guidance/patterns/developer-settings.md +29 -0
  40. package/dist/guidance/patterns/edit-record.json +74 -0
  41. package/dist/guidance/patterns/edit-record.md +51 -0
  42. package/dist/guidance/patterns/import.json +77 -0
  43. package/dist/guidance/patterns/import.md +31 -0
  44. package/dist/guidance/patterns/members.json +77 -0
  45. package/dist/guidance/patterns/members.md +27 -0
  46. package/dist/guidance/patterns/onboarding.json +78 -0
  47. package/dist/guidance/patterns/onboarding.md +31 -0
  48. package/dist/guidance/patterns/review-submit.json +72 -0
  49. package/dist/guidance/patterns/review-submit.md +27 -0
  50. package/dist/guidance/patterns/screen-layout.json +79 -0
  51. package/dist/guidance/patterns/screen-layout.md +40 -0
  52. package/dist/guidance/patterns/settings.json +78 -0
  53. package/dist/guidance/patterns/settings.md +32 -0
  54. package/dist/guidance/patterns/sync.json +77 -0
  55. package/dist/guidance/patterns/sync.md +31 -0
  56. package/dist/guidance/principles.md +23 -0
  57. package/dist/guidance/references/build/checks/agent-action-pattern.mjs +57 -0
  58. package/dist/guidance/references/build/checks/agent-setup.mjs +78 -0
  59. package/dist/guidance/references/build/checks/assistant-conversation-pattern.mjs +49 -0
  60. package/dist/guidance/references/build/checks/audit-log-pattern.mjs +63 -0
  61. package/dist/guidance/references/build/checks/auth-pattern.mjs +67 -0
  62. package/dist/guidance/references/build/checks/billing-pattern.mjs +63 -0
  63. package/dist/guidance/references/build/checks/developer-settings-pattern.mjs +76 -0
  64. package/dist/guidance/references/build/checks/guidance.mjs +71 -0
  65. package/dist/guidance/references/build/checks/import-pattern.mjs +69 -0
  66. package/dist/guidance/references/build/checks/members-pattern.mjs +71 -0
  67. package/dist/guidance/references/build/checks/onboarding-pattern.mjs +54 -0
  68. package/dist/guidance/references/build/checks/pattern-types.mjs +13 -0
  69. package/dist/guidance/references/build/checks/pattern-workflows.mjs +226 -0
  70. package/dist/guidance/references/build/checks/primary-scope.mjs +49 -0
  71. package/dist/guidance/references/build/checks/render-tells.mjs +72 -0
  72. package/dist/guidance/references/build/checks/screen-layout-pattern.mjs +111 -0
  73. package/dist/guidance/references/build/checks/semantics.mjs +72 -0
  74. package/dist/guidance/references/build/checks/settings-pattern.mjs +73 -0
  75. package/dist/guidance/references/build/checks/sync-pattern.mjs +62 -0
  76. package/dist/guidance/references/build/checks/tells-lint.mjs +164 -0
  77. package/dist/guidance/references/build/fixtures/pattern-workflows.tsx +83 -0
  78. package/dist/guidance/references/build/fixtures/patterns/agent-action.jsx +60 -0
  79. package/dist/guidance/references/build/fixtures/patterns/app-skeleton.jsx +94 -0
  80. package/dist/guidance/references/build/fixtures/patterns/assistant-conversation.jsx +79 -0
  81. package/dist/guidance/references/build/fixtures/patterns/audit-log.jsx +81 -0
  82. package/dist/guidance/references/build/fixtures/patterns/auth.jsx +150 -0
  83. package/dist/guidance/references/build/fixtures/patterns/billing.jsx +96 -0
  84. package/dist/guidance/references/build/fixtures/patterns/developer-settings.jsx +95 -0
  85. package/dist/guidance/references/build/fixtures/patterns/import.jsx +102 -0
  86. package/dist/guidance/references/build/fixtures/patterns/members.jsx +106 -0
  87. package/dist/guidance/references/build/fixtures/patterns/onboarding.jsx +70 -0
  88. package/dist/guidance/references/build/fixtures/patterns/screen-layout-decision.jsx +74 -0
  89. package/dist/guidance/references/build/fixtures/patterns/screen-layout-editor.jsx +56 -0
  90. package/dist/guidance/references/build/fixtures/patterns/screen-layout-report.jsx +42 -0
  91. package/dist/guidance/references/build/fixtures/patterns/settings.jsx +73 -0
  92. package/dist/guidance/references/build/fixtures/patterns/sync.jsx +78 -0
  93. package/dist/guidance/references/project/components/src/pattern-async-collection.tsx +57 -0
  94. package/dist/guidance/references/project/components/src/pattern-consequential-action.tsx +77 -0
  95. package/dist/guidance/references/project/components/src/pattern-edit-record.tsx +127 -0
  96. package/dist/guidance/references/project/components/src/pattern-review-submit.tsx +47 -0
  97. package/dist/guidance/references/project/components/src/settings.tsx +79 -0
  98. package/dist/guidance/references/scripts/build-framework-fixture.mjs +20 -0
  99. package/dist/guidance/rules.json +653 -0
  100. package/dist/guidance/visual/Elevation.md +194 -0
  101. package/dist/guidance/visual/Fundamentals.md +83 -0
  102. package/dist/guidance/visual/Research.md +1620 -0
  103. package/dist/index.cjs +19009 -1854
  104. package/dist/index.cjs.map +4 -4
  105. package/dist/index.js +19009 -1854
  106. package/dist/index.js.map +4 -4
  107. package/dist/tokens.css +84 -84
  108. package/dist/tokens.json +301 -128
  109. package/dist/types/adapter-codemirror.d.ts +13 -0
  110. package/dist/types/agent-fleet.d.ts +166 -0
  111. package/dist/types/ai-label.d.ts +30 -0
  112. package/dist/types/app-shell.d.ts +83 -0
  113. package/dist/types/area-chart.d.ts +80 -0
  114. package/dist/types/artifact.d.ts +65 -0
  115. package/dist/types/bar-chart.d.ts +83 -0
  116. package/dist/types/bar-list.d.ts +35 -0
  117. package/dist/types/breadcrumb.d.ts +62 -0
  118. package/dist/types/chart-brush.d.ts +35 -0
  119. package/dist/types/chart-themes.d.ts +229 -0
  120. package/dist/types/chart.d.ts +570 -0
  121. package/dist/types/checklist.d.ts +71 -0
  122. package/dist/types/code-block.d.ts +32 -0
  123. package/dist/types/collections.d.ts +116 -5
  124. package/dist/types/color-picker.d.ts +38 -0
  125. package/dist/types/command.d.ts +6 -3
  126. package/dist/types/comment-thread.d.ts +48 -0
  127. package/dist/types/confirmation.d.ts +60 -0
  128. package/dist/types/context-menu.d.ts +17 -0
  129. package/dist/types/controls.d.ts +134 -22
  130. package/dist/types/conversation.d.ts +130 -0
  131. package/dist/types/copy-button.d.ts +19 -0
  132. package/dist/types/core.d.ts +139 -10
  133. package/dist/types/data-grid.d.ts +76 -0
  134. package/dist/types/date-picker.d.ts +96 -0
  135. package/dist/types/diff-view.d.ts +54 -0
  136. package/dist/types/dot-plot.d.ts +54 -0
  137. package/dist/types/edit-region.d.ts +121 -0
  138. package/dist/types/feature-gate.d.ts +22 -0
  139. package/dist/types/filter-bar.d.ts +65 -0
  140. package/dist/types/formatted-number.d.ts +38 -0
  141. package/dist/types/heatmap.d.ts +64 -0
  142. package/dist/types/in-place.d.ts +24 -0
  143. package/dist/types/index.d.ts +159 -14
  144. package/dist/types/inline-citation.d.ts +35 -0
  145. package/dist/types/inline-edit.d.ts +71 -0
  146. package/dist/types/input-otp.d.ts +37 -0
  147. package/dist/types/item-group.d.ts +104 -0
  148. package/dist/types/line-chart.d.ts +116 -0
  149. package/dist/types/link.d.ts +11 -0
  150. package/dist/types/markdown.d.ts +88 -0
  151. package/dist/types/meter.d.ts +43 -0
  152. package/dist/types/modal-state.d.ts +62 -0
  153. package/dist/types/nav.d.ts +8 -1
  154. package/dist/types/notifications.d.ts +42 -0
  155. package/dist/types/number-input.d.ts +30 -0
  156. package/dist/types/overlays.d.ts +56 -15
  157. package/dist/types/page-header.d.ts +27 -0
  158. package/dist/types/pagination.d.ts +29 -0
  159. package/dist/types/palette.d.ts +64 -0
  160. package/dist/types/password-input.d.ts +22 -0
  161. package/dist/types/pattern-assistant-conversation.d.ts +55 -0
  162. package/dist/types/pattern-async-collection.d.ts +34 -0
  163. package/dist/types/pattern-consequential-action.d.ts +53 -0
  164. package/dist/types/pattern-edit-record.d.ts +72 -0
  165. package/dist/types/pattern-review-submit.d.ts +43 -0
  166. package/dist/types/permission-matrix.d.ts +34 -0
  167. package/dist/types/plan-picker.d.ts +40 -0
  168. package/dist/types/prompt-input.d.ts +106 -0
  169. package/dist/types/property-list.d.ts +67 -0
  170. package/dist/types/question.d.ts +64 -0
  171. package/dist/types/relative-time.d.ts +21 -0
  172. package/dist/types/removal-receipt.d.ts +1180 -0
  173. package/dist/types/resizable.d.ts +48 -0
  174. package/dist/types/roving.d.ts +44 -0
  175. package/dist/types/save-bar.d.ts +38 -0
  176. package/dist/types/saved-views.d.ts +72 -0
  177. package/dist/types/scatter-chart.d.ts +60 -0
  178. package/dist/types/schedule.d.ts +80 -0
  179. package/dist/types/secret-field.d.ts +33 -0
  180. package/dist/types/select.d.ts +44 -2
  181. package/dist/types/separator.d.ts +11 -0
  182. package/dist/types/settings.d.ts +39 -0
  183. package/dist/types/sheet.d.ts +1 -1
  184. package/dist/types/sparkline.d.ts +46 -0
  185. package/dist/types/split-button.d.ts +21 -0
  186. package/dist/types/stat.d.ts +54 -0
  187. package/dist/types/stepper.d.ts +6 -3
  188. package/dist/types/suggestions.d.ts +29 -0
  189. package/dist/types/suspense.d.ts +85 -0
  190. package/dist/types/sync-indicator.d.ts +24 -0
  191. package/dist/types/tag-input.d.ts +65 -0
  192. package/dist/types/terminal.d.ts +33 -0
  193. package/dist/types/thread-list.d.ts +58 -0
  194. package/dist/types/time-input.d.ts +33 -0
  195. package/dist/types/timeline.d.ts +38 -0
  196. package/dist/types/toggle.d.ts +46 -0
  197. package/dist/types/toolbar.d.ts +34 -0
  198. package/dist/types/tour.d.ts +23 -0
  199. package/dist/types/trace.d.ts +65 -0
  200. package/dist/types/tree.d.ts +71 -0
  201. package/dist/types-cjs/adapter-codemirror.d.cts +13 -0
  202. package/dist/types-cjs/agent-fleet.d.cts +166 -0
  203. package/dist/types-cjs/ai-label.d.cts +30 -0
  204. package/dist/types-cjs/app-shell.d.cts +83 -0
  205. package/dist/types-cjs/area-chart.d.cts +80 -0
  206. package/dist/types-cjs/artifact.d.cts +65 -0
  207. package/dist/types-cjs/bar-chart.d.cts +83 -0
  208. package/dist/types-cjs/bar-list.d.cts +35 -0
  209. package/dist/types-cjs/breadcrumb.d.cts +62 -0
  210. package/dist/types-cjs/chart-brush.d.cts +35 -0
  211. package/dist/types-cjs/chart-themes.d.cts +229 -0
  212. package/dist/types-cjs/chart.d.cts +570 -0
  213. package/dist/types-cjs/checklist.d.cts +71 -0
  214. package/dist/types-cjs/code-block.d.cts +32 -0
  215. package/dist/types-cjs/collections.d.cts +246 -0
  216. package/dist/types-cjs/color-picker.d.cts +38 -0
  217. package/dist/types-cjs/command.d.cts +66 -0
  218. package/dist/types-cjs/comment-thread.d.cts +48 -0
  219. package/dist/types-cjs/confirmation.d.cts +60 -0
  220. package/dist/types-cjs/context-menu.d.cts +17 -0
  221. package/dist/types-cjs/controls.d.cts +360 -0
  222. package/dist/types-cjs/conversation.d.cts +130 -0
  223. package/dist/types-cjs/copy-button.d.cts +19 -0
  224. package/dist/types-cjs/core.d.cts +256 -0
  225. package/dist/types-cjs/data-grid.d.cts +76 -0
  226. package/dist/types-cjs/date-picker.d.cts +96 -0
  227. package/dist/types-cjs/diff-view.d.cts +54 -0
  228. package/dist/types-cjs/dot-plot.d.cts +54 -0
  229. package/dist/types-cjs/edit-region.d.cts +121 -0
  230. package/dist/types-cjs/empty.d.cts +24 -0
  231. package/dist/types-cjs/feature-gate.d.cts +22 -0
  232. package/dist/types-cjs/filter-bar.d.cts +65 -0
  233. package/dist/types-cjs/formatted-number.d.cts +38 -0
  234. package/dist/types-cjs/heatmap.d.cts +64 -0
  235. package/dist/types-cjs/in-place.d.cts +24 -0
  236. package/dist/types-cjs/index.d.cts +154 -0
  237. package/dist/types-cjs/inline-citation.d.cts +35 -0
  238. package/dist/types-cjs/inline-edit.d.cts +71 -0
  239. package/dist/types-cjs/input-otp.d.cts +37 -0
  240. package/dist/types-cjs/item-group.d.cts +104 -0
  241. package/dist/types-cjs/line-chart.d.cts +116 -0
  242. package/dist/types-cjs/link.d.cts +11 -0
  243. package/dist/types-cjs/markdown.d.cts +88 -0
  244. package/dist/types-cjs/meter.d.cts +43 -0
  245. package/dist/types-cjs/modal-state.d.cts +62 -0
  246. package/dist/types-cjs/nav.d.cts +25 -0
  247. package/dist/types-cjs/notifications.d.cts +42 -0
  248. package/dist/types-cjs/number-input.d.cts +30 -0
  249. package/dist/types-cjs/overlays.d.cts +170 -0
  250. package/dist/types-cjs/page-header.d.cts +27 -0
  251. package/dist/types-cjs/pagination.d.cts +29 -0
  252. package/dist/types-cjs/palette.d.cts +64 -0
  253. package/dist/types-cjs/password-input.d.cts +22 -0
  254. package/dist/types-cjs/pattern-assistant-conversation.d.cts +55 -0
  255. package/dist/types-cjs/pattern-async-collection.d.cts +34 -0
  256. package/dist/types-cjs/pattern-consequential-action.d.cts +53 -0
  257. package/dist/types-cjs/pattern-edit-record.d.cts +72 -0
  258. package/dist/types-cjs/pattern-review-submit.d.cts +43 -0
  259. package/dist/types-cjs/permission-matrix.d.cts +34 -0
  260. package/dist/types-cjs/pile.d.cts +27 -0
  261. package/dist/types-cjs/plan-picker.d.cts +40 -0
  262. package/dist/types-cjs/prompt-input.d.cts +106 -0
  263. package/dist/types-cjs/property-list.d.cts +67 -0
  264. package/dist/types-cjs/question.d.cts +64 -0
  265. package/dist/types-cjs/relative-time.d.cts +21 -0
  266. package/dist/types-cjs/removal-receipt.d.cts +1180 -0
  267. package/dist/types-cjs/resizable.d.cts +48 -0
  268. package/dist/types-cjs/roving.d.cts +44 -0
  269. package/dist/types-cjs/save-bar.d.cts +38 -0
  270. package/dist/types-cjs/saved-views.d.cts +72 -0
  271. package/dist/types-cjs/scatter-chart.d.cts +60 -0
  272. package/dist/types-cjs/schedule.d.cts +80 -0
  273. package/dist/types-cjs/secret-field.d.cts +33 -0
  274. package/dist/types-cjs/select.d.cts +109 -0
  275. package/dist/types-cjs/separator.d.cts +11 -0
  276. package/dist/types-cjs/settings.d.cts +39 -0
  277. package/dist/types-cjs/sheet.d.cts +27 -0
  278. package/dist/types-cjs/sparkline.d.cts +46 -0
  279. package/dist/types-cjs/split-button.d.cts +21 -0
  280. package/dist/types-cjs/stat.d.cts +54 -0
  281. package/dist/types-cjs/stepper.d.cts +26 -0
  282. package/dist/types-cjs/suggestions.d.cts +29 -0
  283. package/dist/types-cjs/suspense.d.cts +85 -0
  284. package/dist/types-cjs/sync-indicator.d.cts +24 -0
  285. package/dist/types-cjs/tag-input.d.cts +65 -0
  286. package/dist/types-cjs/terminal.d.cts +33 -0
  287. package/dist/types-cjs/thread-list.d.cts +58 -0
  288. package/dist/types-cjs/time-input.d.cts +33 -0
  289. package/dist/types-cjs/timeline.d.cts +38 -0
  290. package/dist/types-cjs/toggle.d.cts +46 -0
  291. package/dist/types-cjs/toolbar.d.cts +34 -0
  292. package/dist/types-cjs/tour.d.cts +23 -0
  293. package/dist/types-cjs/trace.d.cts +65 -0
  294. package/dist/types-cjs/tree.d.cts +71 -0
  295. package/package.json +90 -9
@@ -0,0 +1,51 @@
1
+ # Edit record
2
+
3
+ Help someone change a durable record without losing work. Use this for settings, profiles and ordinary record forms. Prefer `InlineEdit` for a contextual single value and a route for extended work, history or deep links; a dialog is only for a bounded interruption. Do not use this hook as a backend, authorization layer or autosave engine.
4
+
5
+ ## Inputs and ownership
6
+
7
+ Supply an initial value, synchronous business validation, an explicit `validationMode` (`submit` or `blur`), and a `save` adapter that returns a successful canonical value only when the promised persistence succeeds. Supply localized field labels, error messages and status text. The default equality is shallow; provide `isEqual` for nested records. The app owns service concurrency (revision/ETag or idempotency), authorization and navigation. Use server validation as authoritative where required.
8
+
9
+ ## States and transitions
10
+
11
+ The runtime phases are `editing`, `invalid`, `submitting`, `saved` and `failed`; `dirty` distinguishes pristine from edited input. Pristine becomes editing when input changes. Invalid submission reveals inline errors and a summary from the same error model. Valid submit becomes pending immediately and rejects duplicate activation. Rejected persistence becomes failure while preserving input; retry revalidates and saves again. Success updates the baseline only after the adapter confirms it. A response for an older draft must never replace newer input. Only explicit reset/discard restores the baseline. Unmounting does not undo a dispatched request.
12
+
13
+ ## Content, keyboard, focus and announcements
14
+
15
+ Use a named native form, persistent visible labels and outcome-specific buttons such as “Save settings”. Errors say what happened and how to fix it; transport errors belong to the operation, not an arbitrary field. `ErrorSummary` links to actual control IDs and takes focus on invalid submit via `focusKey={form.submitCount}`. Keep hint and error references valid and preserve external descriptions. `WorkflowStatus` announces operation feedback without unnecessary focus movement. Do not announce success on click or clear errors on unrelated events. Enter submits a form; Tab follows meaningful DOM order; focus remains visible.
16
+
17
+ Choose submit validation by default; blur validation is an explicit product choice. Avoid scolding during incomplete typing. Keep related labels, errors and controls together when narrow; allow long translations to wrap, use logical spacing, and preserve every action with RTL, zoom and forced colors. Pending is text/semantics as well as height.
18
+
19
+ ## Recovery and unsaved work
20
+
21
+ Wire `requestLeave(reason, confirmDiscard)` to cancel, router Back and every internal navigation path. Clean forms need no prompt; pending forms cannot claim cancellation. The supplied confirmation must obtain a real decision; refusing leaves the draft intact, accepting discards deliberately. Integrate `beforeunload` separately when appropriate: browsers limit its custom text and may not fire it in all lifecycle cases. Persist resumable drafts in the application when loss across reload/session termination is unacceptable. Restore focus logically after leaving, especially when the originating control is removed.
22
+
23
+ ## Working implementation
24
+
25
+ The package exports `useEditRecord`, `ErrorSummary` and `WorkflowStatus`. This minimal composition is supplemented by the executable fixture linked in metadata:
26
+
27
+ ```tsx
28
+ const form = useEditRecord({
29
+ initialValue: { name: 'Northwind' }, validationMode: 'submit',
30
+ validate: value => value.name.trim() ? {} : { name: 'Enter a workspace name.' },
31
+ save: async value => ({ ok: true, value: await api.saveSettings(value) }),
32
+ });
33
+ return <form onSubmit={event => { event.preventDefault(); void form.submit(); }}>
34
+ <ErrorSummary focusKey={form.submitCount} errors={form.errors.name
35
+ ? [{ id: 'name', label: 'Workspace name', message: form.errors.name }] : []} />
36
+ <Field label="Workspace name" error={form.errors.name}>
37
+ <Input id="name" value={form.draft.name}
38
+ onChange={event => form.setField('name', event.target.value)} />
39
+ </Field>
40
+ <Button type="submit" disabled={form.phase === 'submitting'}>Save settings</Button>
41
+ <WorkflowStatus>{form.status}</WorkflowStatus>
42
+ </form>;
43
+ ```
44
+
45
+ The `api` is application supplied and must reject failure or return the documented `{ok:false,error,errors?}` result through the save adapter; this example does not manufacture a service. Use the full fixture for cancellation, failure and newer-edit cases.
46
+
47
+ ## Rules, verification and evidence
48
+
49
+ Read [metadata](edit-record.json) for stable identity, applicability, exceptions, maturity, source IDs, implementation and executable test references. `ALT-EDIT-001` covers retained input and truthful persistence; `ALT-EDIT-002` covers error relationships; `ALT-EDIT-003` requires contextual validation/navigation choices; `ALT-STATUS-001` and `ALT-VISUAL-001` cover equivalent feedback. Run the linked browser fixtures with delayed, rejected, retried and stale saves, asserting saved data as well as text. Verify summary links and keyboard correction manually with supported assistive technology. Normative WCAG requirements are scoped; the error-summary composition and validation timing are contextual guidance. Engineering fixtures do not establish improved human task performance.
50
+
51
+ See [running examples and verification](../principles.md#run-the-examples-and-verification) for the installed example command, repository test command, and the limits of shipped test-reference snapshots.
@@ -0,0 +1,77 @@
1
+ {
2
+ "schemaVersion": 1,
3
+ "id": "import",
4
+ "version": 1,
5
+ "title": "Import",
6
+ "intents": [
7
+ "import",
8
+ "upload csv",
9
+ "csv",
10
+ "bulk import",
11
+ "map columns",
12
+ "spreadsheet upload"
13
+ ],
14
+ "purpose": "Upload a file, map its columns, fix the rows with problems, review and import with a receipt.",
15
+ "useWhen": [
16
+ "People bring many records in from a CSV or spreadsheet file."
17
+ ],
18
+ "avoidWhen": [
19
+ "Attaching files to a record; use DropZone with its upload queue."
20
+ ],
21
+ "alternatives": [
22
+ "Use DropZone for attachments, and the review-submit contract for a short form."
23
+ ],
24
+ "requiredInputs": [
25
+ "accepted file types and size limit",
26
+ "a parser returning columns and rows with line numbers",
27
+ "target fields with which are required",
28
+ "validation per field and the duplicate rule",
29
+ "an import job adapter with progress and cancellation where supported"
30
+ ],
31
+ "states": [
32
+ "upload",
33
+ "uploading",
34
+ "upload-failed",
35
+ "mapping",
36
+ "required-unmapped",
37
+ "fixing",
38
+ "reviewing",
39
+ "importing",
40
+ "cancelled",
41
+ "import-failed",
42
+ "complete"
43
+ ],
44
+ "transitions": [
45
+ "upload → uploading → mapping, or upload-failed with Retry",
46
+ "mapping → fixing once every required field is mapped",
47
+ "fixing → reviewing; rows with problems are skipped",
48
+ "reviewing → importing → complete with a receipt",
49
+ "importing → cancelled or import-failed, saying what was imported"
50
+ ],
51
+ "rules": [
52
+ "ALT-IMPORT-001",
53
+ "ALT-REVIEW-001",
54
+ "ALT-STATUS-001"
55
+ ],
56
+ "sources": [
57
+ "altitude-elevation",
58
+ "task-review",
59
+ "wcag22"
60
+ ],
61
+ "authority": "contextual-pattern",
62
+ "applicability": "Importing many records from a file.",
63
+ "exceptions": [
64
+ "Require only states supported by the application; an import that can't be cancelled omits Cancel and says so."
65
+ ],
66
+ "maturity": "provisional",
67
+ "evidenceStatus": "engineering-fixtures; human-effectiveness-unmeasured",
68
+ "document": "patterns/import.md",
69
+ "implementation": "build/fixtures/patterns/import.jsx",
70
+ "examples": [
71
+ "build/fixtures/patterns/import.jsx"
72
+ ],
73
+ "verification": [
74
+ "build/checks/import-pattern.mjs",
75
+ "build/checks/pattern-types.mjs"
76
+ ]
77
+ }
@@ -0,0 +1,31 @@
1
+ # Import
2
+
3
+ Help someone bring records in from a file: upload it, map its columns to fields, see and fix the rows with problems, review what will happen, and import it as a job with a receipt of what was imported, skipped and why. It composes [Review and submit](review-submit.md) for the review and receipt; the steps use `Stepper`.
4
+
5
+ ## Inputs and ownership
6
+
7
+ Supply the accepted file types and size limit, a parser that returns columns and rows (with line numbers), the target fields and which are required, validation per field, the duplicate rule, an import job adapter that reports progress and supports cancellation where the service can, and a way to download the rows that weren't imported. The application owns parsing, encoding detection, validation on the server (the interface's checks are a preview), duplicate detection, the import itself and what a cancelled import leaves behind.
8
+
9
+ ## States and transitions
10
+
11
+ Steps: **upload → map → fix → review → import**, shown in a `Stepper`; completed steps can be revisited until the import starts.
12
+
13
+ - **Upload** follows the DropZone queue: uploading with progress, processing, done (move to mapping) or failed with the reason and Retry.
14
+ - **Map**: one `Select` per source column, labelled with the column's header and a sample value. An unmapped Select is an opening that **fills when mapped** (the Completeness signal), so what's left is visible. Required fields still unmapped are listed in words ("Map these required fields: Name, Email.") and Continue waits for them. "Don't import" is an explicit choice.
15
+ - **Fix** happens in a `DataGrid` with `showInvalid`: **invalid cells lie in a trench on critical-soft** (the Validity signal) and each cell's description says its problem, so the work left shows at a glance. Editing a cell revalidates it. The problem count is said as it changes ("2 problems left in 2 rows"). "Only rows with problems" narrows the grid. Rows still with problems are skipped, and the page says so.
16
+ - **Review** is one sentence of consequences ("5 contacts will be imported. 3 rows will be skipped: 1 duplicate and 2 with problems.") and a button that names the outcome ("Import 5 contacts").
17
+ - **Import** is a job: `Progress` with the count in words ("Importing 3 of 5"), cancellable where the service supports it (and the cancelled state says what was already imported), then a receipt of imported, skipped and failed counts with the skipped rows downloadable, and an entry in the activity log.
18
+
19
+ ## Content, keyboard, focus and announcements
20
+
21
+ Each step change moves focus to its heading. The grid follows spreadsheet keys (arrows, Enter to edit, Escape to discard); each cell's name includes its row ("Email, row 3"). Counts are announced politely when they change, never per keystroke. The mapping grid reflows to one column on narrow screens; the data grid scrolls horizontally. Verify forced colors (invalid cells keep a dashed outline), reduced motion, zoom and RTL.
22
+
23
+ ## Recovery and working implementation
24
+
25
+ A failed upload offers Retry. Leaving the fix step keeps the edits. A failed import says how many rows were imported before it stopped and offers to continue. The working example in `build/fixtures/patterns/import.jsx` (shipped as `references/build/fixtures/patterns/import.jsx`) composes the five steps with a sample file, mapping, invalid cells to fix, a review, a cancellable import and a receipt. It is also the Storybook preview "Patterns/ImportPattern". [Metadata](import.json) names the runtime and verification sources.
26
+
27
+ ## Rules, verification and evidence
28
+
29
+ `ALT-IMPORT-001` covers mapping as completeness, invalid cells as trenches with their problem, and the job with its receipt; `ALT-REVIEW-001` covers review and receipt; `ALT-STATUS-001` covers announcements. `build/checks/import-pattern.mjs` checks the example in a browser, including DataGrid's `showInvalid`. See [rules](../rules.json). How people handle large files with many problems still needs evaluation with representative users and real data.
30
+
31
+ See [running examples and verification](../principles.md#run-the-examples-and-verification) for the installed example command, repository test command, and the limits of shipped test-reference snapshots.
@@ -0,0 +1,77 @@
1
+ {
2
+ "schemaVersion": 1,
3
+ "id": "members",
4
+ "version": 1,
5
+ "title": "Members",
6
+ "intents": [
7
+ "members",
8
+ "invite teammates",
9
+ "invite",
10
+ "roles",
11
+ "permissions",
12
+ "team"
13
+ ],
14
+ "purpose": "Invite people, change roles and remove access without misdrawing invitations or breaking ownership.",
15
+ "useWhen": [
16
+ "A workspace or account has members with roles, invitations and removal."
17
+ ],
18
+ "avoidWhen": [
19
+ "Sharing a single document with a link; use that product's sharing dialog instead."
20
+ ],
21
+ "alternatives": [
22
+ "Use the settings contract for workspace preferences, and the consequential-action contract for a single removal outside a members list."
23
+ ],
24
+ "requiredInputs": [
25
+ "members and invitations with roles",
26
+ "the acting person's identity and permissions",
27
+ "an invite adapter with a result per address",
28
+ "role-change and removal adapters",
29
+ "a sentence per role saying what it can do"
30
+ ],
31
+ "states": [
32
+ "ready",
33
+ "invite-sending",
34
+ "invitation-settled",
35
+ "role-pending",
36
+ "role-committed",
37
+ "role-failed",
38
+ "guarded",
39
+ "confirming-removal",
40
+ "removal-pending",
41
+ "removed"
42
+ ],
43
+ "transitions": [
44
+ "ready → invite-sending on Send",
45
+ "invite-sending → invitation-settled per sent address, with the result said",
46
+ "ready → role-pending on a role change",
47
+ "role-pending → role-committed, or role-failed with the role restored",
48
+ "ready → confirming-removal → removal-pending → removed"
49
+ ],
50
+ "rules": [
51
+ "ALT-MEMBERS-001",
52
+ "ALT-ACTION-001",
53
+ "ALT-STATUS-001",
54
+ "ALT-VISUAL-003"
55
+ ],
56
+ "sources": [
57
+ "altitude-elevation",
58
+ "task-review",
59
+ "wcag22"
60
+ ],
61
+ "authority": "contextual-pattern",
62
+ "applicability": "Workspaces or accounts whose members have roles, invitations and removal.",
63
+ "exceptions": [
64
+ "Require only states supported by the application; products without invitations skip those states."
65
+ ],
66
+ "maturity": "provisional",
67
+ "evidenceStatus": "engineering-fixtures; human-effectiveness-unmeasured",
68
+ "document": "patterns/members.md",
69
+ "implementation": "build/fixtures/patterns/members.jsx",
70
+ "examples": [
71
+ "build/fixtures/patterns/members.jsx"
72
+ ],
73
+ "verification": [
74
+ "build/checks/members-pattern.mjs",
75
+ "build/checks/pattern-types.mjs"
76
+ ]
77
+ }
@@ -0,0 +1,27 @@
1
+ # Members
2
+
3
+ Help someone manage who belongs to a workspace: invite people by email with a role, see invitations still waiting, resend or revoke them, change someone's role, remove someone, and transfer ownership. It composes [Consequential action](consequential-action.md) for removal and ownership transfer; role changes apply immediately, as in [Settings](settings.md).
4
+
5
+ ## Inputs and ownership
6
+
7
+ Supply the current members and invitations with their roles, the acting person's identity and permissions, an invite adapter that reports a result per address (sent, already a member, refused), a role-change adapter, a removal adapter, and for each role a sentence that says what it can do. The application owns authorization (every guard below must also be enforced by the server), invitation delivery and expiry, seat limits, and what happens to a removed person's work.
8
+
9
+ ## States and transitions
10
+
11
+ An invitation awaiting acceptance is **settled**: it is a record of an offer and nothing is in flight. Draw it on the ground with a flush `Badge` "Invited", the role it grants, when it was sent, and Resend and Revoke. Only the moment of sending is pending. Invite: addresses enter a `TagInput`, which refuses an invalid address with the reason ("nope isn't an email address."); the role is chosen from a `RadioGroup` whose options say what each role can do; Send is pending until the service answers, then each new invitation lands with the afterglow and the result is said per address ("2 invites sent, 1 address is already in the workspace."). Role change: applies immediately per row; pending hovers ("Changing role…"), committed lands ("Role changed"), failed drops into a trench, says so and restores the previous role. Custom roles are edited with `PermissionMatrix`. Remove: a consequential action whose confirmation names what the person loses ("Theo loses access to 9 projects…") and whether their work stays; it is said once the service confirms. Revoke: removes the invitation and says so.
12
+
13
+ **Guards**: nobody can remove the last owner or demote themselves out of the last admin or owner role. Don't offer a disabled control; say the reason in words where the action would be ("You're the only owner, so your role can't change. Transfer ownership first."). Transferring ownership is itself a consequential action.
14
+
15
+ ## Content, keyboard, focus and announcements
16
+
17
+ Every row's controls are named with the person ("Role for Theo Marsh"). The Send button says how many invites it sends. Results are announced politely in one status region, never one announcement per address. After a removal or revocation, focus goes to a logical neighbour or the section heading, never the page body. Tables keep a minimum width and scroll horizontally on narrow screens rather than crushing names; long names and addresses wrap at word boundaries. Verify forced colors (the Invited plate's outline and a failed row's dashed border remain), reduced motion, zoom and RTL.
18
+
19
+ ## Recovery and working implementation
20
+
21
+ A failed invite keeps the addresses that weren't sent in the field. A failed role change restores the role and can be repeated. A failed removal keeps the person and says nothing changed. The working example in `build/fixtures/patterns/members.jsx` (shipped as `references/build/fixtures/patterns/members.jsx`) composes invitations, a per-row role change with a failing demo service, the only-owner guard, removal with consequence and revocation. It is also the Storybook preview "Patterns/MembersPattern". [Metadata](members.json) names the runtime and verification sources.
22
+
23
+ ## Rules, verification and evidence
24
+
25
+ `ALT-MEMBERS-001` covers settled invitations and guards stated in words; `ALT-ACTION-001` covers removal and transfer; `ALT-STATUS-001` covers announcements; `ALT-VISUAL-003` covers states that don't rise. `build/checks/members-pattern.mjs` checks the example in a browser: refused addresses, the pending send, settled invitation rows, per-address results, the owner guard, the role change's three states, removal and revocation. See [rules](../rules.json). How well people understand role descriptions still needs evaluation with representative users.
26
+
27
+ See [running examples and verification](../principles.md#run-the-examples-and-verification) for the installed example command, repository test command, and the limits of shipped test-reference snapshots.
@@ -0,0 +1,78 @@
1
+ {
2
+ "schemaVersion": 1,
3
+ "id": "onboarding",
4
+ "version": 1,
5
+ "title": "Onboarding",
6
+ "intents": [
7
+ "onboarding",
8
+ "getting started",
9
+ "setup checklist",
10
+ "product tour",
11
+ "tour",
12
+ "what's new",
13
+ "whats new",
14
+ "first run",
15
+ "empty state"
16
+ ],
17
+ "purpose": "Get someone new to value with a stamped setup checklist, empty states before tours, and what's new.",
18
+ "useWhen": [
19
+ "A new workspace or account needs a few setup tasks, or an existing interface changed."
20
+ ],
21
+ "avoidWhen": [
22
+ "Teaching the whole product up front with a modal carousel or a long tour."
23
+ ],
24
+ "alternatives": [
25
+ "Use EmptyState alone for a single empty region, and Tour only for a change to an interface people already use."
26
+ ],
27
+ "requiredInputs": [
28
+ "setup tasks with where each is done",
29
+ "application events when each task happens",
30
+ "per-person dismissal",
31
+ "empty regions with their one next step",
32
+ "the list of changes and which are unseen"
33
+ ],
34
+ "states": [
35
+ "guide-open",
36
+ "task-done",
37
+ "guide-complete",
38
+ "guide-skipped",
39
+ "guide-hidden",
40
+ "empty",
41
+ "tour-offered",
42
+ "touring",
43
+ "news-unseen",
44
+ "news-seen"
45
+ ],
46
+ "transitions": [
47
+ "guide-open → task-done when the application reports the task happened",
48
+ "guide-open → guide-skipped, or guide-complete → guide-hidden; Help reopens it",
49
+ "empty → filled by its one action, stamping the task",
50
+ "tour-offered → touring only when asked → done or skipped",
51
+ "news-unseen → news-seen when opened"
52
+ ],
53
+ "rules": [
54
+ "ALT-ONBOARD-001",
55
+ "ALT-STATUS-001",
56
+ "ALT-VISUAL-003"
57
+ ],
58
+ "sources": [
59
+ "altitude-elevation",
60
+ "task-review"
61
+ ],
62
+ "authority": "contextual-pattern",
63
+ "applicability": "First-run setup, empty states, tours of changes and release notes.",
64
+ "exceptions": [
65
+ "Require only the parts the product offers; products without setup tasks still prefer empty states to tours."
66
+ ],
67
+ "maturity": "provisional",
68
+ "evidenceStatus": "engineering-fixtures; human-effectiveness-unmeasured",
69
+ "document": "patterns/onboarding.md",
70
+ "implementation": "build/fixtures/patterns/onboarding.jsx",
71
+ "examples": [
72
+ "build/fixtures/patterns/onboarding.jsx"
73
+ ],
74
+ "verification": [
75
+ "build/checks/onboarding-pattern.mjs",
76
+ "build/checks/pattern-types.mjs"
77
+ ]
78
+ }
@@ -0,0 +1,31 @@
1
+ # Onboarding
2
+
3
+ Help someone new reach value quickly: a setup checklist for the few things a workspace needs, empty states that lead to the first record, a short tour only for changes to an interface they already know, and a "What's new" for launches. Prefer empty states over tours and carousels.
4
+
5
+ ## Inputs and ownership
6
+
7
+ Supply the setup tasks with what each does and where it's done, events from the application when each task actually happens, whether onboarding was dismissed (stored per person), the empty regions with their one next step, any tour's steps with the elements they point at, and the list of changes with which ones this person has seen. The application owns task detection (a task is done when the thing happened, not when someone clicked the item), where dismissal is remembered, and when a tour may be offered.
8
+
9
+ ## States and transitions
10
+
11
+ **Setup checklist.** A read-only list of tasks: each is **stamped done by the application when the task actually happens**, wherever it happens, never by clicking the item; an unfinished task offers one button that goes to where it's done. Progress is a **`Meter`** ("2 of 4"), because completeness is a reading, not a task under way: never `Progress`. The checklist never blocks the app. It can be skipped while unfinished ("Skip for now") and hidden once finished ("Hide setup guide"); either way it can be found again from Help, and the page says so. (The editable `Checklist` is for lists people write; a setup list is read-only, so it's a plain list with Done plates.)
12
+
13
+ **Empty states before tours.** Each empty region is an `EmptyState` that says what's empty, what will appear, and opens with its one action ("Connect a data source"). Doing it fills the region and stamps the matching setup task.
14
+
15
+ **Tours** (`Tour`) only for changes to an interface someone already uses, at most a few steps, never dimming the page and **never starting on their own on every visit**: offer them ("Show me what changed in the sidebar"), and let Escape or Skip end them.
16
+
17
+ **What's new** is a `Popover` or `Sheet` listing changes as a `Timeline` (newest first), with a count `Badge` only for unseen items; opening it marks them seen and the count goes.
18
+
19
+ ## Content, keyboard, focus and announcements
20
+
21
+ Write tasks as outcomes ("Invite your team") with one line on why. Stamped tasks keep their text readable (muted, not struck through). Hiding the guide announces where to find it. The tour's cards are non-modal dialogs that take focus and return it; What's new is reachable by keyboard and closes with Escape. Everything fits at 320px. Verify forced colors (Done plates and the meter stay visible), reduced motion, zoom and RTL.
22
+
23
+ ## Recovery and working implementation
24
+
25
+ Onboarding is optional: dismissing it never loses anything, and every surface can be reopened. If task detection fails, the task stays unstamped and its button still works. The working example in `build/fixtures/patterns/onboarding.jsx` (shipped as `references/build/fixtures/patterns/onboarding.jsx`) composes a stamped setup checklist with a Meter, an empty state whose action stamps a task, an opt-in tour, and What's new with an unseen count. It is also the Storybook preview "Patterns/OnboardingPattern". [Metadata](onboarding.json) names the runtime and verification sources.
26
+
27
+ ## Rules, verification and evidence
28
+
29
+ `ALT-ONBOARD-001` covers stamped tasks, progress as a reading, empty states before tours, opt-in tours and dismissible, re-findable surfaces; `ALT-STATUS-001` covers announcements; `ALT-VISUAL-003` covers what must not rise. `build/checks/onboarding-pattern.mjs` checks the example in a browser. See [rules](../rules.json). Which tasks belong on a setup list still needs evaluation with representative users.
30
+
31
+ See [running examples and verification](../principles.md#run-the-examples-and-verification) for the installed example command, repository test command, and the limits of shipped test-reference snapshots.
@@ -0,0 +1,72 @@
1
+ {
2
+ "schemaVersion": 1,
3
+ "id": "review-submit",
4
+ "version": 1,
5
+ "title": "Review and submit",
6
+ "intents": [
7
+ "review",
8
+ "submit",
9
+ "process",
10
+ "application",
11
+ "wizard",
12
+ "answers"
13
+ ],
14
+ "purpose": "Review and correct answers before final commitment.",
15
+ "useWhen": [
16
+ "A process benefits from reviewing meaningful choices before submission."
17
+ ],
18
+ "avoidWhen": [
19
+ "Use edit-record for a short simple save; avoid extra steps without a task need."
20
+ ],
21
+ "alternatives": [
22
+ "Use edit-record for a short simple save; avoid extra steps without a task need."
23
+ ],
24
+ "requiredInputs": [
25
+ "initial answers",
26
+ "validation",
27
+ "submission promise returning receipt",
28
+ "step and correction routing",
29
+ "durable draft/receipt storage if needed"
30
+ ],
31
+ "states": [
32
+ "editing",
33
+ "invalid",
34
+ "reviewing",
35
+ "submitting",
36
+ "failure",
37
+ "complete"
38
+ ],
39
+ "transitions": [
40
+ "editing \u2192 reviewing after validation",
41
+ "reviewing \u2192 editing to correct",
42
+ "reviewing \u2192 submitting",
43
+ "submitting \u2192 failure or complete",
44
+ "failure \u2192 retry with retained applicable data"
45
+ ],
46
+ "rules": [
47
+ "ALT-REVIEW-001",
48
+ "ALT-EDIT-001",
49
+ "ALT-EDIT-002",
50
+ "ALT-STATUS-001"
51
+ ],
52
+ "sources": [
53
+ "govuk-validation",
54
+ "wcag22"
55
+ ],
56
+ "authority": "contextual-pattern",
57
+ "applicability": "A process benefits from reviewing meaningful choices before submission.",
58
+ "exceptions": [
59
+ "Require only states supported by the application; do not fabricate capabilities."
60
+ ],
61
+ "maturity": "provisional",
62
+ "evidenceStatus": "engineering-fixtures; human-effectiveness-unmeasured",
63
+ "document": "patterns/review-submit.md",
64
+ "implementation": "project/components/src/pattern-review-submit.tsx",
65
+ "examples": [
66
+ "build/fixtures/pattern-workflows.tsx",
67
+ "scripts/build-framework-fixture.mjs"
68
+ ],
69
+ "verification": [
70
+ "build/checks/pattern-workflows.mjs"
71
+ ]
72
+ }
@@ -0,0 +1,27 @@
1
+ # Review and submit
2
+
3
+ Help someone inspect and correct meaningful answers before final commitment. Use a review stage for processes whose consequences or complexity warrant it. Prefer edit-record for a simple save; an extra review step is not automatically more usable. Do not invent steps or progress percentages unsupported by the real process.
4
+
5
+ ## Inputs and ownership
6
+
7
+ Supply initial answers, business validation, final submission and a meaningful receipt returned by the service. The app owns step navigation, applicable conditional answers, authorization, durable draft storage, server idempotency and a receipt destination. Reuse known information rather than requiring redundant entry unless a scoped exception applies. If interruption recovery across reload is required, store it in the app or service; in-memory state is not durable recovery.
8
+
9
+ ## States and transitions
10
+
11
+ Runtime phases are `editing`, `review`, `submitting` and `complete`; validation is represented by `errors`, and rejected submission returns to `review` with `error` while retaining answers. Editing becomes reviewing after validation succeeds; invalid answers remain editable with clear errors. Review shows the actual submitted values and labels, including omitted/optional answers where useful. Correction returns to editing while preserving still-applicable data. Explicit final commitment becomes submitting, then failure or complete. Failed submission keeps answers and permits retry. A service-confirmed receipt establishes complete; correcting a completed process must follow product rules rather than silently resubmitting. Newer edits and stale responses follow edit-record protections.
12
+
13
+ ## Content, keyboard, focus and announcements
14
+
15
+ Say where the person is in the process using meaningful step labels. Give each Change action an accessible name tied to the answer. Focus the heading or relevant field after stage changes and return logically to the review item after correction. Errors use inline text plus a linked summary when appropriate. Use native form semantics and named buttons; Enter must not accidentally bypass a required review. Announce submission progress and failure with `WorkflowStatus`. Completion states what was received, the real reference and next steps; retain it visibly instead of relying on a transient toast.
16
+
17
+ On narrow screens place each answer near its Change action and allow long values to wrap. Avoid a wide stepper as the only indication of position. Preserve logical order in RTL and test zoom, forced colors and reduced motion. Never convey completion only through green or elevation.
18
+
19
+ ## Recovery and working implementation
20
+
21
+ Compose `useReviewSubmit`, `ErrorSummary`, `WorkflowStatus` and ordinary controls from the main package export. The working composition in `build/fixtures/pattern-workflows.tsx` exercises review, correction, retained answers, rejected submission, retry and a service result. Its shipped snapshot is `references/build/fixtures/pattern-workflows.tsx`; [metadata](review-submit.json) maps implementation and tests. Use the hook's explicit review/correct/submit operations and render the returned receipt. Adapters must reconcile ambiguous network failure before retrying consequential submissions and restore drafts/receipts across reload when promised.
22
+
23
+ ## Rules, verification and evidence
24
+
25
+ `ALT-REVIEW-001` covers correction, retained applicable information and truthful persistent confirmation. `ALT-EDIT-001`, `ALT-EDIT-002` and `ALT-STATUS-001` carry save/error/feedback obligations into the process. Verify the complete journey and data outcome, not only each isolated step. Check repeated activation, correction after invalid review, failed submission and interruption recovery in the application. [Metadata](review-submit.json) records contextual authority, sources, applicability, exceptions and provisional evidence. Human comprehension and process suitability remain unmeasured by the engineering suite.
26
+
27
+ See [running examples and verification](../principles.md#run-the-examples-and-verification) for the installed example command, repository test command, and the limits of shipped test-reference snapshots.
@@ -0,0 +1,79 @@
1
+ {
2
+ "schemaVersion": 1,
3
+ "id": "screen-layout",
4
+ "version": 1,
5
+ "title": "Screen layout",
6
+ "intents": [
7
+ "screen layout",
8
+ "page layout",
9
+ "new screen",
10
+ "new page",
11
+ "compose a screen",
12
+ "dashboard",
13
+ "focused editor",
14
+ "approve",
15
+ "approval",
16
+ "report",
17
+ "triage",
18
+ "inbox",
19
+ "setup flow"
20
+ ],
21
+ "purpose": "Choose a screen's frame from the person's task, the one thing that leads and the one primary action, instead of inheriting a sidebar, a top bar and a grid of cards.",
22
+ "useWhen": [
23
+ "Composing a new screen or a new app, before choosing where anything goes."
24
+ ],
25
+ "avoidWhen": [
26
+ "Copying the records frame (sidebar, filtered table, record in a sheet) for a screen whose task isn't working through many similar records."
27
+ ],
28
+ "alternatives": [
29
+ "Inside a chosen frame, follow the task pattern for the work itself: edit record, consequential action, review and submit, async collection."
30
+ ],
31
+ "requiredInputs": [
32
+ "the task in one sentence: who is here and what they came to do",
33
+ "the one thing that leads the screen",
34
+ "the one primary action, or none",
35
+ "what the person does next once the task is done"
36
+ ],
37
+ "states": [
38
+ "task-named",
39
+ "frame-chosen",
40
+ "built",
41
+ "checked-against-task",
42
+ "task-done"
43
+ ],
44
+ "transitions": [
45
+ "task-named → frame-chosen from the frame table, never by default",
46
+ "frame-chosen → built with the lead first in reading order and largest in the view",
47
+ "built → checked-against-task: each stated choice is visible, or the record or the screen changes",
48
+ "task-done → the next thing, said where the lead was"
49
+ ],
50
+ "rules": [
51
+ "ALT-LAYOUT-001",
52
+ "ALT-VISUAL-002",
53
+ "ALT-VISUAL-003"
54
+ ],
55
+ "sources": [
56
+ "altitude-elevation",
57
+ "task-review"
58
+ ],
59
+ "authority": "contextual-pattern",
60
+ "applicability": "Any new screen: its frame, what leads it and where its one primary action sits.",
61
+ "exceptions": [
62
+ "An existing product keeps its navigation frame; choose the frame of the view inside it from the task."
63
+ ],
64
+ "maturity": "provisional",
65
+ "evidenceStatus": "engineering-fixtures; human-effectiveness-unmeasured",
66
+ "document": "patterns/screen-layout.md",
67
+ "implementation": "build/fixtures/patterns/screen-layout-editor.jsx",
68
+ "examples": [
69
+ "build/fixtures/patterns/screen-layout-editor.jsx",
70
+ "build/fixtures/patterns/screen-layout-decision.jsx",
71
+ "build/fixtures/patterns/screen-layout-report.jsx",
72
+ "build/fixtures/patterns/app-skeleton.jsx"
73
+ ],
74
+ "verification": [
75
+ "build/checks/screen-layout-pattern.mjs",
76
+ "build/checks/render-tells.mjs",
77
+ "build/checks/pattern-types.mjs"
78
+ ]
79
+ }
@@ -0,0 +1,40 @@
1
+ # Screen layout
2
+
3
+ Choose a screen's frame from the person's task. The same sidebar, top bar and grid of cards or table on every screen is the most recognisable structure of a generated app, and it fits only one task: working through many similar records. Name the task first, then choose the frame that fits it.
4
+
5
+ ## Inputs and ownership
6
+
7
+ Before placing anything, write down four things in the application's design record: **the task** in one sentence (who is here and what they came to do), **the lead** (the one thing the screen is about), **the primary action** (one, or none), and **what comes next** once the task is done. The application owns them; this pattern only turns them into a frame. If two leads compete, the screen is two screens, or one of them is secondary.
8
+
9
+ ## States and transitions
10
+
11
+ Name the task, choose the frame from the table, build it, then check the build against what you wrote. Every stated choice must be visible on the screen: if the record says the draft leads, the draft is the first thing after the title and the largest thing in the view. If it isn't, change the screen or the record. When the task is done, say so where the lead was, with the next thing to do.
12
+
13
+ | Frame | Fits when the person came to | What leads | Built from |
14
+ | --- | --- | --- | --- |
15
+ | Records | find, compare and act on many similar records | the table, filtered | `AppShell`, `FilterBar`, `DataTable`, `Sheet`: the [app skeleton](../app-skeleton.md) |
16
+ | List and detail | triage: work through items one at a time | the open item | `ResizablePanelGroup` (it stacks when narrow), a list, a `PropertyList` |
17
+ | Focused editor | make or change one thing | the thing being made | `Breadcrumb` back, `PageHeader` with one primary action, the editor, `SyncIndicator` or `SaveBar` |
18
+ | Guided flow | set something up in order | the current step | `Stepper` and the [review and submit](review-submit.md) contract |
19
+ | Decision | approve, choose or confirm | the choice and its consequence | the [consequential action](consequential-action.md) contract, `PlanPicker`, `Confirmation` |
20
+ | Report | read and understand | a chart with a `takeaway`, or one `Stat size="hero"` | `ChartContainer`, `Stat`, `StatGroup` for the secondary numbers ([Charts](../../Charts.md)) |
21
+
22
+ **Focused editor.** No navigation sidebar: a breadcrumb back is enough. The thing being made fills the column; details about it sit beside it, narrower and quieter. The one primary action (Publish, Send) is in the page header; saving is a status, not a second button.
23
+
24
+ **Decision.** The question is the title. The consequence, in words, and the two choices sit together straight under it, before the evidence; the evidence follows for whoever needs it. Declining asks for its reason in place. Once decided, the outcome replaces the choice and points to the next request.
25
+
26
+ **Report.** The takeaway is the heading of the chart that leads, written from the data. Secondary numbers follow, smaller and grouped, never as a row of equal cards above the chart.
27
+
28
+ ## Content, keyboard, focus and announcements
29
+
30
+ The title says the task's object ("Week 44 release note", "Refund €420 to Northwind?"). Reading order follows importance: title, lead, primary action, then the rest. Each frame keeps a keyboard path through the lead and returns focus where an action started: cancelling a decline returns to Decline, and an outcome takes focus when it replaces the control that had it. Saving and outcomes are announced as status. Every frame fits at 320px, where the side column stacks under the lead.
31
+
32
+ ## Recovery and working implementation
33
+
34
+ If the task changes, re-choose the frame instead of adding a second lead. The working examples are `build/fixtures/patterns/screen-layout-editor.jsx`, `screen-layout-decision.jsx` and `screen-layout-report.jsx` (shipped under `references/build/fixtures/patterns/`), each with its design record in its first lines. They're also the Storybook previews "Patterns/ScreenLayoutEditor", "Patterns/ScreenLayoutDecision" and "Patterns/ScreenLayoutReport"; the records frame is the [app skeleton](../app-skeleton.md). [Metadata](screen-layout.json) names the verification sources.
35
+
36
+ ## Rules, verification and evidence
37
+
38
+ `ALT-LAYOUT-001` covers naming the task, the lead and the primary action before choosing a frame; `ALT-VISUAL-002` covers one primary action per view; `ALT-VISUAL-003` covers what must not rise. `build/checks/screen-layout-pattern.mjs` checks each example in a browser: the stated lead is first after the title and the largest region, there's at most one primary action, and its keyboard and focus behaviour. `build/checks/render-tells.mjs` reports unled equal sets and flat stacks. Structure is where generated interfaces converge most (Research, "Generated interfaces converge"); whether naming the task first moves agents away from the default is unmeasured until the distinctiveness benchmark runs with and without this pattern.
39
+
40
+ See [running examples and verification](../principles.md#run-the-examples-and-verification) for the installed example command, repository test command, and the limits of shipped test-reference snapshots.