@ai-matrx/records-ui 0.116.37 → 0.116.39

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,7 @@
2
2
 
3
3
  ### Unreleased
4
4
 
5
+ - **Bulk print names every page; gallery cards keep long values inside (AT-SLOW, 2026-10-19).** `BulkActions` takes `titleKey` (Grid passes the table's `title_field`) and hands `PrintWithLayoutDialog` each ticked row's name (`printNames`), so a refused page is titled with the row, not "Record". A gallery tile and card are `min-w-0 overflow-hidden` and each value carries its text as a `title` (`galleryValueTitle`, 300 characters at most), so a long unbroken value is cut with an ellipsis instead of running over the next card. Guards: `a-bulk-print-names-each-page.test.ts`, the new clause in `a-gallery-card-shows-what-it-holds-in-the-grids-format.test.tsx` (red before). Consumer action: none.
5
6
  - **A saved form is never kept as unsaved work (2026-10-19).** `FormBuilder`'s keep timer, armed by the last keystroke, could fire after a save dropped the kept copy and before the read-back landed, keeping the saved form again; the next open said "Unsaved changes … restored" over saved work. What the last accepted save wrote is now never kept. Guard: `a-refused-save-keeps-the-builder.test.tsx` (slow read-back clause, red before). Consumer action: none.
6
7
  - **A rule preview whose count throws says so (2026-10-19).** `FieldRulePreview` left a rejected `recordAggregate` unhandled and stayed on "Counting…" forever; it now shows a refusal ("…values could not be counted."). Guard: `a-value-that-no-longer-fits-and-a-failed-formula-say-why-in-the-cell.test.tsx`. Consumer action: none.
7
8
  - **No cost under a table answer or a run outcome (2026-10-18, law 14: asking and running are doing).** `AgentAnswer` loses its `costPoints` prop and the `data-table-ask-cost` line; the Enrich run-outcome message no longer appends the run's points (the settings and history lines keep theirs). Consumer action: stop passing `costPoints` to `AgentAnswer`.
@@ -27,11 +28,31 @@
27
28
  - Tests: `vitest.setup.ts` gives jsdom a no-op `performance.mark` / `measure`.
28
29
  - **New subpath `@ai-matrx/records-ui/data-source`:** `recordsDataSource`, `personActor` and the who-changed words (`whenWords`, `actorWords`, `actorBadge`, `lastChangeSentence`, `SOMEBODY`, `THE_SYSTEM`) alone. `/helpers` also carries the field-type words, the colour resolver and the table builders, which read `@ai-matrx/records/core`; this entry reaches `@ai-matrx/kit` only, and shares the one data-source cache with `/helpers` and the root. Additive. Consumer action: a shell-reachable service that only binds its supabase client or says when imports from `/data-source`.
29
30
 
30
- ## 0.116.37
31
+ ## 0.116.39
31
32
 
32
33
  UNVERIFIED: this release has no Unreleased entry and the source comparison could not be made (the caller supplied no source comparison). Whether source changed is unknown; consumer action is unknown.
33
34
  Check the package's gitHead on npm against this version's gitHead: `git diff <previous gitHead> <this gitHead> -- apps/shared/records-ui/src`.
34
35
 
36
+ ## 0.116.38
37
+
38
+ SOURCE CHANGED WITH NO RELEASE NOTE. This release shipped source changes that nobody described in an Unreleased entry,
39
+ so they may include breaking API changes. Consumer action is UNKNOWN: read the diff before upgrading.
40
+ Diff: `git diff 6eb91fd368 a9d9a9e3a6 -- apps/shared/records-ui/src`
41
+
42
+ Changed shipped source files (3):
43
+ - `apps/shared/records-ui/src/Grid.tsx`
44
+ - `apps/shared/records-ui/src/ViewSwitcher.tsx`
45
+ - `apps/shared/records-ui/src/gridBulk.tsx`
46
+
47
+ ## 0.116.37
48
+
49
+ SOURCE CHANGED WITH NO RELEASE NOTE. This release shipped source changes that nobody described in an Unreleased entry,
50
+ so they may include breaking API changes. Consumer action is UNKNOWN: read the diff before upgrading.
51
+ Diff: `git diff a243c8ae3d 6eb91fd368 -- apps/shared/records-ui/src`
52
+
53
+ Changed shipped source files (1):
54
+ - `apps/shared/records-ui/src/FormBuilder.tsx`
55
+
35
56
  ## 0.116.36
36
57
 
37
58
  SOURCE CHANGED WITH NO RELEASE NOTE. This release shipped source changes that nobody described in an Unreleased entry,
package/dist/index.cjs CHANGED
@@ -32358,6 +32358,7 @@ function BulkActions({
32358
32358
  bulk,
32359
32359
  noun,
32360
32360
  nounPlural,
32361
+ titleKey = null,
32361
32362
  onDone
32362
32363
  }) {
32363
32364
  const typeable = (0, import_react175.useMemo)(() => fields.filter(fieldIsEditable), [fields]);
@@ -32400,7 +32401,7 @@ function BulkActions({
32400
32401
  ),
32401
32402
  /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(import_design_system89.Button, { size: "sm", variant: "outline", className: "h-7 px-2", "data-records-bulk": "print", disabled: bulk.busy, onClick: () => setPrinting(true), children: "Print with layout\u2026" }),
32402
32403
  /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(import_design_system89.Button, { size: "sm", variant: "outline", className: "h-7 px-2", "data-records-bulk": "delete", disabled: bulk.busy, onClick: () => setConfirmDelete(true), children: "Delete" }),
32403
- printing ? /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(PrintWithLayoutDialog, { tableId, recordIds: ids, open: true, onOpenChange: setPrinting }) : null,
32404
+ printing ? /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(PrintWithLayoutDialog, { tableId, recordIds: ids, names: printNames(ids, rows, titleKey), open: true, onOpenChange: setPrinting }) : null,
32404
32405
  /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(import_design_system89.Dialog, { open: asking !== null, onOpenChange: (next) => !next ? setAsking(null) : void 0, children: /* @__PURE__ */ (0, import_jsx_runtime107.jsxs)(import_design_system89.DialogContent, { className: "sm:max-w-md", children: [
32405
32406
  /* @__PURE__ */ (0, import_jsx_runtime107.jsxs)(import_design_system89.DialogHeader, { children: [
32406
32407
  /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(import_design_system89.DialogTitle, { children: asking === "set" ? `Set a column on ${many}` : asking === "clear" ? `Clear a column on ${many}` : `Fill a column down ${many}` }),
@@ -32467,6 +32468,12 @@ function BulkActions({
32467
32468
  )
32468
32469
  ] });
32469
32470
  }
32471
+ function printNames(ids, rows, titleKey) {
32472
+ const want = new Set(ids);
32473
+ const out = {};
32474
+ for (const row of rows) if (want.has(row.id)) out[row.id] = rowName(row, titleKey ?? null);
32475
+ return out;
32476
+ }
32470
32477
 
32471
32478
  // src/Grid.tsx
32472
32479
  init_recordVersions();
@@ -32851,6 +32858,7 @@ var embeddedPageAskKey = (tableId, search, sorts, filter, pageDoorViewId) => JSO
32851
32858
  var NO_SUMMARIES = Object.freeze({});
32852
32859
  var NO_DRILL_FIELDS = Object.freeze([]);
32853
32860
  var rowIdOf = (row) => row.id;
32861
+ var ACTIONS_GHOST_ROW = { id: "", document: {} };
32854
32862
  var NO_REREAD = () => {
32855
32863
  };
32856
32864
  var VALUE_FILTER_UI = { allowNegation: true };
@@ -34154,9 +34162,9 @@ function GridBody({
34154
34162
  () => /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(ActionsHeaderControls, { ...mayManageActions ? { onAddColumn: () => addColumnNow.current() } : {} }),
34155
34163
  [mayManageActions]
34156
34164
  );
34157
- const rowActions = (0, import_react182.useCallback)(
34158
- (row) => /* @__PURE__ */ (0, import_jsx_runtime111.jsxs)(import_jsx_runtime111.Fragment, { children: [
34159
- canWrite && mayWriteRow(row.id) ? tableActions2.runnable.map((action3) => /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(
34165
+ const rowStrip = (0, import_react182.useCallback)(
34166
+ (row, writable) => /* @__PURE__ */ (0, import_jsx_runtime111.jsxs)(import_jsx_runtime111.Fragment, { children: [
34167
+ canWrite && writable ? tableActions2.runnable.map((action3) => /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(
34160
34168
  ActionButton,
34161
34169
  {
34162
34170
  action: action3,
@@ -34206,7 +34214,7 @@ function GridBody({
34206
34214
  children: "Duplicate"
34207
34215
  }
34208
34216
  ) : null,
34209
- canWrite && mayWriteRow(row.id) ? /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(
34217
+ canWrite && writable ? /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(
34210
34218
  import_design_system92.Button,
34211
34219
  {
34212
34220
  size: "sm",
@@ -34218,8 +34226,9 @@ function GridBody({
34218
34226
  ) : null
34219
34227
  ] }),
34220
34228
  // eslint-disable-next-line react-hooks/exhaustive-deps -- `hasTalk`/`hasAgent` stand for the host ports the JSX reads; handlers run through `rowActionsNow`.
34221
- [canWrite, mayWriteRow, tableActions2.runnable, tableActions2.agent, runner.busy, hasTalk, hasAgent, editable, rights.write, readOnly]
34229
+ [canWrite, tableActions2.runnable, tableActions2.agent, runner.busy, hasTalk, hasAgent, editable, rights.write, readOnly]
34222
34230
  );
34231
+ const rowActions = (0, import_react182.useCallback)((row) => rowStrip(row, row === ACTIONS_GHOST_ROW || mayWriteRow(row.id)), [rowStrip, mayWriteRow]);
34223
34232
  const headerHeld = (0, import_react182.useRef)(/* @__PURE__ */ new Map());
34224
34233
  const menuLatest = (0, import_react182.useRef)(/* @__PURE__ */ new Map());
34225
34234
  const addColumnDef = (0, import_react182.useMemo)(() => addColumnColumn(() => addColumnNow.current()), []);
@@ -34243,7 +34252,7 @@ function GridBody({
34243
34252
  () => offersRowActions ? [...columns, { id: "custom-actions", header: merged ? /* @__PURE__ */ (0, import_jsx_runtime111.jsxs)("span", { className: "inline-flex items-center gap-0.5", children: [
34244
34253
  /* @__PURE__ */ (0, import_jsx_runtime111.jsx)("span", { children: "Actions" }),
34245
34254
  actionsHeader
34246
- ] }) : "Actions", label: "Actions", reorderable: false, sortable: false, filter: false, customActions: rowActions }] : columns,
34255
+ ] }) : "Actions", label: "Actions", reorderable: false, sortable: false, filter: false, customActions: rowActions, customActionsGhostRow: ACTIONS_GHOST_ROW }] : columns,
34247
34256
  [columns, offersRowActions, merged, actionsHeader, rowActions]
34248
34257
  );
34249
34258
  const [localColumns, setLocalColumns] = (0, import_react182.useState)(
@@ -34961,6 +34970,7 @@ function GridBody({
34961
34970
  bulk,
34962
34971
  noun,
34963
34972
  nounPlural,
34973
+ titleKey,
34964
34974
  onDone: () => setSelectedIds([])
34965
34975
  }
34966
34976
  ) : null,
@@ -47256,6 +47266,11 @@ function Board({
47256
47266
  pager
47257
47267
  ] });
47258
47268
  }
47269
+ function galleryValueTitle(value) {
47270
+ if (typeof value === "number") return String(value);
47271
+ if (typeof value !== "string" || value.trim() === "") return void 0;
47272
+ return value.length > 300 ? `${value.slice(0, 299)}\u2026` : value;
47273
+ }
47259
47274
  function FieldPicker({
47260
47275
  layout,
47261
47276
  label,
@@ -47631,45 +47646,49 @@ function Gallery({
47631
47646
  const filled = shown5.filter((field2) => !isEmptyOnCard(doc[field2.key]) || withheldNoticeOf(row.hidden, field2.key));
47632
47647
  const onCard = chose ? filled : filled.slice(0, GALLERY_DEFAULT_FIELDS);
47633
47648
  const rowColor = style ? (0, import_data_table23.resolveRowColor)(style, { id: row.id, data: row.document ?? {} }, colorFromTheValue) : null;
47634
- return /* @__PURE__ */ (0, import_jsx_runtime155.jsx)("li", { className: "flex", children: /* @__PURE__ */ (0, import_jsx_runtime155.jsx)(
47635
- MaybeRecordActionMenu,
47636
- {
47637
- tableId,
47638
- row,
47639
- name: recordNameIn({ title_field: titleKey ?? null }, doc),
47640
- onOpenRecord,
47641
- onChanged,
47642
- children: /* @__PURE__ */ (0, import_jsx_runtime155.jsxs)(
47643
- ClickableSurface,
47644
- {
47645
- label: `Open ${recordNameIn({ title_field: titleKey ?? null }, doc) || "record"}`,
47646
- onOpen: () => onOpenRecord?.(row.id),
47647
- className: (0, import_design_system131.cn)("h-full w-full rounded border text-left hover:bg-muted", rowColor ? import_data_table23.ROW_TINT_CLASS[rowColor] : void 0),
47648
- contentClassName: "flex h-full w-full flex-col gap-1 p-2 pr-7",
47649
- data: { "data-records-gallery-card": row.id },
47650
- children: [
47651
- imageField ? /* @__PURE__ */ (0, import_jsx_runtime155.jsx)("span", { className: (0, import_design_system131.cn)(dims.cover, "w-full shrink-0 overflow-hidden rounded bg-muted/50"), "data-records-gallery-cover": imageField.key, children: /* @__PURE__ */ (0, import_jsx_runtime155.jsx)(GalleryCover, { field: imageField, value: image }) }) : null,
47652
- /* @__PURE__ */ (0, import_jsx_runtime155.jsx)("span", { className: "truncate text-sm font-medium", "data-records-gallery-title": "", children: recordNameIn({ title_field: titleKey ?? null }, doc) || "Untitled" }),
47653
- onCard.map((field2) => /* @__PURE__ */ (0, import_jsx_runtime155.jsxs)("span", { className: "flex h-5 min-w-0 items-center gap-1 overflow-hidden whitespace-nowrap text-xs", children: [
47654
- /* @__PURE__ */ (0, import_jsx_runtime155.jsx)("span", { className: "shrink-0 text-muted-foreground", children: fieldName(field2) }),
47655
- /* @__PURE__ */ (0, import_jsx_runtime155.jsx)("span", { className: "min-w-0 truncate", "data-records-gallery-value": field2.key, children: /* @__PURE__ */ (0, import_jsx_runtime155.jsx)(
47656
- RecordValue,
47657
- {
47658
- inCell: true,
47659
- field: field2,
47660
- value: doc[field2.key],
47661
- document: row.document,
47662
- recordId: row.id,
47663
- withheld: withheldNoticeOf(row.hidden, field2.key),
47664
- format: cellFormatFor(field2, formats?.[field2.key])
47665
- }
47666
- ) })
47667
- ] }, field2.key))
47668
- ]
47669
- }
47670
- )
47671
- }
47672
- ) }, row.id);
47649
+ return (
47650
+ // min-w-0 + overflow-hidden: a long unbroken value (a link, a data: URL) is cut at the card's
47651
+ // edge with its line's ellipsis, never drawn over the next card (AT-SLOW 4b).
47652
+ /* @__PURE__ */ (0, import_jsx_runtime155.jsx)("li", { className: "flex min-w-0 overflow-hidden", "data-records-gallery-tile": "", children: /* @__PURE__ */ (0, import_jsx_runtime155.jsx)(
47653
+ MaybeRecordActionMenu,
47654
+ {
47655
+ tableId,
47656
+ row,
47657
+ name: recordNameIn({ title_field: titleKey ?? null }, doc),
47658
+ onOpenRecord,
47659
+ onChanged,
47660
+ children: /* @__PURE__ */ (0, import_jsx_runtime155.jsxs)(
47661
+ ClickableSurface,
47662
+ {
47663
+ label: `Open ${recordNameIn({ title_field: titleKey ?? null }, doc) || "record"}`,
47664
+ onOpen: () => onOpenRecord?.(row.id),
47665
+ className: (0, import_design_system131.cn)("h-full w-full min-w-0 overflow-hidden rounded border text-left hover:bg-muted", rowColor ? import_data_table23.ROW_TINT_CLASS[rowColor] : void 0),
47666
+ contentClassName: "flex h-full w-full min-w-0 flex-col gap-1 p-2 pr-7",
47667
+ data: { "data-records-gallery-card": row.id },
47668
+ children: [
47669
+ imageField ? /* @__PURE__ */ (0, import_jsx_runtime155.jsx)("span", { className: (0, import_design_system131.cn)(dims.cover, "w-full shrink-0 overflow-hidden rounded bg-muted/50"), "data-records-gallery-cover": imageField.key, children: /* @__PURE__ */ (0, import_jsx_runtime155.jsx)(GalleryCover, { field: imageField, value: image }) }) : null,
47670
+ /* @__PURE__ */ (0, import_jsx_runtime155.jsx)("span", { className: "truncate text-sm font-medium", "data-records-gallery-title": "", children: recordNameIn({ title_field: titleKey ?? null }, doc) || "Untitled" }),
47671
+ onCard.map((field2) => /* @__PURE__ */ (0, import_jsx_runtime155.jsxs)("span", { className: "flex h-5 min-w-0 items-center gap-1 overflow-hidden whitespace-nowrap text-xs", children: [
47672
+ /* @__PURE__ */ (0, import_jsx_runtime155.jsx)("span", { className: "shrink-0 text-muted-foreground", children: fieldName(field2) }),
47673
+ /* @__PURE__ */ (0, import_jsx_runtime155.jsx)("span", { className: "min-w-0 truncate", "data-records-gallery-value": field2.key, title: galleryValueTitle(doc[field2.key]), children: /* @__PURE__ */ (0, import_jsx_runtime155.jsx)(
47674
+ RecordValue,
47675
+ {
47676
+ inCell: true,
47677
+ field: field2,
47678
+ value: doc[field2.key],
47679
+ document: row.document,
47680
+ recordId: row.id,
47681
+ withheld: withheldNoticeOf(row.hidden, field2.key),
47682
+ format: cellFormatFor(field2, formats?.[field2.key])
47683
+ }
47684
+ ) })
47685
+ ] }, field2.key))
47686
+ ]
47687
+ }
47688
+ )
47689
+ }
47690
+ ) }, row.id)
47691
+ );
47673
47692
  }),
47674
47693
  onNew ? /* @__PURE__ */ (0, import_jsx_runtime155.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime155.jsxs)(
47675
47694
  "button",