@ai-matrx/records-ui 0.115.68 → 0.115.69

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,11 @@
1
1
  # Changelog — @ai-matrx/records-ui
2
2
 
3
+ ## 0.115.69
4
+
5
+ Automatic changed-only republish (docs/metadata drift since the last tag — see
6
+ `git diff npm/records-ui/v0.115.68..npm/records-ui/v0.115.69 -- apps/shared/records-ui`).
7
+ No source changes intended and no consumer action required.
8
+
3
9
  ## 0.115.68
4
10
 
5
11
  Automatic changed-only republish (docs/metadata drift since the last tag — see
package/dist/index.cjs CHANGED
@@ -28630,7 +28630,8 @@ var import_design_system85 = require("@ai-matrx/design-system");
28630
28630
 
28631
28631
  // src/unfinishedTable.ts
28632
28632
  var UNFINISHED_WINDOW_MS = 24 * 60 * 60 * 1e3;
28633
- async function findUnfinishedTable(client, wantedName, wantedKeys, now = Date.now()) {
28633
+ var FILLED_WINDOW_MS = 15 * 60 * 1e3;
28634
+ async function findUnfinishedTable(client, wantedName, wantedKeys, wantedRows, now = Date.now()) {
28634
28635
  const name = wantedName.trim().toLowerCase();
28635
28636
  if (!name) return null;
28636
28637
  const listed = await client.tableList();
@@ -28648,11 +28649,12 @@ async function findUnfinishedTable(client, wantedName, wantedKeys, now = Date.no
28648
28649
  if (candidates.length === 0) return null;
28649
28650
  const counted = await client.tableRowCounts({ table_ids: candidates.map((t) => t.id) });
28650
28651
  if (!counted.ok) return null;
28651
- const withRows = new Set(counted.data.filter((c) => c.visible_rows > 0).map((c) => c.table_id));
28652
+ const rowsOf2 = new Map(counted.data.map((c) => [c.table_id, c.visible_rows]));
28652
28653
  const wanted = new Set(wantedKeys);
28653
28654
  const ordered = [...candidates].sort((a, b) => (madeAt.get(b.id) ?? 0) - (madeAt.get(a.id) ?? 0));
28654
28655
  for (const t of ordered) {
28655
- if (withRows.has(t.id)) continue;
28656
+ const rows = rowsOf2.get(t.id) ?? 0;
28657
+ if (rows > 0 && (rows > wantedRows || now - (madeAt.get(t.id) ?? 0) > FILLED_WINDOW_MS)) continue;
28656
28658
  const read = await client.fields({ table_id: t.id });
28657
28659
  if (!read.ok) continue;
28658
28660
  const have = new Set(read.data.map((f) => f.key));
@@ -30877,7 +30879,7 @@ function SaveToTable({ source, shapeIndex = 0, onOpenTable, onSaved, onClose, ma
30877
30879
  });
30878
30880
  setPhase("making");
30879
30881
  try {
30880
- const earlier = await findUnfinishedTable(client, name ?? proposedName, fields.map((f) => f.key));
30882
+ const earlier = await findUnfinishedTable(client, name ?? proposedName, fields.map((f) => f.key), rows.length);
30881
30883
  let tableName2;
30882
30884
  let newId;
30883
30885
  if (earlier) {