@mistriwork/kit 1.0.0-rc.62 → 1.0.0-rc.64

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 (53) hide show
  1. package/dist/client/app.js +5 -4
  2. package/dist/client/components/AiMark.d.ts +6 -0
  3. package/dist/client/components/AiMark.js +21 -0
  4. package/dist/client/components/AppList.js +6 -3
  5. package/dist/client/components/Content.js +3 -1
  6. package/dist/client/components/Crumbs.js +8 -4
  7. package/dist/client/components/DashHead.js +2 -1
  8. package/dist/client/components/DateField.js +3 -3
  9. package/dist/client/components/Grid.js +32 -7
  10. package/dist/client/components/GridSelection.js +7 -5
  11. package/dist/client/components/NewRecord.js +3 -3
  12. package/dist/client/components/Notes.css +10 -0
  13. package/dist/client/components/Page.js +1 -1
  14. package/dist/client/components/PageHeading.d.ts +21 -0
  15. package/dist/client/components/PageHeading.js +6 -0
  16. package/dist/client/components/PageHistory.d.ts +6 -1
  17. package/dist/client/components/PageHistory.js +13 -1
  18. package/dist/client/components/PageRoom.d.ts +15 -0
  19. package/dist/client/components/PageRoom.js +10 -1
  20. package/dist/client/components/Palette.js +9 -4
  21. package/dist/client/components/appListModel.d.ts +10 -0
  22. package/dist/client/components/appListModel.js +20 -1
  23. package/dist/client/components/appRooms.d.ts +2 -0
  24. package/dist/client/components/appRooms.js +2 -0
  25. package/dist/client/components/gridArrange.d.ts +4 -3
  26. package/dist/client/components/gridArrange.js +8 -6
  27. package/dist/client/components/gridSizing.d.ts +9 -1
  28. package/dist/client/components/gridSizing.js +21 -2
  29. package/dist/client/components/useMediaQuery.d.ts +2 -1
  30. package/dist/client/components/useMediaQuery.js +4 -2
  31. package/dist/client/components/valueModel.js +1 -1
  32. package/dist/client/copy/forms/components/DateField.d.ts +3 -3
  33. package/dist/client/copy/forms/components/DateField.js +3 -3
  34. package/dist/client/copy/forms/components/NewRecord.d.ts +0 -1
  35. package/dist/client/copy/forms/components/NewRecord.js +0 -1
  36. package/dist/client/copy/record/components/PageHistory.d.ts +4 -0
  37. package/dist/client/copy/record/components/PageHistory.js +4 -0
  38. package/dist/client/copy/shell/components/AiMark.d.ts +3 -0
  39. package/dist/client/copy/shell/components/AiMark.js +5 -0
  40. package/dist/client/core.js +2 -1
  41. package/dist/client/dayLabel.d.ts +8 -0
  42. package/dist/client/dayLabel.js +18 -0
  43. package/dist/client/features.css +52 -4
  44. package/dist/client/page.css +107 -2
  45. package/dist/client/palette.js +15 -2
  46. package/dist/client/shellMode.d.ts +5 -1
  47. package/dist/client/shellMode.js +1 -0
  48. package/dist/client/shells.d.ts +2 -0
  49. package/dist/client/structure.css +43 -9
  50. package/dist/client/style.css +28 -6
  51. package/dist/client/visualThemes.css +0 -2
  52. package/dist/shared/uiTokens.js +1 -0
  53. package/package.json +4 -3
@@ -20,11 +20,13 @@ const RESIZE_SHIFT_STEP = 64;
20
20
  export function columnResizeStep(shiftKey) {
21
21
  return shiftKey ? RESIZE_SHIFT_STEP : RESIZE_STEP;
22
22
  }
23
- /** A width a column may actually be given: whole pixels, never below its floor. */
24
- export function clampColumnWidth(width) {
23
+ /** A width a column may actually be given: whole pixels, never below its floor — the grid's own, or the wider one its
24
+ type asks (gridSizing.ts columnFloor: a date, a figure or a status chip is never dragged under its value). */
25
+ export function clampColumnWidth(width, floor = 0) {
26
+ const least = Math.max(MIN_COLUMN_WIDTH, Math.ceil(floor));
25
27
  if (!Number.isFinite(width))
26
- return MIN_COLUMN_WIDTH;
27
- return Math.max(MIN_COLUMN_WIDTH, Math.round(width));
28
+ return least;
29
+ return Math.max(least, Math.round(width));
28
30
  }
29
31
  /**
30
32
  * The columns as drawn, in the reader's order: the order's names first,
@@ -54,9 +56,9 @@ export function moveColumn(order, name, direction) {
54
56
  return next;
55
57
  }
56
58
  /** The fitted widths, with every width the reader dragged standing in place of its fitted one. */
57
- export function applyColumnWidths(fitted, columns, overrides) {
59
+ export function applyColumnWidths(fitted, columns, overrides, floors = {}) {
58
60
  return columns.map((name, index) => {
59
61
  const override = overrides[name];
60
- return override === undefined ? (fitted[index] ?? 0) : clampColumnWidth(override);
62
+ return override === undefined ? (fitted[index] ?? 0) : clampColumnWidth(override, floors[name]);
61
63
  });
62
64
  }
@@ -38,8 +38,10 @@ interface GridColumnSize {
38
38
  avatar?: boolean;
39
39
  /** The row's state (a tone chip, or a vocabulary named status or stage): kept with the name when columns are left out. */
40
40
  status?: boolean;
41
- /** Every value is the words the cell draws ("4 weeks ago", "$22,495"), not a raw value it formats, and nothing beside them (a bar, a ring, an App's own renderer). */
41
+ /** Every value is the words the cell draws ("4 weeks ago", "$22,495"), not a raw value it formats, and nothing beside them but what `beside` counts (a bar, a ring; never an App's own renderer). */
42
42
  dressed?: boolean;
43
+ /** What the cell draws beside its words (a percent's bar or ring, a meter's bar, and the gap): width the words do not measure. */
44
+ beside?: number;
43
45
  /** A date no rule dresses: its values are the words the cell draws ("Aug 22, 2026"), measured in the cell's font. */
44
46
  drawnDate?: boolean;
45
47
  }
@@ -67,6 +69,12 @@ export declare function columnSizeHint(column: GridColumnSize, headChar?: number
67
69
  least: number;
68
70
  head: number;
69
71
  };
72
+ /**
73
+ * The least a reader may drag a column to. Text keeps its ellipsis (no floor of its own); a date, a figure, a yes-or-no
74
+ * and a status chip are cut by no one, so each holds the width its value measures (its minimum, as sized above): a date
75
+ * is never "Aug 22, 20…" and a pill never "In rev…" because a handle was dragged a pixel too far.
76
+ */
77
+ export declare function columnFloor(column: GridColumnSize, headChar?: number, measure?: TextMeasure): number;
70
78
  /**
71
79
  * The columns an embedded grid keeps in its width: a dashboard's list in half
72
80
  * a row cut "Sep 22, 202" behind a scroll bar. Past the width, columns are
@@ -67,7 +67,8 @@ export function columnSizeHint(column, headChar = GRID_HEAD_CHAR, measure, squee
67
67
  /* The total is set in the totals row's semibold, a tenth wider than the cell's own weight. */
68
68
  const totalWidth = measure && column.total ? Math.ceil(measure(column.total) * TOTAL_WEIGHT) : 0;
69
69
  const textWidth = (measure ? Math.max(Math.ceil(widest(column.values)), totalWidth) + (column.chip ? (column.chipExtra ?? CHIP_EXTRA) : 0) : length * 8) +
70
- (column.avatar ? AVATAR_WIDTH : 0);
70
+ (column.avatar ? AVATAR_WIDTH : 0) +
71
+ (column.beside ?? 0);
71
72
  /* A second line asks for room, never lowers the floor: an email under a
72
73
  name wants its width, but a narrow panel still keeps the name's minimum.
73
74
  It is set a size down (12.5px under 14px). */
@@ -107,7 +108,9 @@ export function columnSizeHint(column, headChar = GRID_HEAD_CHAR, measure, squee
107
108
  price, miles and days held 56px each past their figures while the car's
108
109
  name beside them was cut to "2024 Toyota C…". */
109
110
  if (column.kind === 'number') {
110
- const width = measured && (column.chip || column.dressed) ? Math.min(264, textWidth + pad) : Math.min(264, Math.max(88, (length + 4) * 8 + 24));
111
+ const width = measured && (column.chip || column.dressed)
112
+ ? Math.min(264, textWidth + pad)
113
+ : Math.min(264, Math.max(88, (length + 4) * 8 + 24 + (column.beside ?? 0)));
111
114
  return fixed(width);
112
115
  }
113
116
  /* A number set in groups (a telephone number, a card's last digits, a part number of digits) is a number that
@@ -165,6 +168,22 @@ function sizeHints(columns, room, headChar, measure, squeezeName = false, cut =
165
168
  const hints = columns.map((column, index) => columnSizeHint(column, headChar, measure && ((text) => measure(text, index)), squeezeName));
166
169
  return cut ? giveWay(hints, room) : hints;
167
170
  }
171
+ /**
172
+ * The least a reader may drag a column to. Text keeps its ellipsis (no floor of its own); a date, a figure, a yes-or-no
173
+ * and a status chip are cut by no one, so each holds the width its value measures (its minimum, as sized above): a date
174
+ * is never "Aug 22, 20…" and a pill never "In rev…" because a handle was dragged a pixel too far.
175
+ */
176
+ export function columnFloor(column, headChar = GRID_HEAD_CHAR, measure) {
177
+ const whole = column.kind === 'date' ||
178
+ column.kind === 'number' ||
179
+ column.kind === 'boolean' ||
180
+ column.chip ||
181
+ isGroupedNumber((column.values ?? [])
182
+ .slice(0, GRID_SIZE_SAMPLE)
183
+ .filter((value) => value != null)
184
+ .map(String));
185
+ return whole ? columnSizeHint(column, headChar, measure).least : 0;
186
+ }
168
187
  /* Where the minima together run past the room, the heads wider than their columns' values give way first, the
169
188
  last first, and then the secondary text columns, the last first, down to their floors; the name, the chips and
170
189
  the figures never do. Where giving way would not spare the scroll, nothing is cut for it: a phone's table cut a
@@ -1,7 +1,8 @@
1
1
  export declare function useMediaQuery(query: string): boolean;
2
2
  /** A phone: where a record's actions fold into one menu rather than wrap. */
3
3
  export declare const PHONE_QUERY = "(max-width: 600px)";
4
- /** Where a list's records stand in for its grid: style.css's `@media (max-width: 760px)`, which shows them. */
4
+ /** Where a list's records stand in for its grid: the phone band (packages/ui/src/internal/ruler.ts), which style.css's
5
+ `@media (max-width: 760px)` shows them at. */
5
6
  export declare const RECORDS_QUERY = "(max-width: 760px)";
6
7
  /** Where a filter rail has no room to stand beside the rows. The rail is
7
8
  12-15rem and a card grid wants 520px before it draws a second column, so
@@ -4,6 +4,7 @@
4
4
  * share, so a breakpoint is asked of the browser the same way everywhere.
5
5
  */
6
6
  import { useSyncExternalStore } from 'react';
7
+ import { PHONE_QUERY as PHONE_BAND } from '@mistriwork/ui/internal/ruler.js';
7
8
  const watched = new Map();
8
9
  function watch(query) {
9
10
  let entry = watched.get(query);
@@ -36,8 +37,9 @@ export function useMediaQuery(query) {
36
37
  }
37
38
  /** A phone: where a record's actions fold into one menu rather than wrap. */
38
39
  export const PHONE_QUERY = '(max-width: 600px)';
39
- /** Where a list's records stand in for its grid: style.css's `@media (max-width: 760px)`, which shows them. */
40
- export const RECORDS_QUERY = '(max-width: 760px)';
40
+ /** Where a list's records stand in for its grid: the phone band (packages/ui/src/internal/ruler.ts), which style.css's
41
+ `@media (max-width: 760px)` shows them at. */
42
+ export const RECORDS_QUERY = PHONE_BAND;
41
43
  /** Where a filter rail has no room to stand beside the rows. The rail is
42
44
  12-15rem and a card grid wants 520px before it draws a second column, so
43
45
  under about 860px the two together leave the rows a single narrow column —
@@ -17,6 +17,7 @@ import { planColumn } from '../columns.js';
17
17
  import { leadTonePath, subtitlePath } from '@mistriwork/engine/shared/subtitlePath.js';
18
18
  import { say } from '../copy/record/components/valueModel.js';
19
19
  import { shellBody } from '../shellHost.js';
20
+ import { ISO_DAY } from '../dayLabel.js';
20
21
  /**
21
22
  * How a set of dates drawn together is said: one way down a column. A relative date is said from today only where
22
23
  * every value is near (a sentence of days), else every one is its date and the phrase stays its tooltip. Anything
@@ -437,7 +438,6 @@ function relativeSaid(rule, text) {
437
438
  ? { text: formatDate(text), title: said }
438
439
  : { text: said, title: text, date: formatDate(text) };
439
440
  }
440
- const ISO_DAY = /^\d{4}-\d{2}-\d{2}(?:[ T]\d{2}:\d{2}(?::\d{2}(?:\.\d+)?)?(?:Z|[+-]\d{2}(?::?\d{2})?)?)?$/;
441
441
  /**
442
442
  * A toned day says what it would say untoned: its tone is the pill it wears, not a reason to draw the stored ISO day.
443
443
  * A `relative` rule says it from today while near; no format says it as a date column does (daySaid). A field report
@@ -1,8 +1,8 @@
1
1
  export declare const say: import("../../../messages.js").RoomMessage<{
2
- readonly enterADateAndTime: "Enter a date and time as YYYY-MM-DD HH:MM within the allowed range.";
2
+ readonly enterADateAndTime: "Enter a date and time as {format} within the allowed range.";
3
3
  readonly enterADateInYyyy: "Enter a date as {format} within the allowed range.";
4
- readonly yyyyMmDdHh: "YYYY-MM-DD HH:MM";
5
- readonly dateAndTimeFormat: "Date and time format: YYYY-MM-DD HH:MM.";
4
+ readonly hhMm: "HH:MM";
5
+ readonly dateAndTimeFormat: "Date and time format: {format}.";
6
6
  readonly dateFormatIs: "Date format: {format}.";
7
7
  readonly altAndDownArrow: "Alt and Down arrow opens the calendar.";
8
8
  readonly chooseDateFor: "Choose date for {label}";
@@ -1,10 +1,10 @@
1
1
  /** What DateField says, in the forms 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
- enterADateAndTime: 'Enter a date and time as YYYY-MM-DD HH:MM within the allowed range.',
4
+ enterADateAndTime: 'Enter a date and time as {format} within the allowed range.',
5
5
  enterADateInYyyy: 'Enter a date as {format} within the allowed range.',
6
- yyyyMmDdHh: 'YYYY-MM-DD HH:MM',
7
- dateAndTimeFormat: 'Date and time format: YYYY-MM-DD HH:MM.',
6
+ hhMm: 'HH:MM',
7
+ dateAndTimeFormat: 'Date and time format: {format}.',
8
8
  dateFormatIs: 'Date format: {format}.',
9
9
  altAndDownArrow: 'Alt and Down arrow opens the calendar.',
10
10
  chooseDateFor: 'Choose date for {label}',
@@ -1,5 +1,4 @@
1
1
  export declare const say: import("../../../messages.js").RoomMessage<{
2
- readonly yyyyMmDdHh: "YYYY-MM-DD HH:MM";
3
2
  readonly fill: "Fill in {column}.";
4
3
  readonly answersNeedALook: {
5
4
  readonly one: "One answer needs another look.";
@@ -1,7 +1,6 @@
1
1
  /** What NewRecord says, in the forms 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
- yyyyMmDdHh: 'YYYY-MM-DD HH:MM',
5
4
  fill: 'Fill in {column}.',
6
5
  answersNeedALook: { one: 'One answer needs another look.', other: '{count} answers need another look.' },
7
6
  fieldsNeedFixing: { one: 'One field needs fixing.', other: '{count} fields need fixing.' },
@@ -5,6 +5,10 @@ export declare const say: import("../../../messages.js").RoomMessage<{
5
5
  readonly theApi: "The API";
6
6
  readonly theSystem: "The system";
7
7
  readonly someone: "Someone";
8
+ readonly proposedBy: "Proposed by {ai} · approved by {by}";
9
+ readonly madeByAi: "Made by {ai}";
10
+ readonly madeByJob: "Made by job {job}";
11
+ readonly madeByAJob: "Made by a job";
8
12
  readonly created: "Created";
9
13
  readonly edited: "Edited";
10
14
  readonly changesToThisRecord: "Changes to this record appear here.";
@@ -7,6 +7,10 @@ export const say = defineMessages({
7
7
  theApi: 'The API',
8
8
  theSystem: 'The system',
9
9
  someone: 'Someone',
10
+ proposedBy: 'Proposed by {ai} · approved by {by}',
11
+ madeByAi: 'Made by {ai}',
12
+ madeByJob: 'Made by job {job}',
13
+ madeByAJob: 'Made by a job',
10
14
  created: 'Created',
11
15
  edited: 'Edited',
12
16
  changesToThisRecord: 'Changes to this record appear here.',
@@ -0,0 +1,3 @@
1
+ export declare const say: import("../../../messages.js").RoomMessage<{
2
+ readonly ai: "AI";
3
+ }>;
@@ -0,0 +1,5 @@
1
+ /** What AiMark 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
+ ai: 'AI',
5
+ });
@@ -32,6 +32,7 @@ import { say } from './copy/shell/core.js';
32
32
  import { shellById, shellQuery, shellQueryAll, shellRoot } from './shellHost.js';
33
33
  import { fetchServer } from './transport.js';
34
34
  import { fileReads } from './liveReads.js';
35
+ import { sayDayLabel } from './dayLabel.js';
35
36
  export { andQuery, splitClauseTail } from '@mistriwork/engine/shared/query.js';
36
37
  export { humanName } from '@mistriwork/engine/shared/model.js';
37
38
  /* Building DOM and the popups' keyboard manners live in dom.js; re-exported
@@ -462,7 +463,7 @@ export function rowLabel(table, row) {
462
463
  for (const name of configured ? [labelPath(table)] : [labelPath(table), labelColumn(table)]) {
463
464
  const value = name != null ? row[name] : undefined;
464
465
  if (value !== null && value !== undefined && String(value) !== '')
465
- return String(value);
466
+ return sayDayLabel(value) ?? String(value);
466
467
  }
467
468
  const values = primaryKey(table).map((c) => row[c]);
468
469
  if (configured && values.some((value) => value == null))
@@ -0,0 +1,8 @@
1
+ export declare const ISO_DAY: RegExp;
2
+ /**
3
+ * A day or moment used as a row's name (a crumb, a pill, a title), said as the grid says a date: the reader's locale,
4
+ * never the stored ISO text. Absolute even in an App — a name that read "tomorrow" would not be the name it was
5
+ * yesterday. Undefined for anything that is no day, so a name or an id (a big-int one stays its string) is untouched.
6
+ * Lives outside components/ because the walk (core.js) names rows with it and may not reach into the React half.
7
+ */
8
+ export declare function sayDayLabel(value: unknown): string | undefined;
@@ -0,0 +1,18 @@
1
+ /* How a stored day or moment is named when a row is called by it: the one reading the walk (core.js) and the
2
+ React half share, kept outside components/ so the walk never reaches into it. */
3
+ import { formatDate, formatDateTime } from './locale.js';
4
+ export const ISO_DAY = /^\d{4}-\d{2}-\d{2}(?:[ T]\d{2}:\d{2}(?::\d{2}(?:\.\d+)?)?(?:Z|[+-]\d{2}(?::?\d{2})?)?)?$/;
5
+ /**
6
+ * A day or moment used as a row's name (a crumb, a pill, a title), said as the grid says a date: the reader's locale,
7
+ * never the stored ISO text. Absolute even in an App — a name that read "tomorrow" would not be the name it was
8
+ * yesterday. Undefined for anything that is no day, so a name or an id (a big-int one stays its string) is untouched.
9
+ * Lives outside components/ because the walk (core.js) names rows with it and may not reach into the React half.
10
+ */
11
+ export function sayDayLabel(value) {
12
+ if (typeof value !== 'string')
13
+ return undefined;
14
+ const text = value.trim();
15
+ if (!ISO_DAY.test(text))
16
+ return undefined;
17
+ return /[ T]00:00(:00(\.0+)?)?$/.test(text) ? formatDate(text) : formatDateTime(text);
18
+ }
@@ -361,7 +361,7 @@ body.app-mode .page-edit { font-family: var(--sans); }
361
361
 
362
362
  /* A rootless page shows the real list as its chooser; the notice and the
363
363
  list each take the full row of the page's flex host, notice first. */
364
- .page-empty { flex: 1 1 100%; }
364
+ .page-empty { flex: 1 1 100%; text-align: center; }
365
365
  .page-root-list { flex: 1 1 100%; min-width: 0; }
366
366
 
367
367
  /* The diagram, over everything: a schema drawing is the one view that
@@ -381,7 +381,7 @@ body.app-mode .page-edit { font-family: var(--sans); }
381
381
  Everything here hangs on the 14px inset the rest of the page already
382
382
  uses — crumbs, the tab strip, the result head, the pager, the first
383
383
  cell of every row. One left edge, or the page reads as four. */
384
- .applist-head { padding: var(--space-4h) var(--space-4h) 0; }
384
+ .applist-head { padding: var(--page-top) var(--space-4h) 0; }
385
385
  .applist-head-row { display: flex; align-items: baseline; gap: var(--space-4); }
386
386
  .applist-head-row .applist-new { margin-left: auto; font-size: var(--text-sm); }
387
387
  /* Import, quiet, before New: the pair keeps New's place at the row's end. */
@@ -719,10 +719,17 @@ body.page-bare :is(.topbar, .sidebar, .sidebar-reveal, #topnav, #explain-pane) {
719
719
  body.app-mode.page-bare .content { padding-inline: 0; }
720
720
  /* The title shares the body's centered 76rem column — a head pinned to
721
721
  the pane edge over a centered grid read as two different screens. */
722
- .dash-head { margin-top: var(--space-2h); margin-bottom: var(--space-6); width: 100%; }
722
+ .dash-head { margin-top: 0; margin-bottom: var(--space-6); width: 100%; }
723
723
  .dash-head .dash-description { padding: 0; margin: var(--space-2h) 0 0; max-width: 70ch; font-size: var(--text-md); line-height: 1.5; }
724
724
  /* `head: 'compact'`: the title at a list's size on one line with its star, and the body close under it — a working
725
725
  page whose own controls are its intro. Same gutters as the full head, so switching the form moves nothing sideways. */
726
+ /* A head that carries verbs or a way back (PageHeader): the verbs go to the
727
+ far end of the title's line, the intro under both, and the way back is a
728
+ line of its own over the title. */
729
+ .applist-head.dash-head:is(.has-actions, .has-back) { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2h); }
730
+ .dash-head.has-back > .dash-head-back { flex-basis: 100%; margin-left: calc(var(--space-2) * -1); }
731
+ .dash-head.has-actions > .dash-head-actions { margin-left: auto; }
732
+ .dash-head:is(.has-actions, .has-back) > .dash-description { flex-basis: 100%; margin: 0; }
726
733
  .dash-head-compact { align-items: center; gap: var(--space-2h); width: 100%; margin-bottom: var(--space-3); }
727
734
  .dash-head-compact .applist-title { margin: 0; }
728
735
  .dash-strip { border: none; padding: 0; }
@@ -1423,6 +1430,33 @@ body.app-mode .confirm:is(.insert-dialog, .command-form, .set-field-dialog) > h2
1423
1430
  background: color-mix(in srgb, var(--raised) 60%, var(--surface));
1424
1431
  }
1425
1432
  }
1433
+ /* A long command form (formFrame, as New's: past eight fields) is a drawer on the window's right edge, over the page
1434
+ it was started from, which stays where it is: an overlay takes no room from the page, so nothing under it moves.
1435
+ Its foot is the band above (sticky in the box), its body the box's own scroll. A phone's, and the 641-760 band
1436
+ where a 34rem drawer would leave a sliver of page, fills the screen. Enters on the drawer's own curve, under
1437
+ reduced motion at once; leaving is at once (Motion doctrine 2, 14). */
1438
+ [data-slot='dialog-content'][data-kind='modal'].command-drawer {
1439
+ position: fixed; inset: 0 0 0 auto; margin: 0; transform: none;
1440
+ width: min(560px, calc(100vw - 48px)); height: 100dvh; max-height: none;
1441
+ border-width: 0 0 0 1px; border-radius: 0; box-shadow: var(--shadow-panel);
1442
+ }
1443
+ @media (max-width: 760px) {
1444
+ [data-slot='dialog-content'][data-kind='modal'].command-drawer { inset: 0; width: 100%; border-width: 0; }
1445
+ }
1446
+ @media (prefers-reduced-motion: no-preference) {
1447
+ [data-slot='dialog-content'][data-kind='modal'].command-drawer {
1448
+ transition: transform var(--t-panel) var(--ease-drawer), opacity var(--t-panel) var(--ease-drawer);
1449
+ @starting-style { transform: translateX(2rem); opacity: 0; }
1450
+ }
1451
+ }
1452
+ /* The evidence slot: beside the form from 900px, under it (ruled off) below that. Present, the drawer is wide enough
1453
+ for both columns; absent, none of this is drawn. */
1454
+ .command-aside { min-width: 0; margin-top: var(--space-6); padding-top: var(--space-4h); border-top: 1px solid var(--line); }
1455
+ @media (min-width: 900px) {
1456
+ [data-slot='dialog-content'][data-kind='modal'].command-drawer.command-drawer-wide { width: min(960px, calc(100vw - 48px)); }
1457
+ .command-drawer-wide .command-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(16rem, 20rem); column-gap: var(--space-6); align-items: start; }
1458
+ .command-drawer-wide .command-aside { margin-top: 0; padding-top: 0; border-top: 0; }
1459
+ }
1426
1460
  .peekpanel-open { flex: none; font-size: var(--text-sm); color: var(--ink-muted); }
1427
1461
  .peekpanel-open:hover { color: var(--ink); }
1428
1462
  /* A 28px square with the cross at a size it is seen at: at the text's 16px in the faint ink it was the smallest
@@ -1578,6 +1612,10 @@ body.app-mode .confirm:is(.insert-dialog, .command-form, .set-field-dialog) > h2
1578
1612
  border: 1px solid var(--line); border-radius: 999px; color: var(--ink-muted);
1579
1613
  font: var(--text-sm) var(--mono); padding: var(--space-1) var(--space-3h); white-space: nowrap;
1580
1614
  }
1615
+ /* The one AI mark (AiMark.tsx): the glyph at the text's cap height and the App's word, in --ai, at the size of the text
1616
+ it stands in, so a row's mark is a row's height. */
1617
+ .ai-mark { display: inline-flex; align-items: center; gap: .25em; color: var(--ai); font-weight: 500; white-space: nowrap; }
1618
+ .ai-mark-glyph { width: .9em; height: .9em; flex: none; fill: currentColor; }
1581
1619
 
1582
1620
  /* ---------- the record picker ---------- */
1583
1621
 
@@ -1591,6 +1629,10 @@ body.app-mode .confirm:is(.insert-dialog, .command-form, .set-field-dialog) > h2
1591
1629
  .picker-input { flex: 1 1 8rem; min-width: 6rem; height: auto; border: 0; outline: none; background: none; color: var(--ink);
1592
1630
  font: inherit; padding: var(--space-1h) var(--space-1); }
1593
1631
  .picker-input::placeholder { color: var(--ink-subtle); }
1632
+ /* The magnifier of a picker that is a search box (the command form's
1633
+ reference field); the input keeps the row's rule. */
1634
+ .picker-glyph { flex: none; display: inline-flex; align-items: center; color: var(--ink-subtle); }
1635
+ .picker:focus-within > .picker-glyph { color: var(--ink-muted); }
1594
1636
  .picker-clear { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); border: 0; background: none;
1595
1637
  color: var(--ink-muted); font-size: var(--text-md); line-height: 1; padding: var(--space-1) var(--space-2h); cursor: pointer; border-radius: var(--radius); }
1596
1638
  .picker-clear:hover { color: var(--ink); background: var(--raised); }
@@ -1753,7 +1795,7 @@ div.form-problems button {
1753
1795
  .signin { display: grid; justify-items: center; align-content: start; min-height: 70vh; padding: clamp(32px, 14vh, 140px) var(--space-5) var(--space-8); }
1754
1796
  /* One column at the optical centre (a little above the middle), 22rem wide and drawn in no box: the door is the
1755
1797
  only thing on its screen, so a frame round it framed nothing, and on a phone it never had one. The App's mark,
1756
- the heading — "Sign in to Payday" — the fields and the links share the column's left edge. */
1798
+ the heading — "Payday" — the fields and the links share the column's left edge. */
1757
1799
  .signin-card { width: min(22rem, 100%); box-sizing: border-box; display: grid; gap: var(--space-5); }
1758
1800
  /* off-scale: the door's heading is the one headline on its screen, a display size as a landing's is, over 20px. */
1759
1801
  .signin-title { margin: 0 0 var(--space-2); font: var(--heading-weight, 600) calc(28px * var(--type-k))/1.2 var(--heading-font, var(--sans)); letter-spacing: var(--track-display, -0.022em); overflow-wrap: anywhere; text-wrap: balance; }
@@ -1938,6 +1980,12 @@ body.session-locked > :not(#session-lock) { display: none !important; }
1938
1980
  The attribute is named twice to keep the weight the :has() rule had over a hovered row's tint. */
1939
1981
  .table-wrap tbody tr[data-chosen][data-chosen] > td { background: var(--accent-soft); }
1940
1982
  .row-host .row-select { width: 15px; height: 15px; margin: 0; accent-color: var(--accent); cursor: pointer; }
1983
+ /* The box's label (GridSelection.tsx) is laid out as nothing under a fine pointer. Under a finger it pads the 15px box
1984
+ to a 44px target without moving it, as the checklist's does (structure.css): a checkbox cannot be padded itself. */
1985
+ .row-select-hit { display: contents; }
1986
+ @media (pointer: coarse) {
1987
+ .row-select-hit { display: inline-flex; vertical-align: middle; padding: 14.5px; margin: -14.5px; cursor: pointer; } /* off-scale: (44px − the 15px box) / 2, a target's geometry */
1988
+ }
1941
1989
  /* Select all sat against the first column's sort button, a finger's 24px
1942
1990
  round it 0.4px short of clear (WCAG 2.5.8, which a 15px box meets by its
1943
1991
  spacing): the sort button reaches back over the column's edge. The box
@@ -123,6 +123,25 @@
123
123
  border-left: 1px solid var(--line);
124
124
  padding-left: var(--space-6);
125
125
  }
126
+ /* A tablet (761–1100px, the ruler's band, @mistriwork/ui/internal/ruler) keeps a record's side column at 280px
127
+ beside the main one, as a desk does: stacked, the record's state and its history went a screen under the
128
+ work. An archetype and a dashboard place their own regions and still stack there (below). */
129
+ @media (min-width: 761px) and (max-width: 1100px) {
130
+ .page-layout:where(:not([data-layout], .dashboard-layout)) {
131
+ grid-template-columns: minmax(0, 1fr) 280px;
132
+ }
133
+ .page-layout:where(:not([data-layout], .dashboard-layout)) > .page-aside {
134
+ align-self: stretch;
135
+ align-content: flex-start;
136
+ }
137
+ .page-layout:where(:not([data-layout], .dashboard-layout)) .page-aside .page-section {
138
+ flex-basis: 100%;
139
+ margin-inline: 0;
140
+ }
141
+ :where(.page-layout:not([data-layout], .dashboard-layout)) .page-aside .page-metric-row {
142
+ flex-direction: column;
143
+ }
144
+ }
126
145
  @media (min-width: 1101px) {
127
146
  /* The aside's rule runs the length of the page it stands beside: stopping
128
147
  at its last field, it read as a short box rather than a column. */
@@ -146,7 +165,7 @@
146
165
  drawing a hairline of its own a row under the last field's (two rules, a
147
166
  gap apart, where one was meant). A headline or a card is a box, and a line
148
167
  of facts draws no rule: those stay as they are. */
149
- @media (max-width: 1100px) {
168
+ @media (max-width: 760px) {
150
169
  .page-layout {
151
170
  grid-template-columns: minmax(0, 1fr);
152
171
  gap: var(--page-row-gap, var(--section-seam));
@@ -160,6 +179,22 @@
160
179
  padding-top: var(--space-3h);
161
180
  }
162
181
  }
182
+ /* The same stacking at a tablet for the pages that place their own regions; the selectors keep the weight the
183
+ phone's have. */
184
+ @media (min-width: 761px) and (max-width: 1100px) {
185
+ .page-layout:where([data-layout], .dashboard-layout) {
186
+ grid-template-columns: minmax(0, 1fr);
187
+ gap: var(--page-row-gap, var(--section-seam));
188
+ }
189
+ :where(.page-layout[data-layout], .dashboard-layout) > .page-aside {
190
+ border-left: 0;
191
+ padding-left: 0;
192
+ }
193
+ :where(.page-layout[data-layout], .dashboard-layout) > .page-aside > .page-section:first-child:not(:has(.page-headline, > .page-facts), .page-card-section) {
194
+ border-top-style: solid;
195
+ padding-top: var(--space-3h);
196
+ }
197
+ }
163
198
 
164
199
  /* A section's own table brings its bottom padding, which lands on top of the
165
200
  row gap and makes the space under a list visibly bigger than the space
@@ -281,6 +316,32 @@
281
316
  padding-top: 0;
282
317
  }
283
318
  }
319
+ /* A dashboard at a tablet (761–1100px, the ruler's band) is two to a row: its halves, thirds and two-thirds each
320
+ take half, rather than a phone's one column under 900px or a desk's three thirds in 760px. An offset is no
321
+ placement in two columns. The second of a leading pair draws no rule, as a shared row's does; a third of three
322
+ now starts a row of its own and takes the rule back. */
323
+ @media (min-width: 761px) and (max-width: 1100px) {
324
+ .dash-body:not(.page-aside, .dash-laid) > .page-section:is(.width-half, .width-third, .width-two-thirds) {
325
+ flex-basis: calc(50% - 16px);
326
+ }
327
+ .dash-body:not(.page-aside, .dash-laid) > .page-section[class*='offset-'] {
328
+ margin-left: 0;
329
+ margin-right: 0;
330
+ }
331
+ .dash-body:not(.page-aside, .dash-laid)
332
+ > .page-section:first-child:is(.width-half, .width-third, .width-two-thirds)
333
+ + .page-section:is(.width-half, .width-third, .width-two-thirds) {
334
+ border-top: none;
335
+ padding-top: 0;
336
+ }
337
+ .dash-body:not(.page-aside, .dash-laid)
338
+ > .page-section:first-child.width-third
339
+ + .page-section.width-third
340
+ + .page-section.width-third {
341
+ border-top: 1px solid var(--line);
342
+ padding-top: var(--space-3h);
343
+ }
344
+ }
284
345
 
285
346
  /* A section heading carries a tab's weight and none of its furniture.
286
347
 
@@ -656,6 +717,10 @@
656
717
  /* The head does not sit on the trail's rule above it: a step of the title's size (20px, four fifths), so the
657
718
  two read as two things. A room that draws the head without a trail over it (a dialog) takes it back. */
658
719
  .page-head.has-record {
720
+ margin-top: var(--page-top);
721
+ }
722
+ /* Under a trail it is the trail that stands under the bar, and the head keeps the step it always had below it. */
723
+ .page-head.has-record.has-trail {
659
724
  margin-top: var(--space-5);
660
725
  }
661
726
  /* Under an App's trail the kind is heard and not seen (PageHead.tsx): the trail already says where the record is,
@@ -2969,6 +3034,22 @@
2969
3034
  .attachments-name:hover {
2970
3035
  text-decoration: underline;
2971
3036
  }
3037
+ /* Under a finger the name is a 44px target across its text, drawn no taller: the reach hangs off the text column,
3038
+ since the name clips its own overflow for the ellipsis and would clip a reach of its own with it. */
3039
+ @media (pointer: coarse) {
3040
+ .attachments-text {
3041
+ position: relative;
3042
+ }
3043
+ .attachments-name::after {
3044
+ content: '';
3045
+ position: absolute;
3046
+ left: 0;
3047
+ right: 0;
3048
+ top: 50%;
3049
+ height: max(100%, 44px);
3050
+ transform: translateY(-50%);
3051
+ }
3052
+ }
2972
3053
  .attachments-actions {
2973
3054
  flex: none;
2974
3055
  display: inline-flex;
@@ -3075,6 +3156,30 @@
3075
3156
  font: inherit;
3076
3157
  line-height: 1;
3077
3158
  }
3159
+ /* Under a finger the × takes a 44px reach without growing the chip, as a list chip's does (structure.css). A tone
3160
+ clips what overflows it, the reach with it, so a removable chip's label carries the ellipsis instead. */
3161
+ @media (pointer: coarse) {
3162
+ .record-tag:has(> .record-tag-remove) {
3163
+ overflow: visible;
3164
+ }
3165
+ .record-tag:has(> .record-tag-remove) > span {
3166
+ min-width: 0;
3167
+ overflow: hidden;
3168
+ text-overflow: ellipsis;
3169
+ }
3170
+ .record-tag-remove {
3171
+ position: relative;
3172
+ }
3173
+ .record-tag-remove::after {
3174
+ content: '';
3175
+ position: absolute;
3176
+ left: 50%;
3177
+ top: 50%;
3178
+ width: max(100%, 44px);
3179
+ height: max(100%, 44px);
3180
+ transform: translate(-50%, -50%);
3181
+ }
3182
+ }
3078
3183
  .record-tags-add {
3079
3184
  padding: var(--space-1) var(--space-3);
3080
3185
  min-height: 0;
@@ -3586,7 +3691,7 @@
3586
3691
  flex column: its items fill the width however little they hold (a shut
3587
3692
  accordion), and a section's row-wrap flex-basis means nothing here
3588
3693
  instead of becoming a height. */
3589
- @media (max-width: 1100px) {
3694
+ @media (max-width: 760px) {
3590
3695
  /* Which layouts these are is said by the page (`data-leads`, Page.tsx), not asked with
3591
3696
  `:has(> .page-aside :is(.page-headline, .page-card-section))`: a :has() over the whole layout restyled every
3592
3697
  section on the page each time an element came or went in it (test/built-client-vitals.mjs). The attribute
@@ -18,6 +18,7 @@
18
18
  * it below something that merely contains the same letters.
19
19
  */
20
20
  import { createElement } from 'react';
21
+ import { TABLET_QUERY } from '@mistriwork/ui/internal/ruler.js';
21
22
  import { message, subscribeMessages } from './messages.js';
22
23
  import { $, currentEntry, el, findTable, go, pageView, state, subscribeWalk, tableView, svgEl } from './core.js';
23
24
  import { allSavedFilters } from './views.js';
@@ -237,6 +238,12 @@ export function initSidebarToggle() {
237
238
  let appMode = shellBody().classList.contains('app-mode');
238
239
  let compactOpen = false;
239
240
  const narrowWorkbench = () => compact.matches && !appMode;
241
+ /* On a tablet an App's menu stands folded to its icon rail (docs/design.md, Mobile): the room keeps the width, and
242
+ the rail's names come on hover and focus. Opening it there is for the visit, never remembered: the desk's
243
+ preference is the one stored, and a tablet's window must not overwrite it. */
244
+ const tablet = window.matchMedia(TABLET_QUERY);
245
+ let tabletOpen = false;
246
+ const tabletRail = () => tablet.matches && appMode && shellBody().classList.contains('app-nav-rail');
240
247
  const remember = (next) => {
241
248
  try {
242
249
  window.localStorage?.setItem(SIDEBAR_KEY, next ? '1' : '0');
@@ -298,7 +305,7 @@ export function initSidebarToggle() {
298
305
  onclick: () => apply(false),
299
306
  }, [chevrons('right'), el('span', { class: 'sidebar-reveal-label' }, [say('common.tables2')])]);
300
307
  function renderToggle() {
301
- const next = narrowWorkbench() ? !compactOpen : desktopHidden;
308
+ const next = narrowWorkbench() ? !compactOpen : tabletRail() ? !tabletOpen : desktopHidden;
302
309
  shellBody().classList.toggle('sidebar-hidden', next);
303
310
  const inApp = shellBody().classList.contains('app-mode');
304
311
  const wasFocused = document.activeElement === collapse;
@@ -346,6 +353,8 @@ export function initSidebarToggle() {
346
353
  function apply(next) {
347
354
  if (narrowWorkbench())
348
355
  compactOpen = !next;
356
+ else if (tabletRail())
357
+ tabletOpen = !next;
349
358
  else {
350
359
  desktopHidden = next;
351
360
  remember(next);
@@ -372,6 +381,10 @@ export function initSidebarToggle() {
372
381
  compactOpen = false;
373
382
  renderToggle();
374
383
  });
384
+ tablet.addEventListener('change', () => {
385
+ tabletOpen = false;
386
+ renderToggle();
387
+ });
375
388
  // App/Workbench switches reuse the shell. Responsive disclosure state is
376
389
  // temporary and must never replace the user's desktop sidebar preference.
377
390
  // An App that asks for the rail (app.js sets `app-nav-rail`) changes what
@@ -385,7 +398,7 @@ export function initSidebarToggle() {
385
398
  if (next === appMode && nextRail === railMode && nextBar === barMode)
386
399
  return;
387
400
  if (next !== appMode)
388
- compactOpen = false;
401
+ compactOpen = tabletOpen = false;
389
402
  appMode = next;
390
403
  railMode = nextRail;
391
404
  barMode = nextBar;
@@ -219,6 +219,8 @@ interface AppRoomSlots {
219
219
  Settings: ComponentType<{
220
220
  section?: string;
221
221
  }> | null;
222
+ /** What waits for the reader's review (ReviewRoom.tsx): AI-made proposals and unconfirmed writes, at `/{app}/review`. */
223
+ Review: ComponentType<Record<string, never>> | null;
222
224
  /** A free-form page (FreePage.tsx), where a dashboard entry names one. */
223
225
  Page: ComponentType<{
224
226
  entry?: PageEntry;
@@ -324,10 +326,12 @@ interface RecordSlots {
324
326
  useCellMarks?: (table: TableMeta | undefined, rows: ReadonlyArray<Record<string, unknown>>) => ((row: Record<string, unknown>, column: string, form?: 'cell' | 'summary') => ReactNode | undefined) | undefined;
325
327
  /** What a record page draws at its own fields (pageContext.ts `FieldAdornment`), and whether that is still being
326
328
  asked; `onLanded` re-reads the record after one wrote to it. A hook: read in render, by every record page, routed
327
- or in a dialog. */
329
+ or in a dialog. `notice` is one line drawn under the record's head (what waits on the record as a whole, such
330
+ as an AI proposal). */
328
331
  useFieldAdornment?: (connection: string, table: string, key: Readonly<Record<string, unknown>> | undefined, onLanded: () => void) => {
329
332
  adorn?: FieldAdornment;
330
333
  held: readonly string[];
334
+ notice?: ReactNode;
331
335
  };
332
336
  }
333
337
  /** A command run on one record: its outcome, a refusal already said where it was refused. */