@mistriwork/kit 1.0.0-rc.17 → 1.0.0-rc.18

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 (99) hide show
  1. package/dist/client/components/AppList.js +16 -6
  2. package/dist/client/components/Chart.css +5 -0
  3. package/dist/client/components/Chart.d.ts +17 -2
  4. package/dist/client/components/Chart.js +83 -22
  5. package/dist/client/components/ChartFigure.d.ts +3 -1
  6. package/dist/client/components/ChartFigure.js +14 -8
  7. package/dist/client/components/Content.js +3 -1
  8. package/dist/client/components/DashHead.d.ts +6 -0
  9. package/dist/client/components/DashHead.js +20 -0
  10. package/dist/client/components/Editable.js +1 -1
  11. package/dist/client/components/Grid.js +33 -4
  12. package/dist/client/components/JsonPreview.css +29 -0
  13. package/dist/client/components/JsonPreview.js +1 -1
  14. package/dist/client/components/JsonView.css +201 -62
  15. package/dist/client/components/JsonView.d.ts +43 -1
  16. package/dist/client/components/JsonView.js +320 -55
  17. package/dist/client/components/LayoutSwitch.d.ts +9 -0
  18. package/dist/client/components/LayoutSwitch.js +61 -0
  19. package/dist/client/components/ListEmpty.css +3 -0
  20. package/dist/client/components/LiveNotices.css +3 -0
  21. package/dist/client/components/NewRecord.d.ts +0 -2
  22. package/dist/client/components/NewRecord.js +61 -17
  23. package/dist/client/components/PageFields.js +22 -3
  24. package/dist/client/components/PageHead.js +26 -6
  25. package/dist/client/components/PageRelated.d.ts +28 -0
  26. package/dist/client/components/PageRelated.js +50 -3
  27. package/dist/client/components/PageSectionBox.d.ts +5 -1
  28. package/dist/client/components/PageSectionBox.js +5 -3
  29. package/dist/client/components/PageSections.js +26 -13
  30. package/dist/client/components/PageSkeleton.css +2 -0
  31. package/dist/client/components/PageSkeleton.js +11 -3
  32. package/dist/client/components/Palette.js +108 -10
  33. package/dist/client/components/RecordPicker.d.ts +2 -0
  34. package/dist/client/components/RecordPicker.js +34 -8
  35. package/dist/client/components/RecordSummaries.js +6 -1
  36. package/dist/client/components/Rooms.js +2 -2
  37. package/dist/client/components/TableRoom.js +15 -5
  38. package/dist/client/components/TableView.d.ts +2 -0
  39. package/dist/client/components/Value.js +1 -1
  40. package/dist/client/components/appListModel.d.ts +4 -0
  41. package/dist/client/components/appRooms.d.ts +2 -0
  42. package/dist/client/components/appRooms.js +2 -0
  43. package/dist/client/components/dashboardModel.d.ts +5 -0
  44. package/dist/client/components/directoryModel.d.ts +25 -0
  45. package/dist/client/components/directoryModel.js +88 -0
  46. package/dist/client/components/gridSizing.d.ts +3 -0
  47. package/dist/client/components/gridSizing.js +6 -2
  48. package/dist/client/components/jsonTree.d.ts +54 -0
  49. package/dist/client/components/jsonTree.js +190 -0
  50. package/dist/client/components/listSubtitles.d.ts +1 -0
  51. package/dist/client/components/listSubtitles.js +7 -0
  52. package/dist/client/components/newMenuModel.d.ts +14 -6
  53. package/dist/client/components/newMenuModel.js +37 -5
  54. package/dist/client/components/newRecordModel.d.ts +24 -2
  55. package/dist/client/components/newRecordModel.js +47 -4
  56. package/dist/client/components/pageContext.d.ts +2 -0
  57. package/dist/client/components/pageModel.d.ts +2 -0
  58. package/dist/client/components/sidebarModel.js +7 -3
  59. package/dist/client/composedReads.js +3 -1
  60. package/dist/client/copy/lists/components/AppList.d.ts +1 -0
  61. package/dist/client/copy/lists/components/AppList.js +1 -0
  62. package/dist/client/copy/lists/components/LayoutSwitch.d.ts +4 -0
  63. package/dist/client/copy/lists/components/LayoutSwitch.js +6 -0
  64. package/dist/client/copy/record/components/JsonView.d.ts +22 -0
  65. package/dist/client/copy/record/components/JsonView.js +19 -0
  66. package/dist/client/copy/record/components/PageHead.d.ts +1 -0
  67. package/dist/client/copy/record/components/PageHead.js +2 -0
  68. package/dist/client/copy/shell/components/Palette.d.ts +11 -0
  69. package/dist/client/copy/shell/components/Palette.js +14 -0
  70. package/dist/client/copy/shell/components/TopNav.d.ts +2 -1
  71. package/dist/client/copy/shell/components/TopNav.js +4 -2
  72. package/dist/client/copy/shell/components/directoryModel.d.ts +4 -0
  73. package/dist/client/copy/shell/components/directoryModel.js +6 -0
  74. package/dist/client/copy/shell/components/sidebarModel.d.ts +1 -0
  75. package/dist/client/copy/shell/components/sidebarModel.js +1 -0
  76. package/dist/client/core.d.ts +3 -3
  77. package/dist/client/core.js +6 -7
  78. package/dist/client/features.css +67 -7
  79. package/dist/client/index.html +2 -1
  80. package/dist/client/insert.js +1 -8
  81. package/dist/client/locale.d.ts +7 -0
  82. package/dist/client/locale.js +0 -0
  83. package/dist/client/lumenLook.css +9 -12
  84. package/dist/client/page.css +56 -15
  85. package/dist/client/palette.d.ts +3 -1
  86. package/dist/client/palette.js +19 -4
  87. package/dist/client/paletteRecents.d.ts +25 -0
  88. package/dist/client/paletteRecents.js +64 -0
  89. package/dist/client/partsLook.css +6 -3
  90. package/dist/client/sageLook.css +5 -3
  91. package/dist/client/shellMode.d.ts +2 -0
  92. package/dist/client/shellMode.js +1 -0
  93. package/dist/client/structure.css +201 -1
  94. package/dist/client/style.css +59 -10
  95. package/dist/client/themeFamilies.css +37 -0
  96. package/dist/client/visualThemes.css +12 -0
  97. package/dist/client/workbenchLook.css +415 -0
  98. package/dist/client/workshopLook.css +48 -25
  99. package/package.json +4 -3
@@ -1,3 +1,9 @@
1
+ /**
2
+ * The New form's rules, apart from its drawing (NewRecord.tsx, DefinedFields.tsx, PageRelated.tsx): which columns it
3
+ * asks and in what groups, which a condition hides, what each starts at (a declared default, today or now, a flag's
4
+ * start), the control each field gets, how an earlier pick narrows a later one, whether it opens as a drawer or a page,
5
+ * and what is missing or changed before the values are written.
6
+ */
1
7
  import { coerceForColumn, columnKind, isFlagColumn } from '@mistriwork/engine/shared/schema.js';
2
8
  import { autoKey, formShownFields, isRequired } from '@mistriwork/engine/shared/form.js';
3
9
  import { evaluateFormCondition, typedValue } from '@mistriwork/engine/shared/formValues.js';
@@ -37,15 +43,23 @@ function editableColumns(table, app) {
37
43
  // A machine's column starts in its first state and then moves only by its verbs.
38
44
  return table.columns.filter((c) => c.writable !== false && c.changesBy !== 'actions' && c.identity !== 'always' && !(app && c.identity) && c.name !== assigned);
39
45
  }
40
- export function formColumns(table, form, app) {
46
+ /**
47
+ * The columns a New form asks, in order. `written` is what the database and the App's machine fill without being
48
+ * asked (platformWritten in form.ts): left out where the form names its fields by the schema, kept where the App's
49
+ * form names one itself (in `show`, a step or a group), since a declared field is the author's to ask.
50
+ */
51
+ export function formColumns(table, form, app, written) {
41
52
  const shown = formShownFields(form);
42
- const columns = shown ? [...new Set(shown)].flatMap((name) => table.columns.find((c) => c.name === name) ?? []) : table.columns;
53
+ const named = new Set(form?.groups?.flatMap((group) => group.fields) ?? []);
54
+ const columns = shown
55
+ ? [...new Set(shown)].flatMap((name) => table.columns.find((c) => c.name === name) ?? [])
56
+ : table.columns.filter((c) => !written?.has(c.name) || named.has(c.name));
43
57
  const editable = new Set(editableColumns(table, app));
44
58
  return columns.filter((c) => editable.has(c));
45
59
  }
46
60
  /** Grouped fields retain authored order; ungrouped fields follow in form order. */
47
- export function formGroups(table, form, app) {
48
- const columns = formColumns(table, form, app);
61
+ export function formGroups(table, form, app, written) {
62
+ const columns = formColumns(table, form, app, written);
49
63
  if (!form?.groups?.length)
50
64
  return [{ label: '', columns }];
51
65
  const byName = new Map(columns.map((column) => [column.name, column]));
@@ -134,6 +148,9 @@ export function formFrame(form, fieldCount) {
134
148
  const PROSE = /^(?:description|notes?|body|bio|biography|comments?|summary|details|message|instructions|remarks|content|about)$|_(?:notes?|description|details|comments?|summary)$/i;
135
149
  /** Radios show every word at once; past this many the listbox is shorter. The command form's rule. */
136
150
  const RADIO_WORDS = 4;
151
+ /** A choice declared as cards, up to this many words and none described, is a row of picks instead: five stacked cards
152
+ took 270px to say five words (docs/design.md, Forms). A card that carries a description keeps its card. */
153
+ export const SEGMENTED_WORDS = 5;
137
154
  /** The declared length of a text column, when its type says one: `varchar(500)` → 500. */
138
155
  function declaredLength(column) {
139
156
  const match = /\(\s*(\d+)\s*\)/.exec(column.type);
@@ -204,6 +221,32 @@ export function narrowingCondition(where, values) {
204
221
  }
205
222
  return clauses.join(' and ');
206
223
  }
224
+ /**
225
+ * The pickers a form narrows by an earlier pick where the App's form says nothing (`fields.<column>.where`): a
226
+ * reference whose table points at the table of a required reference asked before it, by exactly one column, offers
227
+ * only the records under that pick — a job's site among the chosen customer's sites, never every customer's. An
228
+ * optional earlier pick narrows nothing, since a picker waiting on a field that may stay empty would wait for good.
229
+ * The narrowing is the picker's, as a declared one is: the server still takes any record the reader may name.
230
+ */
231
+ export function inferredNarrowing(columns, target) {
232
+ const narrowed = {};
233
+ columns.forEach((later, at) => {
234
+ const into = later.references ? target(later.references.table) : undefined;
235
+ if (!into)
236
+ return;
237
+ for (const earlier of columns.slice(0, at)) {
238
+ const up = earlier.references;
239
+ if (!up || earlier.nullable !== false || up.table === later.references.table)
240
+ continue;
241
+ const via = into.columns.filter((column) => column.references?.table === up.table && column.references.column === up.column);
242
+ if (via.length !== 1)
243
+ continue;
244
+ narrowed[later.name] = { [via[0].name]: earlier.name };
245
+ return;
246
+ }
247
+ });
248
+ return narrowed;
249
+ }
207
250
  /**
208
251
  * Where a flag's switch starts: the form's default, else the database's when
209
252
  * it is a plain true or false, else off for a flag that must be answered. A
@@ -144,6 +144,8 @@ export interface SlotProps {
144
144
  onTitleEditor?: (index: number, render: (() => ReactNode) | undefined) => void;
145
145
  /** An empty related list said in one line with its neighbours: it draws its Add alone (PageEmptyRun.tsx). */
146
146
  collapsed?: boolean;
147
+ /** A related list alone on an inferred page: it says its count beside its heading, as a tab would. */
148
+ counted?: boolean;
147
149
  }
148
150
  /**
149
151
  * How this reader's rows are named, as a record page's reads are built from
@@ -82,6 +82,8 @@ export interface PageSection {
82
82
  /** A record header's status column, fact words, filled verb and destructive verbs (shared/pageModel.ts). */
83
83
  status?: string;
84
84
  factLabels?: Record<string, import('@mistriwork/engine/shared/appCards.js').FactLabel>;
85
+ /** An inferred header's spans: a start fact's end column, said with it as one range (shared/pageModel.ts, PageFields.spans). */
86
+ spans?: Record<string, string>;
85
87
  primary?: string;
86
88
  destructive?: string[];
87
89
  headerActions?: string[];
@@ -23,7 +23,7 @@ import { currentEntry, state, tableView, walkVersion } from '../core.js';
23
23
  import { shell } from '../shellMode.js';
24
24
  import { appListFor, appListQuery, currentNavIndex } from './appListModel.js';
25
25
  import { menuCount } from '@mistriwork/engine/shared/menuCounts.js';
26
- import { ASSISTANT_PAGE, appMenu, dashViewKey, formViewKey, hasRooms, homeRoom, isAssistantRoom, isListRoom, } from './appRooms.js';
26
+ import { ASSISTANT_PAGE, DIRECTORY_PAGE, appMenu, dashViewKey, formViewKey, hasRooms, homeRoom, isAssistantRoom, isListRoom, } from './appRooms.js';
27
27
  import { isServedForm as isFormView } from '@mistriwork/engine/shared/servedApp.js';
28
28
  import { shownFavorites } from './favoriteNav.js';
29
29
  import { formatApprox, formatNumber } from '../locale.js';
@@ -125,6 +125,10 @@ export function sidebarItems(filterText) {
125
125
  .filter(foot)
126
126
  .flatMap((node, k) => walk([node], 0, false).map((item, at) => at === 0 ? { ...item, footOrder: 2 * k + 2, anchored: true } : { ...item, footOrder: 2 * k + 1 }));
127
127
  items.push(...walk(menu.filter((node) => !foot(node)), 0, false));
128
+ /* A menu past a dozen places ends in its Directory (Directory.tsx): every one of them, found by typing. Not
129
+ while the menu's own filter is in use, which is the same search in a smaller box. */
130
+ if (app.directory && !needle)
131
+ items.push({ kind: 'form', view: DIRECTORY_PAGE, label: say('allPages'), icon: app.directory.icon, page: DIRECTORY_PAGE });
128
132
  if (footer.length)
129
133
  items.push({ kind: 'gap' }, ...footer);
130
134
  if (!matches && needle)
@@ -287,8 +291,8 @@ export function currentDashView() {
287
291
  /** Which form row is lit, by its view key: the one on the walk, or the signed-in form served as this visitor's home. */
288
292
  export function currentFormView() {
289
293
  const here = currentEntry();
290
- if (here?.kind === 'page' && here.pageId === ASSISTANT_PAGE)
291
- return ASSISTANT_PAGE;
294
+ if (here?.kind === 'page' && (here.pageId === ASSISTANT_PAGE || here.pageId === DIRECTORY_PAGE))
295
+ return here.pageId;
292
296
  const onWalk = here?.kind === 'page' ? formViewKey(here.pageId) : undefined;
293
297
  if (onWalk !== undefined)
294
298
  return onWalk;
@@ -114,7 +114,9 @@ function forgetComposed() {
114
114
  /* A record's own read no longer waits for a compose begun before the write: it could not answer it. */
115
115
  pending.clear();
116
116
  }
117
- const COMPOSABLE = new Set(['/api/view/run', '/api/run', '/api/breakdown', '/api/record-history']);
117
+ /* `/api/counts` is an inferred page's related tabs (PageRelated.tsx, useRelatedCounts): asked by the server with the
118
+ body the client builds, so the strip's counts arrive with the page and add no request of their own. */
119
+ const COMPOSABLE = new Set(['/api/view/run', '/api/run', '/api/breakdown', '/api/record-history', '/api/counts']);
118
120
  /** Whether a compose kept, or on its way, could answer this request: asked before waiting on one, so any other request goes out in the same moment it always did. */
119
121
  export function mayBeComposed(path) {
120
122
  return COMPOSABLE.has(path) && (held.length > 0 || pending.size > 0);
@@ -25,4 +25,5 @@ export declare const say: import("../../../messages.js").RoomMessage<{
25
25
  readonly match: "{gridTotal} match";
26
26
  readonly captionFilters: "{caption} filters";
27
27
  readonly everything: "Everything";
28
+ readonly layout: "Show {caption} as";
28
29
  }>;
@@ -27,4 +27,5 @@ export const say = defineMessages({
27
27
  match: '{gridTotal} match',
28
28
  captionFilters: '{caption} filters',
29
29
  everything: 'Everything',
30
+ layout: 'Show {caption} as',
30
31
  });
@@ -0,0 +1,4 @@
1
+ export declare const say: import("../../../messages.js").RoomMessage<{
2
+ readonly asList: "List";
3
+ readonly asBoard: "Board";
4
+ }>;
@@ -0,0 +1,6 @@
1
+ /** What LayoutSwitch says, in the lists and grid room (packages/kit/src/client/messages.ts says how the catalog is split). */
2
+ import { defineMessages } from '../../../messages.js';
3
+ export const say = defineMessages({
4
+ asList: 'List',
5
+ asBoard: 'Board',
6
+ });
@@ -1,10 +1,32 @@
1
1
  export declare const say: import("../../../messages.js").RoomMessage<{
2
+ readonly document: "JSON document";
3
+ readonly view: "View";
4
+ readonly tree: "Tree";
2
5
  readonly raw: "Raw";
3
6
  readonly rawJson: "Raw JSON";
7
+ readonly wrap: "Wrap";
8
+ readonly wrapLines: "Wrap long lines";
9
+ readonly expandAll: "Expand all";
10
+ readonly collapseAll: "Collapse all";
11
+ readonly filter: "Filter";
12
+ readonly filterKeysAndValues: "Filter keys and values";
13
+ readonly matches: {
14
+ readonly one: "{count} match";
15
+ readonly other: "{count} matches";
16
+ };
17
+ readonly noMatches: "No matches";
4
18
  readonly copied: "Copied";
5
19
  readonly copyRefused: "Copy refused";
6
20
  readonly copy: "Copy";
21
+ readonly copyValue: "Copy value";
22
+ readonly copyPath: "Copy path";
23
+ readonly copyValueOf: "Copy value of {path}";
24
+ readonly copyPathOf: "Copy path {path}";
7
25
  readonly copiedTheJson: "Copied the JSON.";
26
+ readonly copiedValueOf: "Copied the value of {path}.";
27
+ readonly copiedPath: "Copied the path {path}.";
28
+ readonly row: "Row {n}";
29
+ readonly rowRest: "Row {n}, the rest";
8
30
  readonly notShown: "{total} not shown";
9
31
  readonly showMore: "Show {next} more";
10
32
  readonly moreFolded: "+{count} more";
@@ -1,12 +1,31 @@
1
1
  /** What JsonView says, in the record page room (packages/kit/src/client/messages.ts says how the catalog is split). */
2
2
  import { defineMessages } from '../../../messages.js';
3
3
  export const say = defineMessages({
4
+ document: 'JSON document',
5
+ view: 'View',
6
+ tree: 'Tree',
4
7
  raw: 'Raw',
5
8
  rawJson: 'Raw JSON',
9
+ wrap: 'Wrap',
10
+ wrapLines: 'Wrap long lines',
11
+ expandAll: 'Expand all',
12
+ collapseAll: 'Collapse all',
13
+ filter: 'Filter',
14
+ filterKeysAndValues: 'Filter keys and values',
15
+ matches: { one: '{count} match', other: '{count} matches' },
16
+ noMatches: 'No matches',
6
17
  copied: 'Copied',
7
18
  copyRefused: 'Copy refused',
8
19
  copy: 'Copy',
20
+ copyValue: 'Copy value',
21
+ copyPath: 'Copy path',
22
+ copyValueOf: 'Copy value of {path}',
23
+ copyPathOf: 'Copy path {path}',
9
24
  copiedTheJson: 'Copied the JSON.',
25
+ copiedValueOf: 'Copied the value of {path}.',
26
+ copiedPath: 'Copied the path {path}.',
27
+ row: 'Row {n}',
28
+ rowRest: 'Row {n}, the rest',
10
29
  notShown: '{total} not shown',
11
30
  showMore: 'Show {next} more',
12
31
  moreFolded: '+{count} more',
@@ -5,4 +5,5 @@ export declare const say: import("../../../messages.js").RoomMessage<{
5
5
  readonly thisPageBelongsToTheFile: "This page belongs to the file it came from — editing it starts your own copy";
6
6
  readonly layout: "Layout";
7
7
  readonly copyLayout: "Copy layout";
8
+ readonly when: "When";
8
9
  }>;
@@ -7,4 +7,6 @@ export const say = defineMessages({
7
7
  thisPageBelongsToTheFile: 'This page belongs to the file it came from — editing it starts your own copy',
8
8
  layout: 'Layout',
9
9
  copyLayout: 'Copy layout',
10
+ /* The caption of a fact said as a range, from its start to its end (pageAnatomy.ts, spanOf). */
11
+ when: 'When',
10
12
  });
@@ -12,4 +12,15 @@ export declare const say: import("../../../messages.js").RoomMessage<{
12
12
  readonly kindRecord: "record";
13
13
  readonly kindSql: "sql";
14
14
  readonly kindDatabase: "database";
15
+ readonly kindCreate: "create";
16
+ readonly kindDetail: "{kind} · {detail}";
17
+ readonly groupRecent: "Recent";
18
+ readonly groupPages: "Pages";
19
+ readonly groupCreate: "Create";
20
+ readonly groupCommands: "Commands";
21
+ readonly groupRecords: "Records";
22
+ readonly hintMove: "move";
23
+ readonly hintOpen: "open";
24
+ readonly hintClose: "close";
25
+ readonly keyEscape: "esc";
15
26
  }>;
@@ -15,4 +15,18 @@ export const say = defineMessages({
15
15
  kindRecord: 'record',
16
16
  kindSql: 'sql',
17
17
  kindDatabase: 'database',
18
+ kindCreate: 'create',
19
+ /* An App's row says what it opens in its line, first: "Page · Leasing". */
20
+ kindDetail: '{kind} · {detail}',
21
+ /* An App's palette sorts what it finds under these, in this order; a heading is a quiet label, not a badge. */
22
+ groupRecent: 'Recent',
23
+ groupPages: 'Pages',
24
+ groupCreate: 'Create',
25
+ groupCommands: 'Commands',
26
+ groupRecords: 'Records',
27
+ /* The footer's key hints: the keys are marks, these are what each does. */
28
+ hintMove: 'move',
29
+ hintOpen: 'open',
30
+ hintClose: 'close',
31
+ keyEscape: 'esc',
18
32
  });
@@ -1,4 +1,5 @@
1
1
  export declare const say: import("../../../messages.js").RoomMessage<{
2
- readonly searchK: "Search (⌘K)";
2
+ readonly searchK: "Search ⌘K";
3
3
  readonly search: "Search…";
4
+ readonly allPages: "All pages";
4
5
  }>;
@@ -1,12 +1,14 @@
1
1
  /** What TopNav says, in the shell room (packages/kit/src/client/messages.ts says how the catalog is split). */
2
2
  import { defineMessages } from '../../../messages.js';
3
3
  export const say = defineMessages({
4
- searchK: 'Search (⌘K)',
4
+ searchK: 'Search ⌘K',
5
5
  search: 'Search…',
6
+ allPages: 'All pages',
6
7
  }, {
7
8
  /* The words a visitor sees in the shell; the rest are said in English. */
8
9
  es: {
9
- searchK: 'Buscar (⌘K)',
10
+ searchK: 'Buscar ⌘K',
10
11
  search: 'Buscar…',
12
+ allPages: 'Todas las páginas',
11
13
  },
12
14
  });
@@ -0,0 +1,4 @@
1
+ export declare const say: import("../../../messages.js").RoomMessage<{
2
+ readonly more: "More";
3
+ readonly new: "New";
4
+ }>;
@@ -0,0 +1,6 @@
1
+ /** What directoryModel says, in the shell room (packages/kit/src/client/messages.ts says how the catalog is split). */
2
+ import { defineMessages } from '../../../messages.js';
3
+ export const say = defineMessages({
4
+ more: 'More',
5
+ new: 'New',
6
+ });
@@ -1,3 +1,4 @@
1
1
  export declare const say: import("../../../messages.js").RoomMessage<{
2
2
  readonly noMatches: "No matches.";
3
+ readonly allPages: "All pages";
3
4
  }>;
@@ -2,4 +2,5 @@
2
2
  import { defineMessages } from '../../../messages.js';
3
3
  export const say = defineMessages({
4
4
  noMatches: 'No matches.',
5
+ allPages: 'All pages',
5
6
  });
@@ -39,9 +39,9 @@ export declare const state: {
39
39
  /**
40
40
  * How many rows a page actually holds, which the reader chooses.
41
41
  *
42
- * `PAGE_SIZE` stays the default and stays equal to the server's
43
- * `DEFAULT_LIMIT` — twenty is right for a first look, and the first look is
44
- * what most browsing is. It was also the *only* size, which turned a
42
+ * `PAGE_SIZE` stays the default and stays equal to the size the server reads
43
+ * a list's first page at (`LIST_PAGE_SIZE`) — enough for a first look without
44
+ * paging, and the first look is what most browsing is. It was also the *only* size, which turned a
45
45
  * sixty-thousand-row table into three thousand clicks: a table you could read
46
46
  * the front of and nothing else.
47
47
  *
@@ -9,7 +9,7 @@
9
9
  * without reaching into the renderer.
10
10
  */
11
11
  import { flushSync } from 'react-dom';
12
- import { DEFAULT_LIMIT } from '@mistriwork/engine/shared/reads.js';
12
+ import { LIST_PAGE_SIZE } from '@mistriwork/engine/shared/reads.js';
13
13
  import { PAGE_HEADER } from '@mistriwork/engine/shared/pageRoutes.js';
14
14
  import { quoteValue } from '@mistriwork/engine/shared/query.js';
15
15
  import { connectionGeneration } from './connectionTransition.js';
@@ -56,15 +56,14 @@ export function $(id) {
56
56
  export const state = { schema: null, stack: [], page: 0, canWrite: false, navMode: 'replace' };
57
57
  /* A record page's composed answers (composedHook.ts) go to this connection when a request names none. */
58
58
  setComposedConnection(() => state.activeConnection ?? null);
59
- /* The server's DEFAULT_LIMIT. Small on purpose: the first page of a
60
- browse should be instant, and paging is one click. */
61
- const PAGE_SIZE = DEFAULT_LIMIT;
59
+ /* The server's first-paint size (LIST_PAGE_SIZE): the list's first page is read before the browser's window is known. */
60
+ const PAGE_SIZE = LIST_PAGE_SIZE;
62
61
  /**
63
62
  * How many rows a page actually holds, which the reader chooses.
64
63
  *
65
- * `PAGE_SIZE` stays the default and stays equal to the server's
66
- * `DEFAULT_LIMIT` — twenty is right for a first look, and the first look is
67
- * what most browsing is. It was also the *only* size, which turned a
64
+ * `PAGE_SIZE` stays the default and stays equal to the size the server reads
65
+ * a list's first page at (`LIST_PAGE_SIZE`) — enough for a first look without
66
+ * paging, and the first look is what most browsing is. It was also the *only* size, which turned a
68
67
  * sixty-thousand-row table into three thousand clicks: a table you could read
69
68
  * the front of and nothing else.
70
69
  *
@@ -7,7 +7,7 @@
7
7
  @import './components/FilterRail.css';
8
8
  @import './components/DateField.css';
9
9
  @import './components/ListFilterBar.css';
10
- @import './components/JsonView.css';
10
+ @import './components/JsonPreview.css';
11
11
  @import './components/ListEmpty.css';
12
12
  @import './components/Notes.css';
13
13
  /* The tool's own rules: the first layer (style.css names the order). */
@@ -445,6 +445,12 @@ body.app-mode .page-edit { font-family: var(--sans); }
445
445
  .tab .tab-count { display: inline-grid; margin-left: var(--space-2h); color: var(--ink-muted); font-size: var(--text-xs); font-variant-numeric: tabular-nums; }
446
446
  .tab .tab-count::before, .tab .tab-count > span { grid-area: 1 / 1; }
447
447
  .tab .tab-count::before { content: '00' / ''; visibility: hidden; }
448
+ /* A record's related tabs count the same way (an inferred page, PageRelated.tsx), in the tab's own small type, and
449
+ so does a related list alone, beside its heading. */
450
+ :is(.page-tab, .page-section-head) .tab-count { display: inline-grid; margin-left: var(--space-2h); color: var(--ink-muted); font-variant-numeric: tabular-nums; }
451
+ :is(.page-tab, .page-section-head) .tab-count::before, :is(.page-tab, .page-section-head) .tab-count > span { grid-area: 1 / 1; }
452
+ :is(.page-tab, .page-section-head) .tab-count::before { content: '00' / ''; visibility: hidden; }
453
+ .page-tab[aria-selected="true"] .tab-count { color: inherit; }
448
454
  /* The count takes the tab's ink whole: faded, it was 3.3:1 on a filled tab. */
449
455
  .tab[aria-selected="true"] .tab-count { color: inherit; }
450
456
  /* Quick filters: the list's key vocabularies as one-click conditions. */
@@ -799,6 +805,10 @@ body.first-run #db-label {
799
805
  .dash-head .dash-description { padding: 0; margin: var(--space-2h) 0 0; max-width: 70ch; font-size: var(--text-md); line-height: 1.5; }
800
806
  /* Filter controls already separate the heading from the dashboard body. */
801
807
  .dash-head:has(+ div .dash-controls) { margin-bottom: 0; }
808
+ /* `head: 'compact'`: the title at a list's size on one line with its star, and the body close under it — a working
809
+ page whose own controls are its intro. Same gutters as the full head, so switching the form moves nothing sideways. */
810
+ .dash-head-compact { align-items: center; gap: var(--space-2h); width: 100%; margin-bottom: var(--space-3); }
811
+ .dash-head-compact .applist-title { margin: 0; }
802
812
  .dash-strip { border: none; padding: 0; }
803
813
  /* The refresh staging ground: rendered for real (fetches and chart
804
814
  measurement need layout) but out of sight and out of the page's flow. */
@@ -835,6 +845,11 @@ body.first-run #db-label {
835
845
  card's width (Chart.tsx, Sparkline), its stroke and dot keeping their size. */
836
846
  .spark-host { display: block; align-self: stretch; margin-top: var(--space-3); height: 28px; width: 100%; min-width: 0; }
837
847
  .spark { width: 100%; height: 28px; display: block; }
848
+ /* A run with fewer than four periods above zero is thin bars over a baseline, kept short: stretched across a wide card
849
+ they read as a chart of nothing (Chart.tsx, Sparkline). */
850
+ .spark-sparse { max-width: 160px; }
851
+ .spark-bar { fill: none; stroke: var(--spark-ink, var(--accent)); stroke-width: 3; stroke-linecap: butt; opacity: 0.75; }
852
+ .spark-base { fill: none; stroke: var(--line); stroke-width: 1; }
838
853
  .spark-stroke { fill: none; stroke: var(--spark-ink, var(--accent)); stroke-width: 1.5; opacity: 0.75; }
839
854
  /* The last point: a round cap on a zero-length stroke, round however far the spark stretches. */
840
855
  .spark-dot { fill: none; stroke: var(--spark-ink, var(--accent)); stroke-width: 5; stroke-linecap: round; }
@@ -856,8 +871,12 @@ body.first-run #db-label {
856
871
  class, so the outline could change and the page not: each look still sets
857
872
  the type over this. */
858
873
  .page-section-title { margin-block: 1em; font-size: 1.17em; font-weight: bold; }
859
- button.ghost.dash-open { margin-left: auto; padding: var(--space-2) 0; border: 0; background: none; box-shadow: none; color: var(--link); font-size: var(--text-base); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; white-space: nowrap; }
860
- button.ghost.dash-open:hover { color: var(--ink); background: none; }
874
+ /* "View all" is a way on, not a thing to read: muted ink with its arrow, and the underline and the ink only under the
875
+ pointer. A bold underlined link in link ink was the loudest word on a section whose rows were the point. */
876
+ button.ghost.dash-open { margin-left: auto; padding: var(--space-2) 0; border: 0; background: none; box-shadow: none; color: var(--ink-muted); font-size: var(--text-base); font-weight: 500; text-decoration: none; text-underline-offset: 3px; white-space: nowrap; }
877
+ /* The arrow is drawn, not said: the button's name stays "View all" (alt text after the slash). */
878
+ button.ghost.dash-open::after { content: ' →' / ''; }
879
+ button.ghost.dash-open:hover { color: var(--ink); background: none; text-decoration: underline; }
861
880
  .dash-count { font-size: var(--text-sm); color: var(--ink-muted); font-family: var(--mono); }
862
881
  /* Inside a card the grid's own stat row (count, timing, Export) was a
863
882
  second strip of chrome between the title and the rows; the count worth
@@ -1217,6 +1236,8 @@ body.app-mode .sidebar[data-density="comfortable"] #table-list button { min-heig
1217
1236
  body.app-mode .sidebar[data-density="comfortable"] #table-list .nav-icon { width: var(--icon-ui); height: var(--icon-ui); }
1218
1237
  body.app-mode .sidebar[data-density="comfortable"] #table-list .nav-label { text-align: start; }
1219
1238
  body.app-mode .sidebar[data-density="comfortable"] #table-list li.nav-group { margin-top: var(--space-5); }
1239
+ /* All pages closes the menu (sidebarModel.ts) after the last group: a heading's gap above it, so it does not read as that group's last room. */
1240
+ #table-list li:has(> [data-form="app:directory"]) { margin-top: var(--space-3h); }
1220
1241
  /* A group's fold is its heading, not a room: the comfortable row above reached
1221
1242
  it too, and a nested group was a 13px, 46px row beside 10px headings. */
1222
1243
  body.app-mode .sidebar[data-density="comfortable"] #table-list li.nav-group .nav-group-fold { font: inherit; }
@@ -1400,9 +1421,6 @@ body.app-mode .sidebar[data-density="comfortable"] #table-list .nav-dot { width:
1400
1421
  .tn-all { margin-left: var(--space-2h); color: var(--ink-subtle); font-size: var(--text-sm); }
1401
1422
  .tn-all:hover { color: var(--ink-muted); }
1402
1423
 
1403
- /* A record hit in the palette: the row the words found. */
1404
- .palette-kind.kind-record { color: var(--accent-ink); }
1405
-
1406
1424
  /* Motion, by the doctrine in docs/design.md: popovers enter with a
1407
1425
  160ms ease-out settle from their origin; leaving is instant; reduced
1408
1426
  motion silences it (the peek card's @starting-style pattern). */
@@ -1453,6 +1471,16 @@ body.app-mode .sidebar[data-density="comfortable"] #table-list .nav-dot { width:
1453
1471
  margin: 0; font: 600 var(--text-md) var(--mono); letter-spacing: -0.01em;
1454
1472
  flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
1455
1473
  }
1474
+ /* The title of a form is the list's title step, not the 13px of a label under it (docs/design.md, Forms): the New
1475
+ drawer's and the dialogs that ask for fields (a record's New, a command, a field set over many) in an App; the
1476
+ Workbench's dialog keeps its own. It names what the form makes, so it wraps rather than being cut. */
1477
+ .newpanel .peekpanel-title {
1478
+ font: var(--heading-weight, 600) var(--type-list-title) / 1.2 var(--heading-font, var(--sans)); letter-spacing: var(--track-title);
1479
+ white-space: normal; overflow-wrap: anywhere;
1480
+ }
1481
+ body.app-mode .confirm:is(.insert-dialog, .command-form, .set-field-dialog) > h2 {
1482
+ font: var(--heading-weight, 600) var(--type-list-title) / 1.2 var(--heading-font, var(--sans)); letter-spacing: var(--track-title);
1483
+ }
1456
1484
  .peekpanel-open { flex: none; font-size: var(--text-sm); color: var(--ink-muted); }
1457
1485
  .peekpanel-open:hover { color: var(--ink); }
1458
1486
  .peekpanel-close {
@@ -1671,6 +1699,11 @@ body.app-mode .sidebar[data-density="comfortable"] #table-list .nav-dot { width:
1671
1699
  .picker-option.chosen .picker-option-label::before { content: '✓ '; }
1672
1700
  .picker-option-detail { color: var(--ink-muted); font-size: var(--text-xs); }
1673
1701
  .picker-option-label, .picker-option-detail { min-width: 0; overflow-wrap: anywhere; }
1702
+ /* A choice's second line (referenceSubline.ts): under its name, in the muted ink, where it tells two of one name apart. */
1703
+ .picker-option-name { display: grid; min-width: 0; }
1704
+ .picker-option-sub { min-width: 0; overflow-wrap: anywhere; color: var(--ink-muted); font-size: var(--text-sm); }
1705
+ /* motion-ok: the second line takes its option's tint, which the option's own :hover above sets wherever it is drawn */
1706
+ .picker-option.active .picker-option-sub, .picker-option:hover .picker-option-sub { color: inherit; }
1674
1707
  .picker-empty { padding: var(--space-2h) var(--space-3); color: var(--ink-muted); font-size: var(--text-sm); }
1675
1708
  .picker-chips { display: contents; }
1676
1709
  .picker-chip { display: inline-flex; align-items: center; gap: var(--space-2); padding: 1px var(--space-2) 1px var(--space-3); border-radius: 999px;
@@ -1714,6 +1747,15 @@ body.app-mode .insert-field .req { color: var(--status-critical); font-size: var
1714
1747
  dialog keeps the schema's label-beside-value. */
1715
1748
  .insert-form-app .insert-fields { gap: var(--field-gap); padding-right: 0; }
1716
1749
  .insert-form-app .insert-group-fields { gap: calc(var(--space-6) - var(--space-2)); }
1750
+ /* Fields are laid on a grid of 200px-or-wider cells: a field takes the whole row, and a short answer (a count, an
1751
+ amount, a day, a time — `data-kind`, which Field and the New form's field set from the data) takes one cell, so
1752
+ consecutive short answers share a row and wrap at narrow widths, one to a row where two cells do not fit (the
1753
+ `min(…, 100%)` keeps a 320px page at one column and no sideways scroll). Decided from the data kinds in order,
1754
+ never measured, so no answer moves another (docs/design.md, Forms). An author's own row (`.form-columns`) is one
1755
+ whole-row item and keeps its own columns. */
1756
+ :is(.insert-form-app .insert-group-fields, .command-fields) { grid-template-columns: repeat(auto-fill, minmax(min(200px, 100%), 1fr)); column-gap: var(--space-5); align-items: start; }
1757
+ :is(.insert-form-app .insert-group-fields, .command-fields) > * { grid-column: 1 / -1; min-width: 0; }
1758
+ :is(.insert-form-app .insert-group-fields, .command-fields) > [data-kind] { grid-column: auto; }
1717
1759
  .insert-form-app .insert-field { grid-template-columns: minmax(0, 1fr); gap: var(--space-2h); align-items: stretch; }
1718
1760
  /* The label sits in a row with its optional word, so the row's label is named as well as a bare one: `> :is(label,
1719
1761
  .form-field-label-row > label)` matched only the bare one, and the muted 12px Workbench rule drew the rest. */
@@ -1811,6 +1853,10 @@ body.signed-out .brand-db,
1811
1853
  body.signed-out .conn-picker,
1812
1854
  body.signed-out .topbar-actions,
1813
1855
  body.signed-out #explain-pane { display: none; }
1856
+ /* The sign-in door draws no bar at all: the App's mark stands over its card (SignIn.tsx, appBrand.css), so the first
1857
+ thing on the screen is the card, centered, and not a header with nothing else in it. An OAuth consent screen keeps
1858
+ its bar. `!important` so a shell layout's own display for the bar (topnav, rail) cannot bring it back. */
1859
+ body.signin-door .topbar { display: none !important; }
1814
1860
  body.signed-out .brand { min-width: 0; max-width: 100%; pointer-events: none; }
1815
1861
  body.signed-out .brand-mark { flex-shrink: 0; }
1816
1862
  body.signed-out .brand-name { min-width: 0; overflow-wrap: anywhere; white-space: normal; }
@@ -1912,7 +1958,10 @@ body.session-locked > :not(#session-lock) { display: none !important; }
1912
1958
 
1913
1959
  /* Totals: one footer row, each sum over everything the list's conditions
1914
1960
  match, set apart from the rows by a rule rather than a colour. */
1915
- .grid-totals td { font-weight: 600; border-top: 1px solid var(--line-strong); border-bottom: 0; background: var(--surface); }
1961
+ /* A sum is the one figure that is never cut (docs/design.md): the column is sized by it (gridSizing.ts), and where a
1962
+ font that arrived late or a narrower weight still leaves it short it spills into the cell's padding rather than
1963
+ draw "$102,795....". */
1964
+ .grid-totals td { font-weight: 600; border-top: 1px solid var(--line-strong); border-bottom: 0; background: var(--surface); overflow: visible; text-overflow: clip; }
1916
1965
  .grid-totals-label { font-weight: 500; color: var(--ink-muted); }
1917
1966
  .grid-totals-pending { color: var(--ink-subtle); }
1918
1967
 
@@ -2006,6 +2055,17 @@ body.app-mode th .pk { display: none; }
2006
2055
  /* The view's verbs remain one group at the end of the same scrolling row. */
2007
2056
  .applist-actions { display: flex; align-items: center; gap: var(--space-1); margin-left: var(--space-2); flex: none; }
2008
2057
  .applist-actions:empty { display: none; }
2058
+ /* Rows or a board (LayoutSwitch.tsx): a segmented pair of marks, the phone's Records/Table switch drawn at every width. */
2059
+ .list-layout { display: inline-flex; }
2060
+ .list-layout-seg {
2061
+ display: inline-flex; align-items: center; justify-content: center;
2062
+ min-width: 34px; min-height: 30px; padding: 0 var(--space-2);
2063
+ border: 1px solid var(--line-control); background: transparent; color: var(--ink-muted);
2064
+ }
2065
+ .list-layout-seg:first-child { border-radius: var(--radius-item) 0 0 var(--radius-item); }
2066
+ .list-layout-seg:last-child { border-radius: 0 var(--radius-item) var(--radius-item) 0; margin-inline-start: -1px; }
2067
+ .list-layout-seg[aria-pressed="true"] { background: var(--raised); color: var(--accent-ink); border-color: var(--accent); position: relative; }
2068
+ .list-layout-seg:focus-visible { outline: var(--focus-width) solid var(--focus); outline-offset: 1px; }
2009
2069
  /* Where the rail folds into its sheet, the strip's one row scrolls and the
2010
2070
  verbs sit at its end — so Filters, which is now the only way to reach the
2011
2071
  facets at all, was off the right edge behind a horizontal scroll nobody
@@ -190,7 +190,8 @@
190
190
  id="search-button"
191
191
  class="icon-button"
192
192
  title="Go to a table, view or database (⌘K)"
193
- aria-label="Search"
193
+ aria-label="Search ⌘K"
194
+ aria-keyshortcuts="Meta+K Control+K"
194
195
  >
195
196
  <!-- In an App the button is the search box (app.js adds .tn-search):
196
197
  a mark, a word and the key. A bare "⌘K" was a shortcut with no
@@ -14,8 +14,6 @@
14
14
  import { ownedBy } from './requestIdentity.js';
15
15
  import { createElement } from 'react';
16
16
  import { allowMutationExit, api, columnDisplay, columnLabel, currentEntry, el, findTable, go, humanName, openRecord, prefersPages, rowLabel, state, toast, whenConnectionChanges, writeAllowed, } from './core.js';
17
- // The App through the bridge: appnav.js would pull the page's whole tangle of imports in here (uiBridge.ts).
18
- import { pageBridge } from './uiBridge.js';
19
17
  import { syncHash } from './url.js';
20
18
  import { mount, unmount } from './components/mount.js';
21
19
  import { onDemand } from './components/onDemand.js';
@@ -200,12 +198,7 @@ export function formProps(table, form, host, close, onAdded, options = {}) {
200
198
  },
201
199
  target: (id) => findTable(id),
202
200
  /* How the App dresses each column: a vocabulary's words, money's currency. */
203
- ...(app
204
- ? {
205
- display: (column) => columnDisplay(table.id, column.name),
206
- appName: /** @type {{ name?: string } | null} */ (pageBridge.activeApp())?.name,
207
- }
208
- : {}),
201
+ ...(app ? { display: (column) => columnDisplay(table.id, column.name) } : {}),
209
202
  insert: (values, extra) => {
210
203
  if (!connection || !current())
211
204
  throw new InsertRefusal(say('theConnectionOrView'));
@@ -85,6 +85,13 @@ export declare function formatDate(value: string | number | Date, options?: Intl
85
85
  * said in the reader's own zone.
86
86
  */
87
87
  export declare function formatDateTime(value: string | number | Date, options?: Intl.DateTimeFormatOptions): string;
88
+ /**
89
+ * Two stored moments as one range, the end saying only what the start did not: "Sep 13, 2026, 2:00 – 4:00 PM" on
90
+ * one day, "Sep 13, 2026, 2:00 PM – Sep 14, 2026, 9:00 AM" across two, "Mar 4 – 6, 2026" for days. Each is read as
91
+ * formatDateTime reads it; null where either is no date, they are said in different zones, or the end is before
92
+ * the start (a range that runs backwards is two facts, not one).
93
+ */
94
+ export declare function formatSpan(start: string, end: string): string | null;
88
95
  /**
89
96
  * A stored day or moment said absolutely, the same words on any day and for any reader (`format: 'date'` and
90
97
  * `'datetime'`, and every date on a document's paper). A date alone is its calendar day and never shifts, whatever
Binary file