simple-table-core 3.9.0 → 3.9.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.
@@ -21,12 +21,20 @@ export interface DimensionManagerState {
21
21
  contentHeight: number | undefined;
22
22
  }
23
23
  type StateChangeCallback = (state: DimensionManagerState) => void;
24
+ /**
25
+ * Wait this long after the last container-width ResizeObserver tick before
26
+ * notifying subscribers. Coalesces CSS-transition / animated layout shifts
27
+ * (e.g. a collapsible nav) into a single trailing update instead of one full
28
+ * table render per animation frame.
29
+ */
30
+ export declare const CONTAINER_RESIZE_NOTIFY_DEBOUNCE_MS = 50;
24
31
  export declare class DimensionManager {
25
32
  private config;
26
33
  private state;
27
34
  private subscribers;
28
35
  private resizeObserver;
29
36
  private rafId;
37
+ private resizeNotifyDebounceId;
30
38
  /** Set when applyContainerWidthSync updates state before any subscriber exists. */
31
39
  private initialNotifyPending;
32
40
  constructor(config: DimensionManagerConfig);
@@ -35,6 +43,9 @@ export declare class DimensionManager {
35
43
  private calculateHeaderHeight;
36
44
  private convertHeightToPixels;
37
45
  private calculateContentHeight;
46
+ private cancelPendingResizeNotify;
47
+ /** Trailing debounce for animated / continuous container resizes. */
48
+ private scheduleResizeNotify;
38
49
  private observeContainer;
39
50
  private applyContainerWidthSync;
40
51
  updateConfig(config: Partial<DimensionManagerConfig>): void;
@@ -3,6 +3,8 @@
3
3
  *
4
4
  * The animation coordinator runs FLIP-style transitions when cells move between
5
5
  * positions. All fields are optional; omit the prop entirely to use defaults.
6
+ *
7
+ * Row group expand/collapse never animates when `rowGrouping` is configured.
6
8
  */
7
9
  export interface AnimationsConfig {
8
10
  /** Master toggle. Defaults to `true`. When `false`, no other field has effect. */
@@ -34,7 +34,7 @@ export declare const ColumnExpand_IncomingCellsStartAtZeroWidth: {
34
34
  canvasElement: HTMLElement;
35
35
  }) => Promise<void>;
36
36
  };
37
- export declare const RowExpand_AddsAccordionClass: {
37
+ export declare const RowExpand_NoAccordionClass: {
38
38
  tags: string[];
39
39
  render: () => HTMLDivElement & {
40
40
  _table?: import("../../src/index").SimpleTableVanilla | undefined;
@@ -43,7 +43,7 @@ export declare const RowExpand_AddsAccordionClass: {
43
43
  canvasElement: HTMLElement;
44
44
  }) => Promise<void>;
45
45
  };
46
- export declare const RowExpand_IncomingCellsStartAtZeroHeight: {
46
+ export declare const RowExpand_NoAccordionGrow: {
47
47
  tags: string[];
48
48
  render: () => HTMLDivElement & {
49
49
  _table?: import("../../src/index").SimpleTableVanilla | undefined;
@@ -0,0 +1,56 @@
1
+ /**
2
+ * CONTAINER RESIZE PERFORMANCE REPRO
3
+ *
4
+ * Simulates a collapsible global left nav that animates width and squeezes the
5
+ * main content area — the layout pattern reported on Artist/Platform pages.
6
+ *
7
+ * During the CSS transition, the table container's ResizeObserver fires on
8
+ * successive frames. DimensionManager coalesces those ticks (trailing debounce)
9
+ * so subscribers / full renders fire once after the transition settles.
10
+ *
11
+ * Use the HUD while toggling the nav, or run the automated play test.
12
+ * The play test asserts coalesced table relayouts (header width updates), not
13
+ * raw container ResizeObserver ticks — the DOM still resizes every animation frame.
14
+ */
15
+ import type { Meta } from "@storybook/html";
16
+ declare const meta: Meta;
17
+ export default meta;
18
+ interface ContainerResizePerfSnapshot {
19
+ contentWidthChanges: number;
20
+ tableContainerWidthChanges: number;
21
+ /** Batched header relayout passes (one per table render), not per-cell updates. */
22
+ tableRelayouts: number;
23
+ lastContentWidth: number;
24
+ }
25
+ declare global {
26
+ interface Window {
27
+ __containerResizePerf?: ContainerResizePerfSnapshot;
28
+ }
29
+ }
30
+ export declare const resetContainerResizePerf: (lastContentWidth?: number) => void;
31
+ export declare const CollapsibleNavWithTable: {
32
+ tags: string[];
33
+ render: () => HTMLDivElement;
34
+ };
35
+ export declare const CollapsibleNavTableNoAutoExpand: {
36
+ tags: string[];
37
+ render: () => HTMLDivElement;
38
+ };
39
+ export declare const CollapsibleNavBaseline: {
40
+ tags: string[];
41
+ render: () => HTMLDivElement;
42
+ };
43
+ export declare const NavToggleCoalescesTableRelayout: {
44
+ tags: string[];
45
+ render: () => HTMLDivElement;
46
+ play: ({ canvasElement }: {
47
+ canvasElement: HTMLElement;
48
+ }) => Promise<void>;
49
+ };
50
+ export declare const BaselineNavHasNoTableGridChurn: {
51
+ tags: string[];
52
+ render: () => HTMLDivElement;
53
+ play: ({ canvasElement }: {
54
+ canvasElement: HTMLElement;
55
+ }) => Promise<void>;
56
+ };
@@ -0,0 +1,78 @@
1
+ /**
2
+ * ROW GROUP RE-EXPAND REGRESSION TESTS
3
+ *
4
+ * Reproduces bugs when a lazy-loaded grouped row is collapsed and re-expanded:
5
+ *
6
+ * 1. onRowGroupExpand receives a stale `row` snapshot (missing cached children),
7
+ * so consumer guards like `if (row[groupingKey]?.length) return` fail and
8
+ * every re-expand re-triggers setLoading + fetch.
9
+ *
10
+ * 2. Re-expand must not re-enter loading state or spuriously animate sibling
11
+ * rows below the expanded group.
12
+ *
13
+ * Mirrors packages/react/src/__tests__/onRowGroupExpandReExpand.test.tsx.
14
+ * All play tests should FAIL until the stale-row fix lands.
15
+ */
16
+ import type { Meta } from "@storybook/html";
17
+ declare const meta: Meta;
18
+ export default meta;
19
+ interface ReExpandProbe {
20
+ expandSnapshots: Array<{
21
+ childCount: number;
22
+ isExpanded: boolean;
23
+ }>;
24
+ fetchCount: number;
25
+ loadingTrueCount: number;
26
+ }
27
+ declare global {
28
+ interface Window {
29
+ __rowGroupReExpandProbe?: ReExpandProbe;
30
+ }
31
+ }
32
+ export declare const ReExpand_PassesCachedRowSnapshot: {
33
+ tags: string[];
34
+ render: () => HTMLDivElement;
35
+ play: ({ canvasElement }: {
36
+ canvasElement: HTMLElement;
37
+ }) => Promise<void>;
38
+ };
39
+ export declare const ReExpand_SkipsRefetch: {
40
+ tags: string[];
41
+ render: () => HTMLDivElement;
42
+ play: ({ canvasElement }: {
43
+ canvasElement: HTMLElement;
44
+ }) => Promise<void>;
45
+ };
46
+ export declare const ReExpand_SkipsSetLoading: {
47
+ tags: string[];
48
+ render: () => HTMLDivElement;
49
+ play: ({ canvasElement }: {
50
+ canvasElement: HTMLElement;
51
+ }) => Promise<void>;
52
+ };
53
+ /** Manual QA: status panel shows fetch/loading counts while toggling Engineering. */
54
+ export declare const ReExpand_LazyLoad_StatusPanel: {
55
+ tags: string[];
56
+ render: () => HTMLDivElement;
57
+ };
58
+ export declare const ReExpand_NoLoadingSkeletonOnLazyReExpand: {
59
+ tags: string[];
60
+ render: () => HTMLDivElement;
61
+ play: ({ canvasElement }: {
62
+ canvasElement: HTMLElement;
63
+ }) => Promise<void>;
64
+ };
65
+ export declare const ReExpand_SiblingRowsNoAccordionGrow: {
66
+ tags: string[];
67
+ render: () => HTMLDivElement;
68
+ play: ({ canvasElement }: {
69
+ canvasElement: HTMLElement;
70
+ }) => Promise<void>;
71
+ };
72
+ export declare const ReExpand_NoAccordionGrowOnReExpand: {
73
+ tags: string[];
74
+ render: () => HTMLDivElement;
75
+ play: ({ canvasElement }: {
76
+ canvasElement: HTMLElement;
77
+ }) => Promise<void>;
78
+ };