@ai-matrx/records-ui 0.115.50 → 0.115.51

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.51
4
+
5
+ Automatic changed-only republish (docs/metadata drift since the last tag — see
6
+ `git diff npm/records-ui/v0.115.50..npm/records-ui/v0.115.51 -- apps/shared/records-ui`).
7
+ No source changes intended and no consumer action required.
8
+
3
9
  ## 0.115.50
4
10
 
5
11
  Automatic changed-only republish (docs/metadata drift since the last tag — see
package/dist/index.cjs CHANGED
@@ -2947,15 +2947,13 @@ function cellSection(payload, ctx) {
2947
2947
  { id: "cell-clear", label: "Clear cell", icon: "eraser", destructive: true, disabledReason: why, onSelect: () => a.clearCells([{ rowId, columnId: columnId2 }]) }
2948
2948
  ];
2949
2949
  const cellField = fieldOf(ctx, columnId2);
2950
- if (a.cleanCell && cellField && ctx.cleanable?.(cellField)) {
2951
- items.push({
2952
- id: "cell-clean",
2953
- label: "Clean cell\u2026",
2954
- icon: "paintbrush",
2955
- disabledReason: why,
2956
- onSelect: () => a.cleanCell?.(rowId, columnId2)
2957
- });
2958
- }
2950
+ items.push({
2951
+ id: "cell-clean",
2952
+ label: "Clean cell\u2026",
2953
+ icon: "paintbrush",
2954
+ disabledReason: why ?? (!a.cleanCell ? NOT_HERE : cellField && !ctx.cleanable?.(cellField) ? "Only a text cell can be cleaned." : void 0),
2955
+ onSelect: () => a.cleanCell?.(rowId, columnId2)
2956
+ });
2959
2957
  if (a.askWhoChanged) {
2960
2958
  items.push({ id: "cell-history", label: "Who changed this?", icon: "history", shortcut: "\u2325\u21E7H", onSelect: () => a.askWhoChanged?.(columnId2, rowId) });
2961
2959
  }
@@ -27252,9 +27250,14 @@ function GridBody({
27252
27250
  const editingBusy = editing.busy;
27253
27251
  const addRecord = editing.addRecord;
27254
27252
  const phoneSheetTools = merged && phone ? controls.sheetTools : null;
27253
+ const narrowSearch = merged && !phone && !embedded && searchBox && toolbarFold2 >= 1;
27255
27254
  const tableToolbar = (0, import_react143.useMemo)(
27256
27255
  () => ({
27257
- search: !embedded,
27256
+ // A NARROW ROW KEEPS ITS SEARCH (member walk 2026-10-10: at 1440 px with the chat panel and the
27257
+ // sidebar open the search field was folded out of sight). Once the row folds anything, the search
27258
+ // becomes the entity-list magnifier that opens into a field, and it rides beside the primary
27259
+ // action — the one place on the row the table never folds away.
27260
+ search: !embedded && !narrowSearch,
27258
27261
  // EMBEDDED: Notion's magnifier — the design system's own search group, a button that
27259
27262
  // opens into a field. It is the same `query.search` the store's read asks.
27260
27263
  ...embedded && searchBox ? {
@@ -27375,18 +27378,29 @@ function GridBody({
27375
27378
  // side chat open it and "From template" both vanished behind the "…"). When the
27376
27379
  // row is short, "From template", undo and the rest ride the "…"; this stays.
27377
27380
  // EMBEDDED: the "+ New page" line under the table is the create action.
27378
- ...!embedded && !readOnly && rights.write ? {
27379
- primary: /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(
27380
- NewRecordControl,
27381
- {
27382
- tableId,
27383
- noun,
27384
- busy: added.busy,
27385
- onAdd: () => addRowRef.current(),
27386
- onCreated: (id) => formCreatedRef.current(id),
27387
- ask: formAsk
27388
- }
27389
- )
27381
+ ...narrowSearch || !embedded && !readOnly && rights.write ? {
27382
+ primary: /* @__PURE__ */ (0, import_jsx_runtime87.jsxs)("span", { className: "flex shrink-0 items-center gap-1", "data-records-grid-primary": "", children: [
27383
+ narrowSearch ? /* @__PURE__ */ (0, import_jsx_runtime87.jsx)("span", { "data-records-grid-narrow-search": "", children: /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(
27384
+ import_design_system72.TapTargetSearchGroup,
27385
+ {
27386
+ surface: "solid",
27387
+ placeholder: "Search records",
27388
+ value: query.search,
27389
+ onValueChange: (term) => setQuery((held) => ({ ...held, search: term, page: 1 }))
27390
+ }
27391
+ ) }) : null,
27392
+ !embedded && !readOnly && rights.write ? /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(
27393
+ NewRecordControl,
27394
+ {
27395
+ tableId,
27396
+ noun,
27397
+ busy: added.busy,
27398
+ onAdd: () => addRowRef.current(),
27399
+ onCreated: (id) => formCreatedRef.current(id),
27400
+ ask: formAsk
27401
+ }
27402
+ ) : null
27403
+ ] })
27390
27404
  } : {},
27391
27405
  ...phone ? {
27392
27406
  sheetTop: /* @__PURE__ */ (0, import_jsx_runtime87.jsxs)("div", { className: "flex flex-col gap-1.5 pb-1", "data-records-grid-sheet-top": "", "data-matrx-table-tools-keep-open": "", children: [
@@ -27488,7 +27502,8 @@ function GridBody({
27488
27502
  formAsk,
27489
27503
  searchOverride,
27490
27504
  onSearchChange,
27491
- searchBox
27505
+ searchBox,
27506
+ narrowSearch
27492
27507
  ]
27493
27508
  );
27494
27509
  const labelOfField = (0, import_react143.useCallback)(
@@ -33288,6 +33303,14 @@ var LOOK_WORDS = {
33288
33303
  folded: "Your look",
33289
33304
  newName: "Name for the new view"
33290
33305
  };
33306
+ var QUESTION_KEYS = ["sorts", "where", "groupField", "swimlaneField"];
33307
+ function lookAfterReset(look) {
33308
+ if (!look) return null;
33309
+ const kept = { ...look };
33310
+ for (const key of QUESTION_KEYS) delete kept[key];
33311
+ for (const key of Object.keys(kept)) if (kept[key] === void 0) delete kept[key];
33312
+ return Object.keys(kept).length > 0 ? kept : null;
33313
+ }
33291
33314
 
33292
33315
  // src/ViewSwitcher.tsx
33293
33316
  var import_react224 = require("react");
@@ -53515,11 +53538,13 @@ function TablePage({
53515
53538
  setLookRefused(null);
53516
53539
  setViewSaveRefused(null);
53517
53540
  const before = looks?.[current.id];
53541
+ const questionAsked = queryShowing || JSON.stringify(lookAfterReset(before)) !== JSON.stringify(before ?? null);
53542
+ const layoutKept = questionAsked ? lookAfterReset(before) : null;
53518
53543
  setLooks((all) => {
53519
53544
  const { [current.id]: _gone, ...rest } = all ?? {};
53520
- return rest;
53545
+ return layoutKept ? { ...rest, [current.id]: layoutKept } : rest;
53521
53546
  });
53522
- const kept = await keepLook(client, tableId, current.id, null);
53547
+ const kept = await keepLook(client, tableId, current.id, layoutKept);
53523
53548
  if (!kept.ok) {
53524
53549
  setLooks((all) => ({ ...all ?? {}, [current.id]: before ?? {} }));
53525
53550
  setLookRefused(kept.error);