@ai-matrx/records-ui 0.90.1 → 0.90.2

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
@@ -1,5 +1,18 @@
1
1
  # Changelog — @ai-matrx/records-ui
2
2
 
3
+ ## 0.90.2
4
+ ### Unreleased
5
+
6
+ ### Changed — a removal says it can be restored from Trash (lane STORE-RESTORE-DOORS, 2026-09-26)
7
+ - Removing a column (`FieldEditor`, `TableSettings`) confirms with the shared `archiveConfirmSentence`
8
+ plus "Its values stay in every record and come back with it." — the store now brings a removed Field
9
+ back from Trash with its values (`custom.field_restore`); the old copy said the values lived only in history.
10
+ - `DashboardCanvas`: removing a dashboard takes a second press with the same sentence (it was one press
11
+ labelled "Delete"); it comes back from Trash through `custom.dashboard_restore`.
12
+ - `NotifyRuleEditor`: "Stop telling me" archives the subscription's Rule and now asks once, naming Trash
13
+ (`custom.rule_restore`).
14
+ - Consumer action: none.
15
+
3
16
  ## 0.90.1 (2026-09-26 — merged grid 6n/6o live-walk fixes; needs @ai-matrx/design-system 0.44.3)
4
17
 
5
18
  - **The header's "+" is a button of its own, not a button inside the column-reorder button**
package/dist/index.cjs CHANGED
@@ -5351,9 +5351,8 @@ function FieldEditor({ tableId, field: field2, onSaved, onCancel, onRemoved, cla
5351
5351
  onCancel ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_design_system17.Button, { size: "sm", variant: "ghost", onClick: onCancel, children: "Cancel" }) : null,
5352
5352
  field2 ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "ml-auto flex items-center gap-2", children: askingToRemove ? /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_jsx_runtime21.Fragment, { children: [
5353
5353
  /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("span", { className: "text-destructive", children: [
5354
- "Removing ",
5355
- fieldName(field2),
5356
- " takes it off every record of this table. The values stay in the record's history and nothing else is deleted."
5354
+ archiveConfirmSentence(`the field \u201C${fieldName(field2)}\u201D`),
5355
+ " Its values stay in every record and come back with it."
5357
5356
  ] }),
5358
5357
  /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_design_system17.Button, { size: "sm", variant: "destructive", disabled: mutation.saving, onClick: () => void remove(), children: "Remove it" }),
5359
5358
  /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_design_system17.Button, { size: "sm", variant: "ghost", onClick: () => setAskingToRemove(false), children: "Keep it" })
@@ -13749,9 +13748,8 @@ function TableSettings({
13749
13748
  shape.error ? /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(RefusalNotice, { error: shape.error }) : null,
13750
13749
  askingToRemove ? /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { className: "flex flex-wrap items-center gap-2 rounded border border-destructive/40 px-2 py-1.5", children: [
13751
13750
  /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("span", { className: "text-destructive", children: [
13752
- "Removing ",
13753
- fieldName(askingToRemove),
13754
- " takes it off every record of this table. The values stay in each record's history and nothing else is deleted."
13751
+ archiveConfirmSentence(`the field \u201C${fieldName(askingToRemove)}\u201D`),
13752
+ " Its values stay in every record and come back with it."
13755
13753
  ] }),
13756
13754
  /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
13757
13755
  import_design_system41.Button,
@@ -21439,6 +21437,7 @@ function NotifyRuleEditor({ tableId, seed, chosenRuleId, onChoose, className })
21439
21437
  const [views, setViews] = (0, import_react126.useState)(null);
21440
21438
  const [error, setError] = (0, import_react126.useState)(null);
21441
21439
  const [busy, setBusy] = (0, import_react126.useState)(false);
21440
+ const [stopping, setStopping] = (0, import_react126.useState)(null);
21442
21441
  const load = (0, import_react126.useCallback)(async () => {
21443
21442
  const [held, offered] = await Promise.all([
21444
21443
  // THE PERSON'S OWN DOOR, not the notifier's. It answers what is addressed
@@ -21535,6 +21534,7 @@ function NotifyRuleEditor({ tableId, seed, chosenRuleId, onChoose, className })
21535
21534
  await load();
21536
21535
  }
21537
21536
  async function unsubscribe(ruleId) {
21537
+ setStopping(null);
21538
21538
  setBusy(true);
21539
21539
  const deleted = await client.recordDelete({ record_id: ruleId });
21540
21540
  setBusy(false);
@@ -21596,14 +21596,18 @@ function NotifyRuleEditor({ tableId, seed, chosenRuleId, onChoose, className })
21596
21596
  children: "Use for this form"
21597
21597
  }
21598
21598
  ) : null,
21599
- rights.write && !(onChoose && held.rule_id === chosenRuleId) ? /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(
21599
+ rights.write && !(onChoose && held.rule_id === chosenRuleId) && stopping === held.rule_id ? /* @__PURE__ */ (0, import_jsx_runtime73.jsxs)("span", { className: (0, import_design_system65.cn)("flex flex-wrap items-center gap-2", onChoose ? void 0 : "ml-auto"), children: [
21600
+ /* @__PURE__ */ (0, import_jsx_runtime73.jsx)("span", { className: "text-xs text-destructive", children: archiveConfirmSentence("this subscription") }),
21601
+ /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(import_design_system65.Button, { size: "sm", variant: "destructive", disabled: busy, onClick: () => void unsubscribe(held.rule_id), children: "Stop telling me" }),
21602
+ /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(import_design_system65.Button, { size: "sm", variant: "ghost", onClick: () => setStopping(null), children: "Keep it" })
21603
+ ] }) : rights.write && !(onChoose && held.rule_id === chosenRuleId) ? /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(
21600
21604
  import_design_system65.Button,
21601
21605
  {
21602
21606
  size: "sm",
21603
21607
  variant: "ghost",
21604
21608
  className: onChoose ? void 0 : "ml-auto",
21605
21609
  disabled: busy,
21606
- onClick: () => void unsubscribe(held.rule_id),
21610
+ onClick: () => setStopping(held.rule_id),
21607
21611
  children: "Stop telling me"
21608
21612
  }
21609
21613
  ) : null
@@ -23339,6 +23343,7 @@ function DashboardCanvas({ tableId, activeDashboardId, filter, className }) {
23339
23343
  const [boards, setBoards] = (0, import_react139.useState)(null);
23340
23344
  const [error, setError] = (0, import_react139.useState)(null);
23341
23345
  const [activeId, setActiveId] = (0, import_react139.useState)(activeDashboardId ?? null);
23346
+ const [askingToRemove, setAskingToRemove] = (0, import_react139.useState)(null);
23342
23347
  const [run, setRun] = (0, import_react139.useState)(null);
23343
23348
  const [running, setRunning] = (0, import_react139.useState)(false);
23344
23349
  const [question, setQuestion] = (0, import_react139.useState)("");
@@ -23449,6 +23454,7 @@ function DashboardCanvas({ tableId, activeDashboardId, filter, className }) {
23449
23454
  else setError(again.error);
23450
23455
  }, [client, activeId, filter, grain]);
23451
23456
  async function remove(target) {
23457
+ setAskingToRemove(null);
23452
23458
  const gone = await client.dashboardDelete({ dashboard_id: target.id });
23453
23459
  if (!gone.ok) {
23454
23460
  setError(gone.error);
@@ -23537,7 +23543,11 @@ function DashboardCanvas({ tableId, activeDashboardId, filter, className }) {
23537
23543
  children: scheduling ? "Done" : "Send on a schedule"
23538
23544
  }
23539
23545
  ),
23540
- rights.admin ? /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(import_design_system72.Button, { size: "sm", variant: "ghost", onClick: () => void remove(board), children: "Delete" }) : null
23546
+ rights.admin && askingToRemove === board.id ? /* @__PURE__ */ (0, import_jsx_runtime80.jsxs)(import_jsx_runtime80.Fragment, { children: [
23547
+ /* @__PURE__ */ (0, import_jsx_runtime80.jsx)("span", { className: "text-xs text-destructive", children: archiveConfirmSentence(`the dashboard \u201C${board.name}\u201D`) }),
23548
+ /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(import_design_system72.Button, { size: "sm", variant: "destructive", onClick: () => void remove(board), children: "Remove it" }),
23549
+ /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(import_design_system72.Button, { size: "sm", variant: "ghost", onClick: () => setAskingToRemove(null), children: "Keep it" })
23550
+ ] }) : rights.admin ? /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(import_design_system72.Button, { size: "sm", variant: "ghost", onClick: () => setAskingToRemove(board.id), children: "Remove" }) : null
23541
23551
  ] }) : null
23542
23552
  ] }),
23543
23553
  board && scheduling ? (