@ai-matrx/records-ui 0.115.103 → 0.115.104

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,10 +1,31 @@
1
1
  # Changelog — @ai-matrx/records-ui
2
2
 
3
+ ## 0.115.104
4
+
5
+ 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.
6
+ Check the package's gitHead on npm against this version's gitHead: `git diff <previous gitHead> <this gitHead> -- apps/shared/records-ui/src`.
7
+
3
8
  ## 0.115.103
4
9
  ### Unreleased
5
10
 
11
+ - A long-text value shows without the blank lines and spaces ahead of its first word (they read as a large leading indent on a record page); inner lines and indents stay. The structured-value table of like records lets its cells wrap, so the last column is no longer pushed behind a horizontal scroll. Consumer action: none.
12
+
13
+ - A button's popover shows an agent step's answer as its text (an object with more than text goes through the structured-value renderer), never raw `{"text": ...}` JSON. The table page's toolbar slot never wraps its text, so a narrow phone row keeps its one-line height from first paint (layout shift on `/data/<table>` at 390px). Consumer action: none.
14
+
6
15
  - The `/helpers` light door now reads the field-kind vocabulary from `@ai-matrx/records/core` (which it already imported) instead of the package root, so a page that reaches `/helpers` no longer carries a second copy of the root store code. No API change. Consumer action: none.
7
16
 
17
+ ## 0.115.102
18
+
19
+ SOURCE CHANGED WITH NO RELEASE NOTE. This release shipped source changes that nobody described in an Unreleased entry,
20
+ so they may include breaking API changes. Consumer action is UNKNOWN: read the diff before upgrading.
21
+ Diff: `git diff 0840b10e27 e2c67ae47c -- apps/shared/records-ui/src`
22
+
23
+ Changed shipped source files (4):
24
+ - `apps/shared/records-ui/src/Grid.tsx`
25
+ - `apps/shared/records-ui/src/PageCanvas.tsx`
26
+ - `apps/shared/records-ui/src/RecordPanel.tsx`
27
+ - `apps/shared/records-ui/src/toolbarFit.ts`
28
+
8
29
  ## 0.115.101
9
30
 
10
31
  SOURCE CHANGED WITH NO RELEASE NOTE. This release shipped source changes that nobody described in an Unreleased entry,
package/dist/index.cjs CHANGED
@@ -12525,6 +12525,11 @@ var import_design_system41 = require("@ai-matrx/design-system");
12525
12525
  var import_react70 = require("@ai-matrx/records/react");
12526
12526
  init_Refusal();
12527
12527
 
12528
+ // src/leadingBlank.ts
12529
+ function withoutLeadingBlank(text) {
12530
+ return text.replace(/^\s+/, "");
12531
+ }
12532
+
12528
12533
  // src/values.tsx
12529
12534
  init_personChip();
12530
12535
  var import_data_table4 = require("@ai-matrx/design-system/data-table");
@@ -14194,9 +14199,9 @@ function RecordsTable({ items }) {
14194
14199
  const pictureFirst = [...keys].sort((a, b) => rank(a, items) - rank(b, items)).slice(0, TABLE_COLUMNS);
14195
14200
  const shown5 = all ? items : items.slice(0, TABLE_ROWS);
14196
14201
  return /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("div", { className: "min-w-0", "data-records-structured": "table", children: [
14197
- /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("div", { className: "max-w-full overflow-x-auto rounded-md border border-border", children: /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("table", { className: "w-full border-collapse text-xs", children: [
14202
+ /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("div", { className: "max-w-full overflow-x-auto rounded-md border border-border", "data-records-structured-table-frame": "", children: /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("table", { className: "w-full border-collapse text-xs", children: [
14198
14203
  /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("thead", { className: "bg-muted/60 text-left", children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("tr", { children: pictureFirst.map((k) => /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("th", { scope: "col", className: "whitespace-nowrap px-2 py-1 font-medium text-muted-foreground", children: keyWords(k) }, k)) }) }),
14199
- /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("tbody", { children: shown5.map((item, i) => /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("tr", { className: "border-t border-border/60 align-top", children: pictureFirst.map((k) => /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("td", { className: "min-w-[7rem] max-w-[18rem] px-2 py-1", children: k in item ? /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(Nested, { value: item[k], keyName: k, dense: true }) : /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("span", { className: "text-muted-foreground", children: "\u2014" }) }, k)) }, i)) })
14204
+ /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("tbody", { children: shown5.map((item, i) => /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("tr", { className: "border-t border-border/60 align-top", children: pictureFirst.map((k) => /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("td", { className: "min-w-[4rem] max-w-[18rem] break-words px-2 py-1 [overflow-wrap:anywhere]", children: k in item ? /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(Nested, { value: item[k], keyName: k, dense: true }) : /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("span", { className: "text-muted-foreground", children: "\u2014" }) }, k)) }, i)) })
14200
14205
  ] }) }),
14201
14206
  items.length > TABLE_ROWS ? /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_design_system39.Button, { type: "button", variant: "ghost", size: "sm", className: "mt-1 h-6 px-2 text-xs", onClick: (e) => {
14202
14207
  stop(e);
@@ -14607,7 +14612,7 @@ function scalarText(field2, value, labels, stillWaitingFor) {
14607
14612
  }
14608
14613
  if (Array.isArray(value)) return value.length === 0 ? "" : structuredSummary(value);
14609
14614
  if (typeof value === "object") return structuredOf(value) ? structuredSummary(value) : "\u2026";
14610
- return String(value);
14615
+ return typeof value === "string" ? withoutLeadingBlank(value) : String(value);
14611
14616
  }
14612
14617
  function ProvenanceBadge({ document: document2, fieldKey }) {
14613
14618
  const envelope = envelopeFor(document2, fieldKey);
@@ -14657,7 +14662,7 @@ function RecordValue({
14657
14662
  }
14658
14663
  if (inCell && ui.grid === "merged" && ui.renderText && typeof value === "string" && value.trim() !== "" && editorKindFor(field2) === "long_text" && !shownAsOf(field2) && !(0, import_core16.wholeValueOf)(document2, field2.key) && !envelopeFor(document2, field2.key)?.absent && // A long-text cell holding a kind is drawn by the kind system below, not as markdown.
14659
14664
  !kindValueOf(value)) {
14660
- return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("span", { className: "block h-[1.5em] min-w-0 overflow-hidden whitespace-normal [[data-matrx-cell-lines]:not([data-matrx-cell-lines=one])_&]:h-auto", "data-records-cell-text": "", children: ui.renderText(value, "cell") });
14665
+ return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("span", { className: "block h-[1.5em] min-w-0 overflow-hidden whitespace-normal [[data-matrx-cell-lines]:not([data-matrx-cell-lines=one])_&]:h-auto", "data-records-cell-text": "", children: ui.renderText(withoutLeadingBlank(value), "cell") });
14661
14666
  }
14662
14667
  if (isSignatureField(field2) && value !== null && value !== void 0 && value !== "") {
14663
14668
  return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(SignatureValue, { value, inCell, recordId, fieldKey: field2.key, document: document2 });
@@ -17468,12 +17473,39 @@ function buttonPressWords(label, pressed) {
17468
17473
  }
17469
17474
  var POLL_EVERY_MS = 1200;
17470
17475
  var POLL_FOR_MS = 12e4;
17471
- function runAnswerWords(label, run) {
17476
+ var RUN_BOOKKEEPING = /* @__PURE__ */ new Set(["run_id", "conversation_id"]);
17477
+ function answerOf(output) {
17478
+ const raw = (output ?? "").trim();
17479
+ if (raw === "") return { words: "" };
17480
+ let parsed;
17481
+ try {
17482
+ parsed = JSON.parse(raw);
17483
+ } catch {
17484
+ return { words: raw };
17485
+ }
17486
+ if (typeof parsed === "string") return { words: parsed.trim() };
17487
+ if (typeof parsed === "object" && parsed !== null && !Array.isArray(parsed)) {
17488
+ const shown5 = Object.fromEntries(Object.entries(parsed).filter(([k]) => !RUN_BOOKKEEPING.has(k)));
17489
+ const keys = Object.keys(shown5);
17490
+ if (keys.length === 1 && typeof shown5.text === "string") return { words: shown5.text.trim() };
17491
+ const value2 = structuredOf(shown5);
17492
+ return value2 ? { words: "", value: value2 } : { words: raw };
17493
+ }
17494
+ const value = structuredOf(parsed);
17495
+ return value ? { words: "", value } : { words: raw };
17496
+ }
17497
+ function runAnswer(label, run) {
17472
17498
  const steps = run.steps ?? [];
17473
17499
  const failedStep = [...steps].reverse().find((s) => s.status === "failed");
17474
- if (run.status === "failed") return [failedStep?.output_text ?? failedStep?.says, run.says].filter((t, i, all) => t && all.indexOf(t) === i).join(" ") || `${label} failed.`;
17475
- const answered = [...steps].reverse().find((s) => s.output_text && s.output_text.trim() !== "");
17476
- return answered?.output_text?.trim() || run.says || `${label} ran.`;
17500
+ if (run.status === "failed") {
17501
+ const failed = answerOf(failedStep?.output_text).words || failedStep?.says;
17502
+ return { words: [failed, run.says].filter((t, i, all) => t && all.indexOf(t) === i).join(" ") || `${label} failed.` };
17503
+ }
17504
+ for (const step2 of [...steps].reverse()) {
17505
+ const answered = answerOf(step2.output_text);
17506
+ if (answered.words !== "" || answered.value) return answered;
17507
+ }
17508
+ return { words: run.says || `${label} ran.` };
17477
17509
  }
17478
17510
  var stop2 = (event) => event.stopPropagation();
17479
17511
  function ButtonValue({ field: field2, recordId, inCell }) {
@@ -17520,7 +17552,8 @@ function ButtonValue({ field: field2, recordId, inCell }) {
17520
17552
  const run = runs.data.runs.find((r) => r.run_id === pressed.run_id);
17521
17553
  if (run && run.status !== "waiting") {
17522
17554
  setBusy(false);
17523
- return setSaid(run.status === "ran" ? { kind: "ran", says: runAnswerWords(b.label, run) } : { kind: "failed", says: runAnswerWords(b.label, run) });
17555
+ const answer = runAnswer(b.label, run);
17556
+ return setSaid(run.status === "ran" ? { kind: "ran", says: answer.words, value: answer.value } : { kind: "failed", says: answer.words });
17524
17557
  }
17525
17558
  if (Date.now() > until) {
17526
17559
  setBusy(false);
@@ -17569,7 +17602,8 @@ function ButtonValue({ field: field2, recordId, inCell }) {
17569
17602
  said2?.kind === "waiting" ? /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("p", { className: "matrx-shimmer rounded px-1 py-0.5", role: "status", "aria-live": "polite", children: said2.says }) : null,
17570
17603
  said2?.kind === "failed" ? /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("p", { className: "break-words text-destructive", role: "alert", children: said2.says }) : null,
17571
17604
  said2?.kind === "public" ? /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("p", { children: "Buttons run for signed-in people." }) : null,
17572
- said2?.kind === "ran" ? /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("p", { className: "break-words", children: [
17605
+ said2?.kind === "ran" ? /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("div", { className: "break-words", children: [
17606
+ said2.value ? /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(StructuredValueView, { structured: said2.value, label: b.label }) : null,
17573
17607
  said2.says,
17574
17608
  " ",
17575
17609
  said2.link ? /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_outbound_react7.OutboundLink, { href: said2.link, className: "text-primary underline", children: said2.link }) : null
@@ -24152,7 +24186,7 @@ function WholeTextDialog({
24152
24186
  /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(import_design_system68.Button, { size: "sm", variant: reading ? "ghost" : "secondary", role: "tab", "aria-selected": !reading, onClick: () => setReading(false), "data-records-whole-text-mode": "words", children: mayWrite ? "Edit" : "Words" }),
24153
24187
  /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(import_design_system68.Button, { size: "sm", variant: reading ? "secondary" : "ghost", role: "tab", "aria-selected": reading, onClick: () => setReading(true), "data-records-whole-text-mode": "preview", children: "Preview" })
24154
24188
  ] }) : null,
24155
- ready && reading && renderText ? /* @__PURE__ */ (0, import_jsx_runtime77.jsx)("div", { className: "max-h-[60vh] min-h-[8rem] overflow-auto rounded-md border px-3 py-2 text-sm", "data-records-whole-text-preview": "", children: draft ? renderText(draft, "cell") : /* @__PURE__ */ (0, import_jsx_runtime77.jsx)("span", { className: "text-muted-foreground", children: "\u2014" }) }) : ready && textBox ? (
24189
+ ready && reading && renderText ? /* @__PURE__ */ (0, import_jsx_runtime77.jsx)("div", { className: "max-h-[60vh] min-h-[8rem] overflow-auto rounded-md border px-3 py-2 text-sm", "data-records-whole-text-preview": "", children: draft ? renderText(withoutLeadingBlank(draft), "cell") : /* @__PURE__ */ (0, import_jsx_runtime77.jsx)("span", { className: "text-muted-foreground", children: "\u2014" }) }) : ready && textBox ? (
24156
24190
  // THE HOST'S TEXT BOX (`textBox`): the same words, with its "…" menu (Clean up, Help with
24157
24191
  // this…, Copy, Save, Share). What its menu puts in the box is unsaved until Save.
24158
24192
  /* @__PURE__ */ (0, import_jsx_runtime77.jsx)("div", { "data-records-whole-text-box": "", children: textBox({
@@ -57977,7 +58011,7 @@ function TablePage({
57977
58011
  // `min-w-9`: never narrower than the layout toolbar's folded "…" (36 px) — a row too
57978
58012
  // narrow for its pinned controls folds them behind that "…" (design-system
57979
58013
  // `usePinnedFold`), and the "…" itself is never cut (merged-grid leftovers, 2026-09-28).
57980
- "flex min-w-9 flex-1 items-center overflow-x-auto [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",
58014
+ "flex min-w-9 flex-1 items-center overflow-x-auto whitespace-nowrap [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",
57981
58015
  slotClipped === "end" && "[mask-image:linear-gradient(to_right,black_calc(100%_-_2rem),transparent)]",
57982
58016
  slotClipped === "start" && "[mask-image:linear-gradient(to_left,black_calc(100%_-_2rem),transparent)]",
57983
58017
  slotClipped === "both" && "[mask-image:linear-gradient(to_right,transparent,black_2rem,black_calc(100%_-_2rem),transparent)]",