@ai-matrx/records-ui 0.116.52 → 0.116.54

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
+ - **"Fill N rows" in the AI fill panel; a bulk fill confirms with its points estimate (lane ENRICH-SPEED, 2026-10-19).** `EnrichPanel` gains a small number box and "Fill N rows" (1 to 50, default 3) beside "Try on 1 row", so a person can try 3 or 10 before paying for all. It runs the same `host.enrich` as "Fill in what is due" (never a second runner); 10 rows or fewer run at once, anything bigger, including "Fill in what is due" (the rows still empty, at most 50), meets a confirm step that shows the points estimate (`cost_per_row_cents` at the host's `pointsRate`, or says there is no estimate yet). New exports from `Enrich`: `FILL_TRY_MAX`, `FILL_ROWS_MAX`, `dueRowsEstimate`, `fillCountFrom`. Guard: `fill-n-rows-and-a-bulk-fill-confirms.test.tsx` (red before). Consumer action: none.
6
+ - **A chart view counts each option of a many-value column (CHART-READ-2, 2026-10-19).** `ChartLayout` asks the store for the split (`splitMulti: true`), so a multi-select or multi-link chart draws one bar per option / linked record instead of one per distinct combination. Guard: `a-chart-view-counts-each-option-of-a-many-value-column.test.tsx` (red before). Consumer action: none.
5
7
  - **An AI column fills from its own header menu (lane SERVER-STORE, 2026-10-19).** The column header menu of an AI column (`source: "agent"`) draws "Fill with AI…" (`col-fill-ai`); it opens THE column's AI fill panel (`EnrichPanel`, the same one as Settings > Fields > "AI fill") in a dialog, through the new optional `GridMenuActions.fillWithAi`. Guard: `an-ai-column-fills-from-its-own-header-menu.test.tsx` (red before). Consumer action: none.
6
8
  - **A reader's bulk write buttons are disabled with the reason (AT-FIX-G1b, 2026-10-19).** The selection bar drew Set a column / Clear / Fill down / Duplicate / Delete enabled for a member with only View access and refused on apply (or, on a read-only table, no row could be ticked at all). Every row is now selectable (copy and print read), and `BulkActions` draws the write buttons disabled with `NEEDS_EDIT_REASON` ("Needs Edit access") unless the person may write every ticked row; Print with layout stays on. The gate is in the action, not in the tick boxes. Guard: `a-view-only-reader-sees-the-bulk-write-buttons-disabled-with-the-reason.test.tsx` (red before). Consumer action: none.
7
9
  - **An interface-only reader draws the real chart (AT-FIX-G1b, 2026-10-19).** A chart element read through the interface door now draws from `client.interfaceChart` (the one `ChartBlock`); the dashed "Charts draw for members of this organization." box stays only when the store answers nothing, and a chart over a column she may not read shows the store's refusal. Needs `@ai-matrx/records` with `interfaceChart`. Guard: `an-interface-only-viewer-draws-the-chart-from-the-interface-chart-read.test.tsx` (red before). Consumer action: none.
@@ -36,11 +38,21 @@
36
38
  - Tests: `vitest.setup.ts` gives jsdom a no-op `performance.mark` / `measure`.
37
39
  - **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`.
38
40
 
39
- ## 0.116.52
41
+ ## 0.116.54
40
42
 
41
43
  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.
42
44
  Check the package's gitHead on npm against this version's gitHead: `git diff <previous gitHead> <this gitHead> -- apps/shared/records-ui/src`.
43
45
 
46
+ ## 0.116.52
47
+
48
+ SOURCE CHANGED WITH NO RELEASE NOTE. This release shipped source changes that nobody described in an Unreleased entry,
49
+ so they may include breaking API changes. Consumer action is UNKNOWN: read the diff before upgrading.
50
+ Diff: `git diff 64368f10b4 e85f4b0faf -- apps/shared/records-ui/src`
51
+
52
+ Changed shipped source files (2):
53
+ - `apps/shared/records-ui/src/gridControls.tsx`
54
+ - `apps/shared/records-ui/src/gridMenus.ts`
55
+
44
56
  ## 0.116.51
45
57
 
46
58
  SOURCE CHANGED WITH NO RELEASE NOTE. This release shipped source changes that nobody described in an Unreleased entry,
package/dist/index.cjs CHANGED
@@ -23230,6 +23230,18 @@ function useEnrichCells(tableId, recordIds) {
23230
23230
  return { cells, refresh, error };
23231
23231
  }
23232
23232
  var NEVER2 = "Fill it in once and leave it alone";
23233
+ var FILL_TRY_MAX = 10;
23234
+ var FILL_ROWS_MAX = 50;
23235
+ var FILL_N_DEFAULT = "3";
23236
+ function dueRowsEstimate(row) {
23237
+ const empty = Math.max(0, Number(row.rows_total) - Number(row.rows_filled));
23238
+ return Math.max(1, Math.min(FILL_ROWS_MAX, empty));
23239
+ }
23240
+ function fillCountFrom(text) {
23241
+ if (!/^\d+$/.test(text.trim())) return null;
23242
+ const n = Number(text);
23243
+ return n >= 1 && n <= FILL_ROWS_MAX ? n : null;
23244
+ }
23233
23245
  function EnrichPanel({ tableId, fieldId, className }) {
23234
23246
  const client = (0, import_react108.useRecordsClient)();
23235
23247
  const host = useRecordsUi();
@@ -23241,6 +23253,8 @@ function EnrichPanel({ tableId, fieldId, className }) {
23241
23253
  const [busy, setBusy] = (0, import_react107.useState)(null);
23242
23254
  const [outcome, setOutcome] = (0, import_react107.useState)(null);
23243
23255
  const [preview, setPreview] = (0, import_react107.useState)(null);
23256
+ const [fillN, setFillN] = (0, import_react107.useState)({});
23257
+ const [confirming, setConfirming] = (0, import_react107.useState)(null);
23244
23258
  const [draft, setDraft] = (0, import_react107.useState)({});
23245
23259
  const load = (0, import_react107.useCallback)(async () => {
23246
23260
  const answered = await client.enrichments({ table_id: tableId });
@@ -23311,6 +23325,17 @@ function EnrichPanel({ tableId, fieldId, className }) {
23311
23325
  },
23312
23326
  [host, load, tableId]
23313
23327
  );
23328
+ const startFill = (0, import_react107.useCallback)(
23329
+ (row, count) => {
23330
+ if (count > FILL_TRY_MAX) {
23331
+ setConfirming({ fieldId: row.field_id, count });
23332
+ return;
23333
+ }
23334
+ setConfirming(null);
23335
+ void runIt(row, false, count);
23336
+ },
23337
+ [runIt]
23338
+ );
23314
23339
  if (error) return /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(RefusalNotice, { error, className });
23315
23340
  if (rows === null) return /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(import_design_system60.Skeleton, { className: (0, import_design_system60.cn)("h-40 w-full", className) });
23316
23341
  if (shown5.length === 0 && fieldId) {
@@ -23548,17 +23573,77 @@ function EnrichPanel({ tableId, fieldId, className }) {
23548
23573
  children: "Preview on five rows"
23549
23574
  }
23550
23575
  ),
23576
+ /* @__PURE__ */ (0, import_jsx_runtime71.jsxs)("span", { className: "inline-flex items-center gap-1", "data-enrich-fill-n": "", children: [
23577
+ /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(
23578
+ import_design_system60.Input,
23579
+ {
23580
+ type: "number",
23581
+ inputMode: "numeric",
23582
+ min: 1,
23583
+ max: FILL_ROWS_MAX,
23584
+ className: "h-8 w-16",
23585
+ "aria-label": "How many rows to fill",
23586
+ value: fillN[row.field_id] ?? FILL_N_DEFAULT,
23587
+ onChange: (e) => setFillN((prev) => ({ ...prev, [row.field_id]: e.target.value }))
23588
+ }
23589
+ ),
23590
+ /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(
23591
+ import_design_system60.Button,
23592
+ {
23593
+ size: "sm",
23594
+ variant: "outline",
23595
+ disabled: busy === row.field_id || !row.enabled || fillCountFrom(fillN[row.field_id] ?? FILL_N_DEFAULT) === null,
23596
+ "data-enrich-fill-rows": "",
23597
+ onClick: () => {
23598
+ const n = fillCountFrom(fillN[row.field_id] ?? FILL_N_DEFAULT);
23599
+ if (n !== null) startFill(row, n);
23600
+ },
23601
+ children: (() => {
23602
+ const n = fillCountFrom(fillN[row.field_id] ?? FILL_N_DEFAULT);
23603
+ return n === null ? "Fill rows" : `Fill ${n} ${n === 1 ? "row" : "rows"}`;
23604
+ })()
23605
+ }
23606
+ )
23607
+ ] }),
23551
23608
  /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(
23552
23609
  import_design_system60.Button,
23553
23610
  {
23554
23611
  size: "sm",
23555
23612
  disabled: busy === row.field_id || !row.enabled,
23556
- onClick: () => void runIt(row, false),
23613
+ "data-enrich-fill-due": "",
23614
+ onClick: () => startFill(row, dueRowsEstimate(row)),
23557
23615
  children: "Fill in what is due"
23558
23616
  }
23559
23617
  )
23560
23618
  ] }) : null
23561
23619
  ] }) : null,
23620
+ confirming && confirming.fieldId === row.field_id ? /* @__PURE__ */ (0, import_jsx_runtime71.jsxs)("div", { className: "space-y-2 rounded border p-2 text-xs", role: "alertdialog", "data-enrich-confirm": "", children: [
23621
+ /* @__PURE__ */ (0, import_jsx_runtime71.jsxs)("p", { children: [
23622
+ `Fill ${confirming.count} rows`,
23623
+ (() => {
23624
+ const each = row.cost_per_row_cents === null ? null : Number(row.cost_per_row_cents);
23625
+ const total = each === null ? null : costInPoints(each * confirming.count, host.pointsRate);
23626
+ return total !== null ? ` \xB7 about ${total}` : " \xB7 no estimate yet, it has not run";
23627
+ })()
23628
+ ] }),
23629
+ /* @__PURE__ */ (0, import_jsx_runtime71.jsxs)("div", { className: "flex gap-2", children: [
23630
+ /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(
23631
+ import_design_system60.Button,
23632
+ {
23633
+ size: "sm",
23634
+ "data-enrich-confirm-go": "",
23635
+ disabled: busy === row.field_id,
23636
+ onClick: () => {
23637
+ const n = confirming.count;
23638
+ setConfirming(null);
23639
+ void runIt(row, false, n);
23640
+ },
23641
+ children: `Fill ${confirming.count} rows`
23642
+ }
23643
+ ),
23644
+ /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(import_design_system60.Button, { size: "sm", variant: "ghost", onClick: () => setConfirming(null), children: "Cancel" })
23645
+ ] })
23646
+ ] }) : null,
23562
23647
  !host.enrich && rights.admin ? /* @__PURE__ */ (0, import_jsx_runtime71.jsx)("p", { className: "text-[11px] text-muted-foreground", children: NO_ENRICH_REASON }) : null,
23563
23648
  preview && preview.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime71.jsxs)("div", { className: "rounded border p-2 text-xs", children: [
23564
23649
  /* @__PURE__ */ (0, import_jsx_runtime71.jsxs)("p", { className: "mb-1 font-medium", children: [
@@ -45839,6 +45924,8 @@ function ChartLayout({ view, fields, filter, onChange, remembered }) {
45839
45924
  ...question.bucket ? { bucket: question.bucket } : {},
45840
45925
  measures: question.measures,
45841
45926
  limit: 200,
45927
+ // a chart counts each option of a multi-value column under its own group (Airtable); the grid group-by does not
45928
+ splitMulti: true,
45842
45929
  ...Object.keys(asked4).length > 0 ? { filter: asked4 } : {}
45843
45930
  }), whole]).then(([answered, overall]) => {
45844
45931
  if (cancelled) return;