@snowcone-app/ui 0.11.14 → 0.11.15

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": "@snowcone-app/ui",
3
- "version": "0.11.14",
3
+ "version": "0.11.15",
4
4
  "description": "React components for merchandise visualization and customization",
5
5
  "keywords": [
6
6
  "react",
@@ -103,7 +103,7 @@
103
103
  "react-instantsearch": "^7.15.5",
104
104
  "react-zoom-pan-pinch": "^3.6.4",
105
105
  "tailwind-merge": "^3.0.0",
106
- "@snowcone-app/sdk": "0.32.2"
106
+ "@snowcone-app/sdk": "0.33.0"
107
107
  },
108
108
  "devDependencies": {
109
109
  "@chromatic-com/storybook": "^4.1.2",
@@ -998,7 +998,7 @@ export function RealtimeProvider({
998
998
  const base = lastConfigBaseRef.current;
999
999
  if (!base) return;
1000
1000
  const ids = (base.mockupIds as string[] | undefined) ?? [];
1001
- // #6369 stopgap (croppedDeliveryLimit.ts): the boxes stall on cropped renders from ~10 mockups a session.
1001
+ // #6369 stopgap (croppedDeliveryLimit.ts): off until the render-side fix.
1002
1002
  if (!croppedDeliveryAllowed(ids.length)) {
1003
1003
  console.log(`[RTP] Cropped delivery OFF: ${ids.length} mockups > ${CROPPED_DELIVERY_MAX_MOCKUPS} (#6369 stopgap, full-frame frames)`);
1004
1004
  return;
@@ -48,6 +48,10 @@ const h = vi.hoisted(() => {
48
48
  };
49
49
  });
50
50
 
51
+ // These tests pin the cropped path itself. The #6369 stopgap turns cropped delivery off (croppedDeliveryLimit.ts, tested
52
+ // in RealtimeProvider.croppedLimit.test.tsx); lift it here so the path stays covered for the day the stopgap comes out.
53
+ vi.mock("../croppedDeliveryLimit", () => ({ CROPPED_DELIVERY_MAX_MOCKUPS: Infinity, croppedDeliveryAllowed: () => true }));
54
+
51
55
  vi.mock("@snowcone-app/sdk/react", () => ({
52
56
  useRealtimeMockup: (opts: unknown) => {
53
57
  h.opts = opts as typeof h.opts;
@@ -1,6 +1,6 @@
1
1
  /**
2
- * #6369 stopgap (croppedDeliveryLimit.ts): a realtime session with more than 5 mockups stays on full-frame delivery;
3
- * 5 or fewer turn on cropped delivery once every background is seeded, as before.
2
+ * #6369 stopgap (croppedDeliveryLimit.ts): cropped delivery is OFF for every session until the render-side fix has rolled
3
+ * (why: issue #6369; this package ships its source). Every session stays on full-frame delivery.
4
4
  */
5
5
  import { describe, expect, it, beforeEach, vi } from "vitest";
6
6
  import React from "react";
@@ -137,37 +137,23 @@ async function seedAll(n: number) {
137
137
  void capturedCtx;
138
138
  }
139
139
 
140
- // #6369 (2026-11-25): on the boxes, cropped renders stall from ~10 mockups a session (measured: 5 passes, 10 stalls;
141
- // full frame passes at 33). Stopgap: more than 5 mockups -> full-frame delivery.
142
- describe("cropped delivery limit (#6369 stopgap)", () => {
143
- it("the limit is the measured boundary: 5, the same as the SDK's useMockupStage", async () => {
144
- expect(CROPPED_DELIVERY_MAX_MOCKUPS).toBe(5);
140
+ describe("cropped delivery is off (#6369 stopgap)", () => {
141
+ it("no session may use it, in both clients (the limit is 0, the same as the SDK's useMockupStage)", async () => {
142
+ expect(CROPPED_DELIVERY_MAX_MOCKUPS).toBe(0);
145
143
  const sdk = await vi.importActual<typeof import("@snowcone-app/sdk")>("@snowcone-app/sdk");
146
144
  expect(sdk.CROPPED_DELIVERY_MAX_MOCKUPS).toBe(CROPPED_DELIVERY_MAX_MOCKUPS);
147
- expect(croppedDeliveryAllowed(5)).toBe(true);
148
- expect(croppedDeliveryAllowed(6)).toBe(false);
145
+ for (const n of [1, 2, 3, 5, 6, 33]) {
146
+ expect(croppedDeliveryAllowed(n)).toBe(false);
147
+ expect(sdk.croppedDeliveryAllowed(n)).toBe(false);
148
+ }
149
149
  });
150
150
 
151
- it("2 mockups (a phone session): untouched, cropped delivery turns on", async () => {
152
- await seedAll(2);
153
- await waitFor(() => expect(sentConfigs().some((c) => c.overlayCrop === "auto")).toBe(true));
154
- });
155
-
156
- it("5 mockups: cropped delivery turns on once every mockup is seeded", async () => {
157
- await seedAll(5);
158
- await waitFor(() => expect(sentConfigs().some((c) => c.overlayCrop === "auto")).toBe(true));
159
- expect(sentConfigs()[0].mockupIds).toHaveLength(5);
160
- });
161
-
162
- it("6 mockups: full-frame delivery, overlayCrop is never sent", async () => {
163
- await seedAll(6);
151
+ // 3 at the default width 1400 is the lead's case: cropped before this change.
152
+ it.each([1, 2, 3, 5, 6, 33])("%i mockup(s) at the default width: full-frame delivery, overlayCrop is never sent", async (n) => {
153
+ await seedAll(n);
164
154
  expect(sentConfigs().length).toBeGreaterThan(0);
165
- expect(sentConfigs()[0].mockupIds).toHaveLength(6);
166
- expect(sentConfigs().some((c) => c.overlayCrop)).toBe(false);
167
- });
168
-
169
- it("33 mockups (a desktop gallery): full-frame delivery", async () => {
170
- await seedAll(33);
155
+ expect(sentConfigs()[0]).toMatchObject({ width: 1400 });
156
+ expect(sentConfigs()[0].mockupIds).toHaveLength(n);
171
157
  expect(sentConfigs().some((c) => c.overlayCrop)).toBe(false);
172
158
  });
173
159
  });
@@ -24,6 +24,10 @@ const h = vi.hoisted(() => ({
24
24
  },
25
25
  }));
26
26
 
27
+ // These tests pin the cropped path itself. The #6369 stopgap turns cropped delivery off (croppedDeliveryLimit.ts, tested
28
+ // in RealtimeProvider.croppedLimit.test.tsx); lift it here so the path stays covered for the day the stopgap comes out.
29
+ vi.mock("../croppedDeliveryLimit", () => ({ CROPPED_DELIVERY_MAX_MOCKUPS: Infinity, croppedDeliveryAllowed: () => true }));
30
+
27
31
  vi.mock("@snowcone-app/sdk/react", () => ({
28
32
  useRealtimeMockup: () => ({
29
33
  isConnected: true, isConfigured: true, renderError: null, mockupResults: h.state.results,
@@ -19,6 +19,10 @@ const h = vi.hoisted(() => ({
19
19
  },
20
20
  }));
21
21
 
22
+ // These tests pin the cropped path itself. The #6369 stopgap turns cropped delivery off (croppedDeliveryLimit.ts, tested
23
+ // in RealtimeProvider.croppedLimit.test.tsx); lift it here so the path stays covered for the day the stopgap comes out.
24
+ vi.mock("../croppedDeliveryLimit", () => ({ CROPPED_DELIVERY_MAX_MOCKUPS: Infinity, croppedDeliveryAllowed: () => true }));
25
+
22
26
  vi.mock("@snowcone-app/sdk/react", () => ({
23
27
  useRealtimeMockup: () => ({
24
28
  isConnected: true, isConfigured: true, renderError: null, mockupResults: h.state.results,
@@ -1,20 +1,17 @@
1
1
  /**
2
- * STOPGAP for #6369 (2026-11-25), removable: a realtime session that holds MORE than this many mockups asks for
3
- * FULL-FRAME delivery and never turns on cropped delivery (`overlayCrop: "auto"`).
2
+ * STOPGAP for #6369 (2026-11-25), removable: cropped delivery (`overlayCrop: "auto"`) is OFF for every session; all frames
3
+ * are full frames. `croppedDeliveryAllowed` is the one switch for `RealtimeProvider`; the SDK's `useMockupStage`
4
+ * holds the same rule (`@snowcone-app/sdk`) and a test pins the two equal.
4
5
  *
5
- * Why: on the render boxes, cropped renders stall from about 10 mockups in a session. Measured on prod, colo-la-1,
6
- * BC43BE with our own art, 8 versions per session: cropped delivery reached the last version at 2 and 5 mockups and
7
- * stalled at 10, 20, 31 and 33 (the box reported E_RT_PREVIEW_SLOW, renders 4-12 s). Full-frame delivery reached the
8
- * last version at every size up to 33. Desktop galleries hold 20-33 mockups, so desktop live previews stopped updating
9
- * after the second version (67 of 80 editor-canary runs from 2026-11-23 20:00Z).
6
+ * Why: some cropped frames cannot be rendered safely yet, at ordinary session widths, so neither a picture count nor a
7
+ * width floor covers it (details, measurements and the earlier limit of 5: issue #6369, not here, this ships to npm).
10
8
  *
11
- * The SDK's useMockupStage holds the same rule (`@snowcone-app/sdk` CROPPED_DELIVERY_MAX_MOCKUPS; a test pins the two
12
- * equal). Remove (delete this module and its three call sites in RealtimeProvider, and the SDK's twin) once the box-side fix for #6369 is rolled
13
- * and the canary passes with cropped delivery at 33 mockups.
9
+ * REVERT with the render-side fix: set the limit back (or delete this module and its call sites) once it is rolled on
10
+ * every box and the editor canary passes with cropped delivery at 33 mockups.
14
11
  */
15
- export const CROPPED_DELIVERY_MAX_MOCKUPS = 5;
12
+ export const CROPPED_DELIVERY_MAX_MOCKUPS = 0;
16
13
 
17
- /** Whether a session holding `mockupCount` mockups may use cropped delivery (#6369 stopgap). */
14
+ /** Whether a session holding `mockupCount` mockups may use cropped delivery (#6369 stopgap: none may). */
18
15
  export function croppedDeliveryAllowed(mockupCount: number): boolean {
19
16
  return mockupCount <= CROPPED_DELIVERY_MAX_MOCKUPS;
20
17
  }