@ai-matrx/records-ui 0.116.42 → 0.116.44

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/dist/index.d.cts CHANGED
@@ -1822,7 +1822,7 @@ declare function GridCell({ field, row, editing, canWrite, whyNot, format, onAsk
1822
1822
  declare function hintIsMachineIdentity(hint: string): boolean;
1823
1823
  /** The hint a PERSON should read, or null when it is written for an engineer. */
1824
1824
  declare function hintForAPerson(hint: string | null | undefined): string | null;
1825
- declare function RefusalNotice({ error, className, actions, onKeepEditing, onDiscard, }: {
1825
+ declare function RefusalNotice({ error, className, actions, onKeepEditing, onDiscard, onRetry, }: {
1826
1826
  error: RecordsError;
1827
1827
  className?: string | undefined;
1828
1828
  actions?: ReactNode | undefined;
@@ -1836,6 +1836,11 @@ declare function RefusalNotice({ error, className, actions, onKeepEditing, onDis
1836
1836
  */
1837
1837
  onKeepEditing?: (() => void) | undefined;
1838
1838
  onDiscard?: (() => void) | undefined;
1839
+ /**
1840
+ * TRY AGAIN (AT-SLOW-2, 2026-10-19): the press that failed, run again. Pass it where the refused act
1841
+ * is safe to repeat as it was (ViewNeeds reads the table first, so a declare that landed is never made twice).
1842
+ */
1843
+ onRetry?: (() => void) | undefined;
1839
1844
  }): react.JSX.Element;
1840
1845
  /** A small inline one, for a cell or a field where a block would break the layout. */
1841
1846
  declare function RefusalLine({ error, className }: {
package/dist/index.d.ts CHANGED
@@ -1822,7 +1822,7 @@ declare function GridCell({ field, row, editing, canWrite, whyNot, format, onAsk
1822
1822
  declare function hintIsMachineIdentity(hint: string): boolean;
1823
1823
  /** The hint a PERSON should read, or null when it is written for an engineer. */
1824
1824
  declare function hintForAPerson(hint: string | null | undefined): string | null;
1825
- declare function RefusalNotice({ error, className, actions, onKeepEditing, onDiscard, }: {
1825
+ declare function RefusalNotice({ error, className, actions, onKeepEditing, onDiscard, onRetry, }: {
1826
1826
  error: RecordsError;
1827
1827
  className?: string | undefined;
1828
1828
  actions?: ReactNode | undefined;
@@ -1836,6 +1836,11 @@ declare function RefusalNotice({ error, className, actions, onKeepEditing, onDis
1836
1836
  */
1837
1837
  onKeepEditing?: (() => void) | undefined;
1838
1838
  onDiscard?: (() => void) | undefined;
1839
+ /**
1840
+ * TRY AGAIN (AT-SLOW-2, 2026-10-19): the press that failed, run again. Pass it where the refused act
1841
+ * is safe to repeat as it was (ViewNeeds reads the table first, so a declare that landed is never made twice).
1842
+ */
1843
+ onRetry?: (() => void) | undefined;
1839
1844
  }): react.JSX.Element;
1840
1845
  /** A small inline one, for a cell or a field where a block would break the layout. */
1841
1846
  declare function RefusalLine({ error, className }: {
package/dist/index.js CHANGED
@@ -182,7 +182,7 @@ import {
182
182
  withoutAddition,
183
183
  withoutLeadingBlank,
184
184
  workedOutErrorFor
185
- } from "./chunk-JKM6DDSD.js";
185
+ } from "./chunk-KP2R7LVO.js";
186
186
  import {
187
187
  CHART_PLOT_PX,
188
188
  EMBEDDED_ROW_PX,
@@ -293,7 +293,7 @@ import {
293
293
  visibilityLaneFor,
294
294
  whyNotAskable,
295
295
  writeOnTheWinningVersion_exports
296
- } from "./chunk-U7SHCLTY.js";
296
+ } from "./chunk-CV4D2BZY.js";
297
297
  import {
298
298
  ACTION_CHECKING_ACCESS_REASON,
299
299
  ACTION_NOT_HERE_REASON,
@@ -400,7 +400,7 @@ import {
400
400
  useRowRights,
401
401
  useTableRights,
402
402
  withoutInternalCodes
403
- } from "./chunk-5IHVQ5MS.js";
403
+ } from "./chunk-KEILC5XG.js";
404
404
  import {
405
405
  FEWEST_KEY_VALUE_PAIRS,
406
406
  FEWEST_LIST_ITEMS,
@@ -3607,7 +3607,7 @@ function DocTemplate({ tableId, seed, pageSettings, activeTemplateId, onActiveTe
3607
3607
  setActiveId(saved.data);
3608
3608
  await load();
3609
3609
  }
3610
- if (fields.error) return /* @__PURE__ */ jsx10(RefusalNotice, { error: fields.error, className });
3610
+ if (fields.error) return /* @__PURE__ */ jsx10(RefusalNotice, { error: fields.error, onRetry: fields.reload, className });
3611
3611
  if (error) {
3612
3612
  return /* @__PURE__ */ jsx10(
3613
3613
  RefusalNotice,
@@ -7683,7 +7683,7 @@ function CustomRecordForm({
7683
7683
  () => fields.data ? predictWriteRefusals({ fields: fields.data, document: document2, ...recordType ? { recordType } : {} }) : [],
7684
7684
  [fields.data, document2, recordType]
7685
7685
  );
7686
- if (fields.error) return /* @__PURE__ */ jsx24(RefusalNotice, { error: fields.error, className });
7686
+ if (fields.error) return /* @__PURE__ */ jsx24(RefusalNotice, { error: fields.error, onRetry: fields.reload, className });
7687
7687
  if (existing.error) return /* @__PURE__ */ jsx24(RefusalNotice, { error: existing.error, className });
7688
7688
  const storeSaid = said.error && said.error !== answered ? said.error : null;
7689
7689
  const fieldProblems = predicted.filter((p) => p.field_key);
@@ -9826,7 +9826,7 @@ function AddLinkedDialog({
9826
9826
  "Add to ",
9827
9827
  column.source_table_name
9828
9828
  ] }) }),
9829
- fields.error ? /* @__PURE__ */ jsx28(RefusalNotice, { error: fields.error }) : initial ? /* @__PURE__ */ jsx28(
9829
+ fields.error ? /* @__PURE__ */ jsx28(RefusalNotice, { error: fields.error, onRetry: fields.reload }) : initial ? /* @__PURE__ */ jsx28(
9830
9830
  RecordForm,
9831
9831
  {
9832
9832
  tableId: column.source_table_id,
@@ -14175,8 +14175,8 @@ function GridBody({
14175
14175
  if (!embedded) rememberRowCount(`${tableId}:page:last`, rows.length);
14176
14176
  }
14177
14177
  }, [rowsAnswered, rowMemoryKey, rows.length, embedded, tableId]);
14178
- if (table.error) return /* @__PURE__ */ jsx44(RefusalNotice, { error: table.error, className });
14179
- if (fields.error) return /* @__PURE__ */ jsx44(RefusalNotice, { error: fields.error, className });
14178
+ if (table.error) return /* @__PURE__ */ jsx44(RefusalNotice, { error: table.error, onRetry: table.reload, className });
14179
+ if (fields.error) return /* @__PURE__ */ jsx44(RefusalNotice, { error: fields.error, onRetry: fields.reload, className });
14180
14180
  const nothingToShowYet = table.loading && !table.data || // No columns on a table whose level may hide them: not yet known which (one read, Confidential only).
14181
14181
  !structure.settled && (fields.data ?? []).length === 0 || fields.loading && !fields.data || !rights.known || rowRightsWaiting || records.loading && rows.length === 0 || // The page read has neither answered nor refused: nothing has been said yet, so nothing is empty.
14182
14182
  !records.data && !records.error || countedButNotReturned || manual && hand.loading && rows.length === 0;
@@ -14217,7 +14217,7 @@ function GridBody({
14217
14217
  } : {},
14218
14218
  children: [
14219
14219
  toolbarActions ? /* @__PURE__ */ jsx44("div", { className: "flex items-center gap-2", "data-records-grid-actions": "", children: /* @__PURE__ */ jsx44("div", { className: "ml-auto flex items-center gap-1", children: toolbarActions }) }) : null,
14220
- records.error ? /* @__PURE__ */ jsx44(RefusalNotice, { error: inColumnWords(records.error, fields.data ?? []) }) : null,
14220
+ records.error ? /* @__PURE__ */ jsx44(RefusalNotice, { error: inColumnWords(records.error, fields.data ?? []), onRetry: records.reload }) : null,
14221
14221
  manual && hand.error ? /* @__PURE__ */ jsx44(RefusalNotice, { error: hand.error }) : null,
14222
14222
  archived ? /* @__PURE__ */ jsxs39(
14223
14223
  "p",
@@ -15419,7 +15419,7 @@ function Peek({ tableId, recordId, onClose, className, onPage = false }) {
15419
15419
  if (fields.data) rememberRowCount(peekMemoryKey, shownFieldCount);
15420
15420
  }, [fields.data, peekMemoryKey, shownFieldCount]);
15421
15421
  if (record.error) return /* @__PURE__ */ jsx51(RefusalNotice, { error: record.error, className });
15422
- if (fields.error) return /* @__PURE__ */ jsx51(RefusalNotice, { error: fields.error, className });
15422
+ if (fields.error) return /* @__PURE__ */ jsx51(RefusalNotice, { error: fields.error, onRetry: fields.reload, className });
15423
15423
  const document2 = record.data?.document;
15424
15424
  if (document2 && isLockedStub({ document: document2, level: null })) {
15425
15425
  const filed = document2["submitted_at"];
@@ -16774,7 +16774,7 @@ function ChecklistRunner({
16774
16774
  () => runs?.find((r) => r.run_id === activeId) ?? null,
16775
16775
  [runs, activeId]
16776
16776
  );
16777
- if (table.error) return /* @__PURE__ */ jsx57(RefusalNotice, { error: table.error, className });
16777
+ if (table.error) return /* @__PURE__ */ jsx57(RefusalNotice, { error: table.error, onRetry: table.reload, className });
16778
16778
  if (quietWhenEmpty && !runId) {
16779
16779
  const startable = mayStart && rights.write && (templates?.length ?? 0) > 0;
16780
16780
  if (runs === null || runs.length === 0 && !startable && !error && !said) return null;
@@ -19396,8 +19396,8 @@ function TableSettingsPanel({
19396
19396
  const [deliberate, setDeliberate] = useState64(null);
19397
19397
  const [askingToRemove, setAskingToRemove] = useState64(null);
19398
19398
  const [enriching, setEnriching] = useState64(null);
19399
- if (table.error) return /* @__PURE__ */ jsx70(RefusalNotice, { error: table.error, className });
19400
- if (fields.error) return /* @__PURE__ */ jsx70(RefusalNotice, { error: fields.error, className });
19399
+ if (table.error) return /* @__PURE__ */ jsx70(RefusalNotice, { error: table.error, onRetry: table.reload, className });
19400
+ if (fields.error) return /* @__PURE__ */ jsx70(RefusalNotice, { error: fields.error, onRetry: fields.reload, className });
19401
19401
  if (!rights.structure) {
19402
19402
  if (tableIsLocked(table.data)) {
19403
19403
  return /* @__PURE__ */ jsxs64("div", { className: cn29("flex flex-col items-start gap-2 text-xs text-muted-foreground", className), "data-table-locked": "", children: [
@@ -20282,7 +20282,7 @@ function PipelineBoard({
20282
20282
  onMoved?.();
20283
20283
  void reload();
20284
20284
  };
20285
- if (fields.error) return /* @__PURE__ */ jsx73(RefusalNotice, { error: fields.error });
20285
+ if (fields.error) return /* @__PURE__ */ jsx73(RefusalNotice, { error: fields.error, onRetry: fields.reload });
20286
20286
  if (error) return /* @__PURE__ */ jsx73(RefusalNotice, { error });
20287
20287
  if (loading || fields.loading && !fields.data) return /* @__PURE__ */ jsx73(Skeleton16, { className: "h-40 w-full" });
20288
20288
  if (!definition?.is_pipeline) {
@@ -23036,8 +23036,14 @@ function ViewNeeds({ layout, tableId, fields, onMade, className }) {
23036
23036
  const choices = options.map((o) => o.trim()).filter((o) => o !== "");
23037
23037
  const suggestion = need.ask(name, choices);
23038
23038
  const make = async () => {
23039
+ const retrying = refused !== null || mutation.error !== null;
23039
23040
  setRefused(null);
23040
- const made = pendingId ?? await mutation.declare({
23041
+ let already = null;
23042
+ if (retrying && !pendingId) {
23043
+ const now = await client.fields({ table_id: tableId });
23044
+ if (now.ok) already = now.data.find((f) => fieldName(f) === name && !fields.some((g) => g.id === f.id))?.id ?? null;
23045
+ }
23046
+ const made = pendingId ?? already ?? await mutation.declare({
23041
23047
  table_id: tableId,
23042
23048
  spec: columnDeclarationFor(need, name, choices, fields)
23043
23049
  });
@@ -23117,8 +23123,8 @@ function ViewNeeds({ layout, tableId, fields, onMade, className }) {
23117
23123
  children: rights.structure ? `${need.missing} ${need.does(name)}` : need.missing
23118
23124
  }
23119
23125
  ),
23120
- mutation.error ? /* @__PURE__ */ jsx77(RefusalNotice, { error: mutation.error }) : null,
23121
- refused ? /* @__PURE__ */ jsx77(RefusalNotice, { error: refused }) : null,
23126
+ mutation.error ? /* @__PURE__ */ jsx77(RefusalNotice, { error: mutation.error, onRetry: rights.structure ? () => void make() : void 0 }) : null,
23127
+ refused ? /* @__PURE__ */ jsx77(RefusalNotice, { error: refused, onRetry: rights.structure ? () => void make() : void 0 }) : null,
23122
23128
  pendingId ? /* @__PURE__ */ jsx77("p", { className: "mt-2 text-xs text-muted-foreground", children: "The column was accepted but the table does not show it yet. Press Make it work again to look for it \u2014 it will not be added twice." }) : null
23123
23129
  ] });
23124
23130
  }
@@ -26295,8 +26301,8 @@ function Board({
26295
26301
  tableId: view.subject,
26296
26302
  needed: viewQuestionAsked && !records.loading && records.rows.length === 0
26297
26303
  });
26298
- if (fields.error) return /* @__PURE__ */ jsx88(RefusalNotice, { error: fields.error });
26299
- if (records.error) return /* @__PURE__ */ jsx88(RefusalNotice, { error: records.error });
26304
+ if (fields.error) return /* @__PURE__ */ jsx88(RefusalNotice, { error: fields.error, onRetry: fields.reload });
26305
+ if (records.error) return /* @__PURE__ */ jsx88(RefusalNotice, { error: records.error, onRetry: records.reload });
26300
26306
  if (fields.loading && !fields.data || records.loading && records.rows.length === 0) return /* @__PURE__ */ jsx88(RecordsSkeleton, { layout: view.layout });
26301
26307
  const all = fields.data ?? [];
26302
26308
  const byKey = (key) => all.find((f) => f.key === key);
@@ -31867,7 +31873,7 @@ function ConnectedFormRunner(props) {
31867
31873
  },
31868
31874
  [client, form.subject, form.questions, form.endings]
31869
31875
  );
31870
- if (fields.error) return /* @__PURE__ */ jsx104(RefusalNotice, { error: fields.error, className });
31876
+ if (fields.error) return /* @__PURE__ */ jsx104(RefusalNotice, { error: fields.error, onRetry: fields.reload, className });
31871
31877
  if (fields.loading && !fields.data) return /* @__PURE__ */ jsx104(Skeleton28, { className: cn54("h-40 w-full", className) });
31872
31878
  return /* @__PURE__ */ jsx104(
31873
31879
  FormStage,
@@ -32763,7 +32769,7 @@ function FormBuilder({ tableId, seed, activeFormId, onActiveForm, startWithOne,
32763
32769
  (made) => setMakeOnMount(made ? "made" : "not-made")
32764
32770
  );
32765
32771
  }, [createOnMount, makeOnMount, forms, fields.data, create, table.data, table.error]);
32766
- if (fields.error) return /* @__PURE__ */ jsx105(RefusalNotice, { error: fields.error, className });
32772
+ if (fields.error) return /* @__PURE__ */ jsx105(RefusalNotice, { error: fields.error, onRetry: fields.reload, className });
32767
32773
  if (error) {
32768
32774
  return /* @__PURE__ */ jsx105(
32769
32775
  RefusalNotice,
@@ -33640,7 +33646,7 @@ function SignBlock({ tableId, recordId, render, className }) {
33640
33646
  setName("");
33641
33647
  await load();
33642
33648
  }
33643
- if (fields.error) return /* @__PURE__ */ jsx107(RefusalNotice, { error: fields.error, className });
33649
+ if (fields.error) return /* @__PURE__ */ jsx107(RefusalNotice, { error: fields.error, onRetry: fields.reload, className });
33644
33650
  if (error) {
33645
33651
  return /* @__PURE__ */ jsx107(
33646
33652
  RefusalNotice,
@@ -38592,8 +38598,8 @@ function AdHocCaptureSheet({
38592
38598
  await keep([...queue.current, item]);
38593
38599
  await flush();
38594
38600
  }
38595
- if (table.error) return /* @__PURE__ */ jsx119(RefusalNotice, { error: table.error, className });
38596
- if (fields.error) return /* @__PURE__ */ jsx119(RefusalNotice, { error: fields.error, className });
38601
+ if (table.error) return /* @__PURE__ */ jsx119(RefusalNotice, { error: table.error, onRetry: table.reload, className });
38602
+ if (fields.error) return /* @__PURE__ */ jsx119(RefusalNotice, { error: fields.error, onRetry: fields.reload, className });
38597
38603
  if (fields.loading || pending === null) return /* @__PURE__ */ jsx119(Skeleton41, { className: cn67("h-64 w-full", className) });
38598
38604
  const keys = resolved();
38599
38605
  return /* @__PURE__ */ jsxs112("section", { className: cn67("mx-auto flex w-full max-w-sm flex-col gap-2", className), children: [
@@ -38961,7 +38967,7 @@ function EmbedFrame({
38961
38967
  setSecret(null);
38962
38968
  setTokenId(null);
38963
38969
  }, [client, tokenId]);
38964
- if (table.error) return /* @__PURE__ */ jsx122(RefusalNotice, { error: table.error, className });
38970
+ if (table.error) return /* @__PURE__ */ jsx122(RefusalNotice, { error: table.error, onRetry: table.reload, className });
38965
38971
  if (table.loading && !table.data) return /* @__PURE__ */ jsx122(Skeleton44, { className: cn70("h-48 w-full", className) });
38966
38972
  if (!rights.admin) {
38967
38973
  return /* @__PURE__ */ jsxs115("p", { className: cn70("rounded border border-dashed px-2 py-1 text-xs text-muted-foreground", className), children: [
@@ -41199,7 +41205,7 @@ function TablePage({
41199
41205
  const headerNode = header && !embedded ? header({ actions: table.data ? pageActions : null, tableName: table.data?.name ?? null }) : null;
41200
41206
  if (table.error) return /* @__PURE__ */ jsxs124(Fragment57, { children: [
41201
41207
  headerNode,
41202
- /* @__PURE__ */ jsx131(RefusalNotice, { error: table.error })
41208
+ /* @__PURE__ */ jsx131(RefusalNotice, { error: table.error, onRetry: table.reload })
41203
41209
  ] });
41204
41210
  if (table.loading && !table.data) {
41205
41211
  return /* @__PURE__ */ jsxs124(Fragment57, { children: [