@multiplatform.one/table 7.30.0 → 7.31.0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@multiplatform.one/table",
3
- "version": "7.30.0",
3
+ "version": "7.31.0",
4
4
  "description": "Advanced table components with filtering, pagination, sorting, and URL state management",
5
5
  "keywords": [
6
6
  "cross-platform",
@@ -74,13 +74,13 @@
74
74
  "access": "public"
75
75
  },
76
76
  "dependencies": {
77
- "@multiplatform.one/components": "7.30.0",
78
- "@multiplatform.one/forms": "7.30.0",
79
- "@multiplatform.one/platform": "7.30.0",
80
- "@multiplatform.one/rich-text": "7.30.0",
81
- "@multiplatform.one/router": "7.30.0",
82
- "@multiplatform.one/table-primitives": "7.30.0",
83
- "@multiplatform.one/theme": "7.30.0",
77
+ "@multiplatform.one/components": "7.31.0",
78
+ "@multiplatform.one/forms": "7.31.0",
79
+ "@multiplatform.one/platform": "7.31.0",
80
+ "@multiplatform.one/rich-text": "7.31.0",
81
+ "@multiplatform.one/router": "7.31.0",
82
+ "@multiplatform.one/table-primitives": "7.31.0",
83
+ "@multiplatform.one/theme": "7.31.0",
84
84
  "@phosphor-icons/react": "^2.1.10",
85
85
  "@shopify/flash-list": "^2.3.1",
86
86
  "@tamagui/roving-focus": "2.7.6",
@@ -90,10 +90,10 @@
90
90
  "tamagui": "2.7.6"
91
91
  },
92
92
  "devDependencies": {
93
- "@multiplatform.one/config": "7.30.0",
94
- "@multiplatform.one/router": "7.30.0",
95
- "@multiplatform.one/storybook": "7.30.0",
96
- "@multiplatform.one/test-utils": "7.30.0",
93
+ "@multiplatform.one/config": "7.31.0",
94
+ "@multiplatform.one/router": "7.31.0",
95
+ "@multiplatform.one/storybook": "7.31.0",
96
+ "@multiplatform.one/test-utils": "7.31.0",
97
97
  "@tamagui/build": "2.7.6",
98
98
  "@testing-library/react": "^16.3.2",
99
99
  "@types/react-dom": "^19.2.3",
@@ -4,6 +4,7 @@ import type { GuardrailSpecimenParameter } from "@multiplatform.one/theme";
4
4
  import { Preset } from "@multiplatform.one/theme";
5
5
  import type { Meta, StoryObj } from "@storybook/react-native-web-vite";
6
6
  import React from "react";
7
+ import { within } from "storybook/test";
7
8
  // Catalog Button + Input (LC-56 STORY-HONESTY — no raw interactive primitives).
8
9
  import { Button, Input } from "@multiplatform.one/forms";
9
10
  import { Text, View, XStack, YStack } from "tamagui";
@@ -655,7 +656,14 @@ function sleep(ms: number) {
655
656
  * user is still viewing page N (prefetch-ahead), so appends resolve from
656
657
  * cache. Sorting resets accumulation back to page 0.
657
658
  */
658
- function InfiniteLoaderDemo({ latencyMs }: { latencyMs: number }) {
659
+ function InfiniteLoaderDemo({
660
+ latencyMs,
661
+ holdFromPage,
662
+ }: {
663
+ latencyMs: number;
664
+ /** Pages from this index on are requested and never answered. */
665
+ holdFromPage?: number;
666
+ }) {
659
667
  const allRows = React.useMemo(() => makeDemoRows(200), []);
660
668
  const startRef = React.useRef(Date.now());
661
669
  const [log, setLog] = React.useState<string[]>([]);
@@ -671,6 +679,9 @@ function InfiniteLoaderDemo({ latencyMs }: { latencyMs: number }) {
671
679
  ...prev,
672
680
  `page-${query.pageIndex} @ ${elapsed}ms${sortSuffix}${searchSuffix}`,
673
681
  ]);
682
+ if (holdFromPage !== undefined && query.pageIndex >= holdFromPage) {
683
+ await new Promise(() => undefined);
684
+ }
674
685
  await sleep(latencyMs);
675
686
  const rows = query.globalFilter
676
687
  ? allRows.filter((row) =>
@@ -691,7 +702,7 @@ function InfiniteLoaderDemo({ latencyMs }: { latencyMs: number }) {
691
702
  totalCount: rows.length,
692
703
  };
693
704
  },
694
- [allRows, latencyMs],
705
+ [allRows, latencyMs, holdFromPage],
695
706
  );
696
707
 
697
708
  return (
@@ -728,9 +739,30 @@ export const InfiniteScrollLoader: Story = {
728
739
  render: () => <InfiniteLoaderDemo latencyMs={250} />,
729
740
  };
730
741
 
731
- /** Slow loader (1.2s/page): shows the bounded tail skeleton while appending. */
742
+ // True under Playwright, as for the preview's frozen clock.
743
+ const automatedCapture = typeof navigator !== "undefined" && navigator.webdriver;
744
+
745
+ /**
746
+ * Slow loader (1.2s/page): shows the bounded tail skeleton while appending.
747
+ *
748
+ * The play scrolls page 2 in and asks for page 3, and under automated capture
749
+ * page 3 never answers, so the shot is pages 1 and 2 plus the tail skeleton.
750
+ * Left to the timer, lost-pixel's full-height resize revealed the sentinel
751
+ * and froze either the skeleton or rows 21 to 23 (MPO-483).
752
+ */
732
753
  export const InfiniteScrollSlowLoader: Story = {
733
- render: () => <InfiniteLoaderDemo latencyMs={1200} />,
754
+ render: () => (
755
+ <InfiniteLoaderDemo latencyMs={1200} holdFromPage={automatedCapture ? 2 : undefined} />
756
+ ),
757
+ play: async ({ canvasElement }) => {
758
+ const canvas = within(canvasElement);
759
+ await canvas.findByText("Item 020", {}, { timeout: 20000 });
760
+ canvas.getByTestId("infinite-sentinel").scrollIntoView();
761
+ await canvas.findByText("Item 040", {}, { timeout: 20000 });
762
+ canvas.getByTestId("infinite-sentinel").scrollIntoView();
763
+ await canvas.findByTestId("infinite-append-skeleton", {}, { timeout: 20000 });
764
+ },
765
+ parameters: { lostpixel: { waitForPlay: true } },
734
766
  };
735
767
 
736
768
  /** Infinite + virtualized body: appended pages extend the virtual scroll range. */