@ai-matrx/records-ui 0.3.2 → 0.4.3

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,36 @@
1
1
  # Changelog — @ai-matrx/records-ui
2
2
 
3
+ ## 0.4.3
4
+
5
+ Resets the harness-owned demo table through the store's real read and delete
6
+ doors before a certification run. Repeated releases can no longer push the
7
+ three canonical Grid rows beyond the first page. The demo port is also
8
+ configurable for isolated local proof while remaining `3005` by default.
9
+
10
+ ### Consumer action
11
+
12
+ None. The public package API is unchanged.
13
+
14
+ ## 0.4.2
15
+
16
+ Uses the same bounded live-store wait as `@ai-matrx/records`, so a legitimate
17
+ overlapping rollback-only verification cannot make the demo proof fail after
18
+ twenty seconds.
19
+
20
+ ### Consumer action
21
+
22
+ None beyond taking `latest`; the public API is unchanged.
23
+
24
+ ## 0.4.1
25
+
26
+ Restores monotonic versioning after a concurrent release plan overwrote the
27
+ already-staged 0.4.0 version, and shares the serialized record-store release
28
+ lane with `@ai-matrx/records`.
29
+
30
+ ### Consumer action
31
+
32
+ None beyond taking `latest`; the 0.4.0 API remains intact.
33
+
3
34
  ## 0.3.2
4
35
 
5
36
  Automatic changed-only republish (docs/metadata drift since the last tag — see
@@ -28,6 +59,33 @@ table page's records plus its five admin rails, with the settings rail really
28
59
  opening the panel; and the same page giving a plain member the records and NONE
29
60
  of the administering controls — absent, not disabled.
30
61
 
62
+ **THE WALK, and the three defects walking it found.** `demo/walk.test.tsx` runs
63
+ the whole product against the live store in one file — declare a table with three
64
+ field types, write a record through the generated form, open the table page and
65
+ peek the record, save a view, file an agent's field proposal and accept it,
66
+ export the CSV, then walk the same table as a plain member and be offered nothing
67
+ to administer. Seven cases, green, and the table it makes is soft-deleted after.
68
+ It found:
69
+
70
+ · **A table nobody had saved a view for showed NO RECORDS.** A view is a record,
71
+ so a brand-new table has none, and `TablePage` then rendered its own honest
72
+ "Waiting for this table's views" and nothing else — a dead end on the first
73
+ table anybody makes. The page now seeds `DEFAULT_VIEW_NAME` ("All records",
74
+ grid), an ordinary saved-view record a person can rename or delete, never a
75
+ hidden built-in mode. A host with its own idea passes `seedViews`.
76
+
77
+ · **`ProposedChange.table` was required for all three acts and unfillable for
78
+ two.** `update` and `remove` name a record and ignore `table`, so a proposer
79
+ wanting to change an existing record had to supply the id of the kernel Table
80
+ that record lives in — a fact the client has no door to ask for. It is optional
81
+ now, and an `add` without it is refused by name instead of writing nowhere.
82
+
83
+ · **The demo harness's pages were dead in a browser while `pnpm test` was
84
+ green.** Two copies of React in one vite graph (the demo's own dependency tree
85
+ plus the workspace's, through design-system and alchemy): React reported
86
+ "Invalid hook call … more than one copy of React" and the page rendered
87
+ nothing. `demo/vite.config.ts` now dedupes react and react-dom.
88
+
31
89
  **Consumer action:** none. `recordsDataSource(client)` is unchanged at the call
32
90
  site; a host that deliberately wants a different fallback passes it second.
33
91
 
package/dist/index.cjs CHANGED
@@ -2190,6 +2190,12 @@ function ProposalRow({
2190
2190
  const [confirming, setConfirming] = (0, import_react32.useState)(false);
2191
2191
  async function applyThroughTheStore() {
2192
2192
  if (change.act === "add") {
2193
+ if (!change.table) {
2194
+ return {
2195
+ settled: "refused",
2196
+ sentence: "This proposal asks to add a record but does not name the table it goes in, so nothing was written."
2197
+ };
2198
+ }
2193
2199
  const written = await client.recordWrite({ table_id: change.table, data: change.data ?? {} });
2194
2200
  return written.ok ? { settled: "accepted", sentence: "Written." } : { settled: "refused", sentence: written.error.message };
2195
2201
  }
@@ -5895,7 +5901,11 @@ var import_react77 = require("react");
5895
5901
  var import_react78 = require("@ai-matrx/records/react");
5896
5902
  var import_design_system36 = require("@ai-matrx/design-system");
5897
5903
  var import_jsx_runtime38 = require("react/jsx-runtime");
5898
- function TablePage({ tableId, pageSize = 100, className }) {
5904
+ var DEFAULT_VIEW_NAME = "All records";
5905
+ function defaultView(tableId) {
5906
+ return { name: DEFAULT_VIEW_NAME, subject: tableId, layout: "grid", isDefault: true };
5907
+ }
5908
+ function TablePage({ tableId, pageSize = 100, seedViews, className }) {
5899
5909
  const table = (0, import_react78.useTable)(tableId);
5900
5910
  const rights = useTableRights(table.data);
5901
5911
  const [view, setView] = (0, import_react77.useState)(null);
@@ -5907,7 +5917,15 @@ function TablePage({ tableId, pageSize = 100, className }) {
5907
5917
  return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: (0, import_design_system36.cn)("flex min-h-0 gap-4", className), children: [
5908
5918
  /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "flex min-w-0 flex-1 flex-col gap-2", children: [
5909
5919
  /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "flex flex-wrap items-center gap-1.5", children: [
5910
- /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(ViewBar, { tableId, onActiveView: setView, className: "min-w-0 flex-1" }),
5920
+ /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
5921
+ ViewBar,
5922
+ {
5923
+ tableId,
5924
+ onActiveView: setView,
5925
+ seed: seedViews ?? [defaultView(tableId)],
5926
+ className: "min-w-0 flex-1"
5927
+ }
5928
+ ),
5911
5929
  rights.write ? /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_design_system36.Button, { size: "sm", onClick: () => show("new-record"), children: "New record" }) : null,
5912
5930
  rights.admin ? /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(import_jsx_runtime38.Fragment, { children: [
5913
5931
  /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_design_system36.Button, { size: "sm", variant: "outline", onClick: () => show("field"), children: "Add field" }),