@ai-matrx/records-ui 0.116.36 → 0.116.38

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,8 @@
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.
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.
5
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.
6
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`.
7
9
  - **A section card shows and edits real schema tables (2026-10-18).** BREAKING: `SectionCard` takes `source` instead of `tableId` — the same union as `RecordsTableCard`: `{ kind: "table", id }` (a custom Table, unchanged) or `{ kind: "entity", token, filter? }` (a table made with `platform.create_entity_table`, e.g. `web_brand_choice`), drawn by the new `EntitySectionCard` over the one standard-source path (`entityTable.tsx`): the door's columns (bookkeeping and the pinned parent left out; a column the door marks read-only is text), edits through `entity_update` with the version seen and put back with the store's sentence on refusal, Add filed in the active organization. `filter` (`{ brand_id }`) shows one parent's rows — asked of the door as `eq` clauses, stamped on rows added — and is also accepted by `RecordsTableCard`'s entity source and `useEntitySourceTable` (`EntityFilter`, `entityFilterWhere` exported). Guard: `a-section-card-shows-and-edits-a-standard-table.test.tsx` (red without the change). Consumer action: replace `<SectionCard tableId={id} />` with `<SectionCard source={{ kind: "table", id }} />`.
@@ -26,11 +28,29 @@
26
28
  - Tests: `vitest.setup.ts` gives jsdom a no-op `performance.mark` / `measure`.
27
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`.
28
30
 
29
- ## 0.116.36
31
+ ## 0.116.38
30
32
 
31
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.
32
34
  Check the package's gitHead on npm against this version's gitHead: `git diff <previous gitHead> <this gitHead> -- apps/shared/records-ui/src`.
33
35
 
36
+ ## 0.116.37
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 a243c8ae3d 6eb91fd368 -- apps/shared/records-ui/src`
41
+
42
+ Changed shipped source files (1):
43
+ - `apps/shared/records-ui/src/FormBuilder.tsx`
44
+
45
+ ## 0.116.36
46
+
47
+ SOURCE CHANGED WITH NO RELEASE NOTE. This release shipped source changes that nobody described in an Unreleased entry,
48
+ so they may include breaking API changes. Consumer action is UNKNOWN: read the diff before upgrading.
49
+ Diff: `git diff cccbd6176f a243c8ae3d -- apps/shared/records-ui/src`
50
+
51
+ Changed shipped source files (1):
52
+ - `apps/shared/records-ui/src/FieldRulePreview.tsx`
53
+
34
54
  ## 0.116.35
35
55
 
36
56
  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();
@@ -34961,6 +34968,7 @@ function GridBody({
34961
34968
  bulk,
34962
34969
  noun,
34963
34970
  nounPlural,
34971
+ titleKey,
34964
34972
  onDone: () => setSelectedIds([])
34965
34973
  }
34966
34974
  ) : null,
@@ -47256,6 +47264,11 @@ function Board({
47256
47264
  pager
47257
47265
  ] });
47258
47266
  }
47267
+ function galleryValueTitle(value) {
47268
+ if (typeof value === "number") return String(value);
47269
+ if (typeof value !== "string" || value.trim() === "") return void 0;
47270
+ return value.length > 300 ? `${value.slice(0, 299)}\u2026` : value;
47271
+ }
47259
47272
  function FieldPicker({
47260
47273
  layout,
47261
47274
  label,
@@ -47631,45 +47644,49 @@ function Gallery({
47631
47644
  const filled = shown5.filter((field2) => !isEmptyOnCard(doc[field2.key]) || withheldNoticeOf(row.hidden, field2.key));
47632
47645
  const onCard = chose ? filled : filled.slice(0, GALLERY_DEFAULT_FIELDS);
47633
47646
  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);
47647
+ return (
47648
+ // min-w-0 + overflow-hidden: a long unbroken value (a link, a data: URL) is cut at the card's
47649
+ // edge with its line's ellipsis, never drawn over the next card (AT-SLOW 4b).
47650
+ /* @__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)(
47651
+ MaybeRecordActionMenu,
47652
+ {
47653
+ tableId,
47654
+ row,
47655
+ name: recordNameIn({ title_field: titleKey ?? null }, doc),
47656
+ onOpenRecord,
47657
+ onChanged,
47658
+ children: /* @__PURE__ */ (0, import_jsx_runtime155.jsxs)(
47659
+ ClickableSurface,
47660
+ {
47661
+ label: `Open ${recordNameIn({ title_field: titleKey ?? null }, doc) || "record"}`,
47662
+ onOpen: () => onOpenRecord?.(row.id),
47663
+ 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),
47664
+ contentClassName: "flex h-full w-full min-w-0 flex-col gap-1 p-2 pr-7",
47665
+ data: { "data-records-gallery-card": row.id },
47666
+ children: [
47667
+ 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,
47668
+ /* @__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" }),
47669
+ 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: [
47670
+ /* @__PURE__ */ (0, import_jsx_runtime155.jsx)("span", { className: "shrink-0 text-muted-foreground", children: fieldName(field2) }),
47671
+ /* @__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)(
47672
+ RecordValue,
47673
+ {
47674
+ inCell: true,
47675
+ field: field2,
47676
+ value: doc[field2.key],
47677
+ document: row.document,
47678
+ recordId: row.id,
47679
+ withheld: withheldNoticeOf(row.hidden, field2.key),
47680
+ format: cellFormatFor(field2, formats?.[field2.key])
47681
+ }
47682
+ ) })
47683
+ ] }, field2.key))
47684
+ ]
47685
+ }
47686
+ )
47687
+ }
47688
+ ) }, row.id)
47689
+ );
47673
47690
  }),
47674
47691
  onNew ? /* @__PURE__ */ (0, import_jsx_runtime155.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime155.jsxs)(
47675
47692
  "button",
@@ -53222,10 +53239,11 @@ function FormBuilder({ tableId, seed, activeFormId, onActiveForm, startWithOne,
53222
53239
  );
53223
53240
  const stored = (0, import_react300.useMemo)(() => draft ? (forms ?? []).find((f) => f.id === draft.id) ?? null : null, [draft, forms]);
53224
53241
  const dirty = Boolean(draft && stored && !sameForm(draft, stored));
53242
+ const lastSaved = (0, import_react300.useRef)(null);
53225
53243
  (0, import_react300.useEffect)(() => {
53226
53244
  if (!draft || !stored) return;
53227
53245
  const timer = window.setTimeout(() => {
53228
- if (sameForm(draft, stored)) (0, import_drafts.dropKeptDraft)(formDraftKey(draft.id), { storage: "local" });
53246
+ if (sameForm(draft, stored) || lastSaved.current && sameForm(draft, lastSaved.current)) (0, import_drafts.dropKeptDraft)(formDraftKey(draft.id), { storage: "local" });
53229
53247
  else (0, import_drafts.keepDraft)(formDraftKey(draft.id), keptSpecOf(draft), { storage: "local" });
53230
53248
  }, 300);
53231
53249
  return () => window.clearTimeout(timer);
@@ -53285,6 +53303,7 @@ function FormBuilder({ tableId, seed, activeFormId, onActiveForm, startWithOne,
53285
53303
  setRefused(written.error);
53286
53304
  return false;
53287
53305
  }
53306
+ lastSaved.current = draft;
53288
53307
  (0, import_drafts.dropKeptDraft)(formDraftKey(draft.id), { storage: "local" });
53289
53308
  setRestoredAt(null);
53290
53309
  setSaved("Saved");