@lunora/studio 1.0.0-alpha.27 → 1.0.0-alpha.29

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/dist/index.d.ts CHANGED
@@ -386,7 +386,12 @@ interface TablePage {
386
386
  /** Foreign-key columns (column → target table) for `v.id("target")` fields, so the UI can link those cells. */
387
387
  refs?: Record<string, string>;
388
388
  rows: Record<string, unknown>[];
389
- total: number;
389
+ /**
390
+ * Total rows matching the predicate. Absent when the read passed
391
+ * `skipCount: true` — the data browser sources the count from a separate,
392
+ * predicate-keyed read so paging never re-runs the COUNT.
393
+ */
394
+ total?: number;
390
395
  }
391
396
  /** Direction a data migration is run in. Mirrors `@lunora/do`. */
392
397
  type MigrationDirection = "down" | "up";
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
- export { StudioApp } from './packem_shared/StudioApp-Ct_LA5EC.js';
1
+ export { StudioApp } from './packem_shared/StudioApp-wxioPfiP.js';
2
2
  export { CommandPalette, openCommandPalette } from './packem_shared/CommandPalette-L-CuSRUc.js';
3
- export { S as Studio } from './packem_shared/studio-DRl-14vs.js';
3
+ export { S as Studio } from './packem_shared/studio-Dm6H5DHS.js';
4
4
  export { ConfirmButton } from './packem_shared/ConfirmButton-C2eVi2Qv.js';
5
5
  export { default as ConnectionBadge } from './packem_shared/ConnectionBadge-B2DDM2Tn.js';
6
6
  export { ErrorBoundary } from './packem_shared/ErrorBoundary-BzAApI7J.js';
@@ -12,10 +12,10 @@ export { default as ApiDocsPanel } from './packem_shared/ApiDocsPanel-BSSgtcVf.j
12
12
  export { default as ApiReferencePanel } from './packem_shared/ApiReferencePanel-D24xOjCw.js';
13
13
  export { default as ApiTab } from './packem_shared/ApiTab-vo8uhE29.js';
14
14
  export { default as OpenRpcReferencePanel } from './packem_shared/OpenRpcReferencePanel-Dq0yyVWz.js';
15
- export { DataBrowser } from './packem_shared/DataBrowser-CjMoVgUr.js';
15
+ export { DataBrowser } from './packem_shared/DataBrowser-DBKOIVKS.js';
16
16
  export { DataFilters, toFilterClauses } from './packem_shared/DataFilters-FNquMaiu.js';
17
17
  export { GlobalDataBrowser } from './packem_shared/GlobalDataBrowser-DOjhvhKa.js';
18
- export { T as TableEditor } from './packem_shared/table-editor-CcxFPLeR.js';
18
+ export { T as TableEditor } from './packem_shared/table-editor-7iSgi3te.js';
19
19
  export { ExportImportPanel } from './packem_shared/ExportImportPanel-DtDEy4OD.js';
20
20
  export { MigrationsPanel } from './packem_shared/MigrationsPanel-Z1DmSSzf.js';
21
21
  export { PitrPanel } from './packem_shared/PitrPanel-3mec0LTF.js';
package/dist/mount.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { createRoot } from 'react-dom/client';
2
- import { StudioApp } from './packem_shared/StudioApp-Ct_LA5EC.js';
2
+ import { StudioApp } from './packem_shared/StudioApp-wxioPfiP.js';
3
3
  import { jsxDEV } from 'react/jsx-dev-runtime';
4
4
 
5
5
  const mountStudio = (options = {}) => {
@@ -2233,9 +2233,21 @@ const useDataBrowser = ({
2233
2233
  offset,
2234
2234
  orderBy: toOrderBy(sorting),
2235
2235
  search,
2236
+ // The page read skips the COUNT — the total rides a separate
2237
+ // predicate-keyed query (`countArgs`) that page navigation never
2238
+ // re-keys, so paging no longer re-runs the full-table COUNT.
2239
+ skipCount: true,
2236
2240
  table: selectedTable ?? ""
2237
2241
  };
2238
2242
  }, [filters, pageSize, offset, sorting, search, selectedTable]);
2243
+ const countArgs = useMemo(() => {
2244
+ return {
2245
+ filters: toFilterClauses(filters),
2246
+ limit: 1,
2247
+ search,
2248
+ table: selectedTable ?? ""
2249
+ };
2250
+ }, [filters, search, selectedTable]);
2239
2251
  const pageQuery = useAdminQuery(ADMIN_FUNCTIONS.readTablePage, pageArgs, {
2240
2252
  enabled: selectedTable !== null,
2241
2253
  keepPreviousData: false,
@@ -2247,6 +2259,11 @@ const useDataBrowser = ({
2247
2259
  const {
2248
2260
  liveError
2249
2261
  } = pageQuery;
2262
+ const countQuery = useAdminQuery(ADMIN_FUNCTIONS.readTablePage, countArgs, {
2263
+ enabled: selectedTable !== null,
2264
+ live: true,
2265
+ shardKey: debouncedShard
2266
+ });
2250
2267
  useEffect(() => {
2251
2268
  if (tablesQuery.data !== void 0) {
2252
2269
  recordShard(debouncedShard);
@@ -2464,7 +2481,7 @@ const useDataBrowser = ({
2464
2481
  shard: shardKey,
2465
2482
  table: selectedTable ?? void 0
2466
2483
  };
2467
- const total = page?.total ?? 0;
2484
+ const total = countQuery.data?.total ?? (page === null ? 0 : offset + page.rows.length);
2468
2485
  const hasPrevious = offset > 0;
2469
2486
  const hasNext = page !== null && offset + page.rows.length < total;
2470
2487
  const rangeStart = page === null || page.rows.length === 0 ? 0 : offset + 1;
@@ -1,7 +1,7 @@
1
1
  import 'react/compiler-runtime';
2
2
  import '@tanstack/react-router';
3
3
  import 'react';
4
- export { S as Studio } from './studio-DRl-14vs.js';
4
+ export { S as Studio } from './studio-Dm6H5DHS.js';
5
5
  import './ErrorBoundary-BzAApI7J.js';
6
6
  import './badge-B2PKA1-5.js';
7
7
  import './input-XH4r1Pt1.js';
@@ -9,7 +9,7 @@ import './reference-view-DVyk5kXj.js';
9
9
  import './InsightsPanel-BD29GXXd.js';
10
10
  import './SecurityAdvisorPanel-5tYrJdvn.js';
11
11
  import './ApiTab-vo8uhE29.js';
12
- import './table-editor-CcxFPLeR.js';
12
+ import './table-editor-7iSgi3te.js';
13
13
  import './ExportImportPanel-DtDEy4OD.js';
14
14
  import './MigrationsPanel-Z1DmSSzf.js';
15
15
  import './PitrPanel-3mec0LTF.js';
@@ -3,7 +3,7 @@ import { LunoraClient } from '@lunora/client';
3
3
  import { LunoraProvider } from '@lunora/react';
4
4
  import { useState, useEffect } from 'react';
5
5
  import { ErrorBoundary } from './ErrorBoundary-BzAApI7J.js';
6
- import { u as useTheme, B as BrandMark, T as ThemeProvider, a as TooltipProvider, S as Studio } from './studio-DRl-14vs.js';
6
+ import { u as useTheme, B as BrandMark, T as ThemeProvider, a as TooltipProvider, S as Studio } from './studio-Dm6H5DHS.js';
7
7
  import useDebounced from './useDebounced-Dxncpg6z.js';
8
8
  import { useT, createStudioI18n } from './DEFAULT_LOCALE-CiX4W7Kr.js';
9
9
  import { StudioI18nProvider } from './StudioI18nProvider-B-tDCZIi.js';
@@ -4,8 +4,8 @@ import '@tanstack/react-router';
4
4
  import 'react';
5
5
  import './storage-tier-CL98eOvn.js';
6
6
  import './DEFAULT_LOCALE-CiX4W7Kr.js';
7
- export { T as TableEditor } from './table-editor-CcxFPLeR.js';
7
+ export { T as TableEditor } from './table-editor-7iSgi3te.js';
8
8
  import './internal-CvMZCVd6.js';
9
- import './DataBrowser-CjMoVgUr.js';
9
+ import './DataBrowser-DBKOIVKS.js';
10
10
  import './GlobalDataBrowser-DOjhvhKa.js';
11
11
  import 'react/jsx-dev-runtime';
@@ -35,7 +35,7 @@ import { useAutoRefresh } from './DEFAULT_AUTO_REFRESH_MS-Vxwaxx51.js';
35
35
  import useDebounced from './useDebounced-Dxncpg6z.js';
36
36
  import { L as Label } from './label-D8ykjn5J.js';
37
37
  import { M as ModalShell } from './grid-features-DnTbXXNb.js';
38
- import { v as validateDataViewSearch, T as TableEditor } from './table-editor-CcxFPLeR.js';
38
+ import { v as validateDataViewSearch, T as TableEditor } from './table-editor-7iSgi3te.js';
39
39
  import { ExportImportPanel } from './ExportImportPanel-DtDEy4OD.js';
40
40
  import { MigrationsPanel } from './MigrationsPanel-Z1DmSSzf.js';
41
41
  import { PitrPanel } from './PitrPanel-3mec0LTF.js';
@@ -5,7 +5,7 @@ import { useRef, useState, useEffect } from 'react';
5
5
  import { T as TIER_META } from './storage-tier-CL98eOvn.js';
6
6
  import { useT } from './DEFAULT_LOCALE-CiX4W7Kr.js';
7
7
  import { f as fireAndForget } from './internal-CvMZCVd6.js';
8
- import { DataBrowser } from './DataBrowser-CjMoVgUr.js';
8
+ import { DataBrowser } from './DataBrowser-DBKOIVKS.js';
9
9
  import { GlobalDataBrowser } from './GlobalDataBrowser-DOjhvhKa.js';
10
10
  import { jsxDEV } from 'react/jsx-dev-runtime';
11
11