@ai-matrx/records-ui 0.90.0 → 0.90.1

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,19 @@
1
1
  # Changelog — @ai-matrx/records-ui
2
2
 
3
+ ## 0.90.1 (2026-09-26 — merged grid 6n/6o live-walk fixes; needs @ai-matrx/design-system 0.44.3)
4
+
5
+ - **The header's "+" is a button of its own, not a button inside the column-reorder button**
6
+ (found live: a real click on "+" did nothing, and React reported a nested button). The column
7
+ declares `reorderable: false` (design-system 0.44.3), so its label is never a drag handle and it
8
+ never moves among the data columns.
9
+ - **Phone (6o), found live at 375 px:** the Tools button was scrolled past search and a 144 px "No
10
+ groups" picker, off the right edge. Search and Tools now sit side by side at the START of the row
11
+ (the same search query), and an ungrouped view draws no group picker on a phone.
12
+ - **A key is never spread into JSX** (found live on the merged grid): `TablePage` spread
13
+ `{ key: "share" }` into `<ShareControl>`; the key is passed directly now, and
14
+ `a-key-is-never-spread-into-jsx.test.tsx` is a census of this package's source (it names the old
15
+ line on 0.90.0).
16
+
3
17
  ## 0.90.0 (2026-09-26 — merged grid tranches 6n + 6o, choice colours by option, DOM budget; needs @ai-matrx/records 0.58.22)
4
18
 
5
19
  - **6n · a row is added where you are.** The merged grid draws an "Add row" line under the last
package/dist/index.cjs CHANGED
@@ -269,6 +269,8 @@ __export(src_exports, {
269
269
  formFromSummary: () => formFromSummary,
270
270
  formPresentation: () => formPresentation,
271
271
  formatForField: () => formatForField,
272
+ gridContextKey: () => gridContextKey,
273
+ gridContextSnapshot: () => gridContextSnapshot,
272
274
  groupInbox: () => groupInbox,
273
275
  groupLabel: () => groupLabel,
274
276
  handOrderLine: () => handOrderLine,
@@ -7316,6 +7318,8 @@ function addColumnColumn(onAdd) {
7316
7318
  sortable: false,
7317
7319
  filter: false,
7318
7320
  hideable: false,
7321
+ // A control, never a drag handle: no button inside the reorder button, and it stays last.
7322
+ reorderable: false,
7319
7323
  resizable: false,
7320
7324
  compact: true,
7321
7325
  width: 40
@@ -10653,6 +10657,7 @@ function Grid({
10653
10657
  const view = presentation.grouping;
10654
10658
  const field2 = view?.field ?? null;
10655
10659
  if (field2 === null && !onPresentationChange) return null;
10660
+ if (field2 === null && merged && phone) return null;
10656
10661
  const aggregates = view && Object.keys(view.aggregates ?? {}).length > 0 ? view.aggregates : field2 ? { [field2]: { kind: "count" } } : void 0;
10657
10662
  return {
10658
10663
  columnId: field2,
@@ -10683,7 +10688,7 @@ function Grid({
10683
10688
  }
10684
10689
  } : {}
10685
10690
  };
10686
- }, [presentation, onPresentationChange, writeLook]);
10691
+ }, [presentation, onPresentationChange, writeLook, merged, phone]);
10687
10692
  const labelOfField = (0, import_react57.useCallback)(
10688
10693
  (key) => {
10689
10694
  const held = (fields.data ?? []).find((f) => f.key === key);
@@ -11065,6 +11070,41 @@ function Grid({
11065
11070
  toolbar: {
11066
11071
  search: true,
11067
11072
  searchPlaceholder: "Search records",
11073
+ /*
11074
+ * A PHONE (tranche 6o): search and the one Tools button sit side by side at the START of
11075
+ * the row, so Tools is never scrolled out of reach; the search is the same query.
11076
+ */
11077
+ ...merged && phone ? {
11078
+ customSearch: /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("div", { className: "flex min-w-0 flex-1 items-center gap-1.5", "data-records-grid-phone-search": "", children: [
11079
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
11080
+ "input",
11081
+ {
11082
+ type: "search",
11083
+ value: query.search,
11084
+ placeholder: "Search",
11085
+ "aria-label": "Search records",
11086
+ onChange: (event) => {
11087
+ const search = event.target.value;
11088
+ setQuery((held) => ({ ...held, search, page: 1 }));
11089
+ },
11090
+ className: "h-8 w-full min-w-0 rounded-md border border-input bg-background px-2 text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
11091
+ style: { fontSize: "16px" }
11092
+ }
11093
+ ),
11094
+ /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
11095
+ import_design_system32.Button,
11096
+ {
11097
+ size: "sm",
11098
+ variant: "outline",
11099
+ className: "h-8 shrink-0",
11100
+ "data-records-grid-tools": "",
11101
+ "aria-haspopup": "dialog",
11102
+ onClick: () => setToolsOpen(true),
11103
+ children: "Tools"
11104
+ }
11105
+ )
11106
+ ] })
11107
+ } : {},
11068
11108
  /* ONE ROW (lane TABLE-PAGE-CHROME): on a table page the grid's search, columns and
11069
11109
  sort are drawn INTO the page's toolbar row, never a second bar under it. */
11070
11110
  ...toolbarSlot !== void 0 ? { portalInto: toolbarSlot, singleRow: true } : {},
@@ -11115,32 +11155,18 @@ function Grid({
11115
11155
  )
11116
11156
  ] });
11117
11157
  if (!merged || !phone) return all;
11118
- return /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(import_jsx_runtime39.Fragment, { children: [
11119
- /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
11120
- import_design_system32.Button,
11121
- {
11122
- size: "sm",
11123
- variant: "outline",
11124
- className: "h-8 shrink-0",
11125
- "data-records-grid-tools": "",
11126
- "aria-haspopup": "dialog",
11127
- onClick: () => setToolsOpen(true),
11128
- children: "Tools"
11129
- }
11130
- ),
11131
- /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_design_system32.BottomSheet, { open: toolsOpen, onOpenChange: setToolsOpen, title: "Table tools", surface: "solid", children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
11132
- "div",
11133
- {
11134
- "data-records-grid-tools-sheet": "",
11135
- className: "flex flex-col items-stretch gap-1 px-3 pb-6 [&>button]:justify-start [&_button]:min-h-10",
11136
- onClickCapture: (event) => {
11137
- const target = event.target.closest("button");
11138
- if (target && !target.hasAttribute("aria-haspopup")) setToolsOpen(false);
11139
- },
11140
- children: all
11141
- }
11142
- ) })
11143
- ] });
11158
+ return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_jsx_runtime39.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_design_system32.BottomSheet, { open: toolsOpen, onOpenChange: setToolsOpen, title: "Table tools", surface: "solid", children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
11159
+ "div",
11160
+ {
11161
+ "data-records-grid-tools-sheet": "",
11162
+ className: "flex flex-col items-stretch gap-1 px-3 pb-6 [&>button]:justify-start [&_button]:min-h-10",
11163
+ onClickCapture: (event) => {
11164
+ const target = event.target.closest("button");
11165
+ if (target && !target.hasAttribute("aria-haspopup")) setToolsOpen(false);
11166
+ },
11167
+ children: all
11168
+ }
11169
+ ) }) });
11144
11170
  })()
11145
11171
  }
11146
11172
  },
@@ -26929,8 +26955,9 @@ function TablePage({
26929
26955
  name: table.data?.name,
26930
26956
  may: rights.share,
26931
26957
  initiallyOpen: shareFromLink || shareAsked > 0,
26932
- ...phone ? { key: `share-${shareAsked}`, className: "hidden" } : { key: "share" }
26933
- }
26958
+ ...phone ? { className: "hidden" } : {}
26959
+ },
26960
+ phone ? `share-${shareAsked}` : "share"
26934
26961
  ),
26935
26962
  /* @__PURE__ */ (0, import_jsx_runtime94.jsxs)(import_design_system85.DropdownMenu, { children: [
26936
26963
  /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(import_design_system85.DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(import_design_system85.Button, { size: "sm", variant: "ghost", "aria-label": "Table menu", title: "Table menu", "data-table-menu": "", children: /* @__PURE__ */ (0, import_jsx_runtime94.jsxs)("svg", { viewBox: "0 0 24 24", className: "h-4 w-4", fill: "currentColor", "aria-hidden": "true", children: [