@snowcone-app/ui 0.11.13 → 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.13",
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",
@@ -17,6 +17,7 @@ import { useShopOptional } from "../patterns/ShopProvider";
17
17
  import { useRealtimeOptional } from "../patterns/RealtimeProvider";
18
18
  import { useMockupPriorityOptional } from "../patterns/MockupPriorityProvider";
19
19
  import { useMockupBackgroundOptional } from "../patterns/MockupBackground";
20
+ import { placementArtFor, usePlacementArtOptional } from "../patterns/PlacementArt";
20
21
  import { LoadingOverlayPrismCandyInline } from "../components/LoadingOverlayPrismCandy";
21
22
  import {
22
23
  createDesignForPlacements,
@@ -52,6 +53,10 @@ function buildHeroMockupUrl(args: {
52
53
  // the one builder the server's first-hero preload uses too (heroMockupUrl.ts)
53
54
  return heroMockupUrl({ ...args, shop: snow.shop, resolver: snow.resolver });
54
55
  }
56
+ /** The art a picture is of: its artwork src, and its per-placement map (PlacementArt) when there is one. */
57
+ function artIdentity(src: string | undefined, placementArtKey: string): string | undefined {
58
+ return placementArtKey ? `${src ?? ""}|${placementArtKey}` : src;
59
+ }
55
60
  /** A crop of the strip needs no measured width: it comes at its own px (or the width the page asks). */
56
61
  function isCrop(stripView: MockupView | undefined): stripView is MockupView {
57
62
  return stripView !== undefined;
@@ -241,6 +246,10 @@ export const HeroProductImage = memo(function HeroProductImage({
241
246
  const priorityContext = useMockupPriorityOptional();
242
247
  // Page background baked into static mockup URLs (see MockupBackground).
243
248
  const mockupBg = useMockupBackgroundOptional();
249
+ // A picture per placement (PlacementArt: a product printed piece by piece), else the one artwork on every placement.
250
+ const placementArt = usePlacementArtOptional();
251
+ // What the picture shows: the artwork, and the per-placement map when there is one (a new map is new art).
252
+ const placementArtKey = placementArt ? JSON.stringify(placementArt) : "";
244
253
  const priorityContextRef = useRef(priorityContext);
245
254
  priorityContextRef.current = priorityContext;
246
255
 
@@ -313,13 +322,13 @@ export const HeroProductImage = memo(function HeroProductImage({
313
322
  // Build placementDesigns with alignment info from design context
314
323
  // This ensures alignment changes trigger URL regeneration
315
324
  const placementDesigns: Record<string, PlacementDesign> = {};
316
- if (designContext?.getPlacementDesign && allPlacements) {
325
+ if ((designContext?.getPlacementDesign || placementArt) && allPlacements) {
317
326
  for (const p of allPlacements) {
318
327
  // Skip color placements
319
328
  if (p.type === "color") continue;
320
- const design = designContext.getPlacementDesign(p.label);
329
+ const design = designContext?.getPlacementDesign(p.label);
321
330
  placementDesigns[p.label] = {
322
- imageUrl: effectiveArtworkSrc,
331
+ imageUrl: placementArtFor(placementArt, p, effectiveArtworkSrc),
323
332
  alignment: design?.alignment || "center",
324
333
  } as PlacementDesign;
325
334
  }
@@ -360,6 +369,7 @@ export const HeroProductImage = memo(function HeroProductImage({
360
369
  images,
361
370
  width,
362
371
  effects,
372
+ placementArt,
363
373
  // Include placements to trigger recomputation when alignment changes
364
374
  // eslint-disable-next-line react-hooks/exhaustive-deps
365
375
  JSON.stringify(designContext?.placements),
@@ -464,7 +474,7 @@ export const HeroProductImage = memo(function HeroProductImage({
464
474
 
465
475
  lastUrlRef.current = realtimeUrl;
466
476
  // Track which artwork this realtimeUrl is for (used to detect stale realtime URLs)
467
- realtimeArtworkSrcRef.current = artworkSrc || selectedArtworkSrc;
477
+ realtimeArtworkSrcRef.current = artIdentity(artworkSrc || selectedArtworkSrc, placementArtKey);
468
478
  // addLayerDirectly handles shimmer timing internally (500ms delay)
469
479
  // SAFARI FIX: Skip transition for initial load to prevent flash
470
480
  const isInitialLoad = layersLengthRef.current === 0;
@@ -776,7 +786,7 @@ export const HeroProductImage = memo(function HeroProductImage({
776
786
  // Detect artwork changes and reset local URL tracking
777
787
  // This ensures we don't skip updates when artwork changes
778
788
  useEffect(() => {
779
- const currentSrc = artworkSrc || selectedArtworkSrc;
789
+ const currentSrc = artIdentity(artworkSrc || selectedArtworkSrc, placementArtKey);
780
790
  if (currentSrc !== prevArtworkSrcRef.current) {
781
791
  // Artwork changed - reset local tracking so next update is applied
782
792
  lastUrlRef.current = null;
@@ -788,7 +798,7 @@ export const HeroProductImage = memo(function HeroProductImage({
788
798
  // Reset realtime artwork tracking so stale URLs are detected correctly
789
799
  realtimeArtworkSrcRef.current = undefined;
790
800
  }
791
- }, [artworkSrc, selectedArtworkSrc]);
801
+ }, [artworkSrc, selectedArtworkSrc, placementArtKey]);
792
802
 
793
803
  // Keep refs to objects we need to pass through (these don't need to trigger re-creation)
794
804
  const contextSelectionRef = useRef(context?.selection);
@@ -814,15 +824,15 @@ export const HeroProductImage = memo(function HeroProductImage({
814
824
  }
815
825
 
816
826
  const placementDesigns: Record<string, PlacementDesign> = {};
817
- if (getPlacementDesign && placements) {
827
+ if ((getPlacementDesign || placementArt) && placements) {
818
828
  for (const p of placements) {
819
829
  // Skip color placements - treat null/undefined/missing type as "image" (default)
820
830
  if (p.type === "color") continue;
821
- const design = getPlacementDesign(p.label);
822
- // Always create a placement design with current artwork
831
+ const design = getPlacementDesign?.(p.label);
832
+ // Always create a placement design with current artwork (its own picture under PlacementArt)
823
833
  // Use alignment from context if available, otherwise default to center
824
834
  placementDesigns[p.label] = {
825
- imageUrl: effectiveArtworkSrc,
835
+ imageUrl: placementArtFor(placementArt, p, effectiveArtworkSrc),
826
836
  alignment: design?.alignment || "center",
827
837
  };
828
838
  }
@@ -866,6 +876,7 @@ export const HeroProductImage = memo(function HeroProductImage({
866
876
  },
867
877
  [
868
878
  getPlacementDesign,
879
+ placementArt,
869
880
  artworkSrc,
870
881
  artworkType,
871
882
  artworkTileCount,
@@ -969,7 +980,7 @@ export const HeroProductImage = memo(function HeroProductImage({
969
980
 
970
981
  // Skip adding layer if realtimeUrl is for the CURRENT artwork
971
982
  // If artwork changed, the realtimeUrl is stale and we should show the new static URL
972
- const currentArtworkSrc = artworkSrc || selectedArtworkSrc;
983
+ const currentArtworkSrc = artIdentity(artworkSrc || selectedArtworkSrc, placementArtKey);
973
984
  const isRealtimeUrlFresh = realtimeUrl && realtimeArtworkSrcRef.current === currentArtworkSrc;
974
985
 
975
986
  if (isRealtimeUrlFresh) {
@@ -0,0 +1,102 @@
1
+ /**
2
+ * PlacementArt: a picture per placement (a product printed piece by piece, www lib/chat-pieces.ts). Without it a hero
3
+ * sends its ONE artwork to every image placement; inside it each placement asks for its own picture (`asset.<key>`).
4
+ * Known case: notebook KVJVVA (three placements: back_cover, front_cover, spine).
5
+ */
6
+ import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
7
+ import React from "react";
8
+ import { render, waitFor, cleanup } from "@testing-library/react";
9
+ import { ordinaryMockups, type CatalogProduct } from "@snowcone-app/sdk";
10
+ import { HeroProductImage } from "../HeroProductImage";
11
+ import { Product } from "../../patterns/Product";
12
+ import { PlacementArt, placementArtFor } from "../../patterns/PlacementArt";
13
+ import { MOBILE_HERO_WIDTH } from "../heroMockupUrl";
14
+ import KVJVVA from "./fixtures/catalog-KVJVVA.json";
15
+
16
+ const SHOP = "2e2c853b83";
17
+ const product = KVJVVA as unknown as CatalogProduct & { id: string; mockups: Array<{ id: string }>; placements: Array<{ label: string; key?: string }> };
18
+ const ONE = "https://agentdraft.storage.snowcone.app/agent-drafts/drf_ZA_IM71v916y.webp";
19
+ const ART = {
20
+ back_cover: "https://agentdraft.storage.snowcone.app/agent-drafts/drf_PLACEDcopy01.webp",
21
+ front_cover: "https://agentdraft.storage.snowcone.app/agent-drafts/drf_PLACEDcopy01-mark.webp",
22
+ spine: "https://agentdraft.storage.snowcone.app/agent-drafts/drf_PLACEDcopy01-ground.png",
23
+ };
24
+
25
+ function Hero({ art, onUrl, realtimeUrl }: { art: Record<string, string> | null | undefined; onUrl?: (url: string) => void; realtimeUrl?: string }) {
26
+ const hero = (
27
+ <HeroProductImage
28
+ productId={product.id}
29
+ artwork={{ type: "regular", src: ONE }}
30
+ placement={product.placements[0].label}
31
+ mockupId={ordinaryMockups(product.mockups)[0].id}
32
+ width={MOBILE_HERO_WIDTH}
33
+ onUrlGenerated={onUrl}
34
+ realtimeUrl={realtimeUrl}
35
+ />
36
+ );
37
+ return (
38
+ <Product productId={product.id} productData={product} initialPlacements={{ Front: { imageUrl: ONE, alignment: "center" as never } }} dataMode="auto">
39
+ {art === undefined ? hero : <PlacementArt art={art}>{hero}</PlacementArt>}
40
+ </Product>
41
+ );
42
+ }
43
+
44
+ async function requested(container: HTMLElement): Promise<URL> {
45
+ await waitFor(() => expect(container.querySelector("img")?.getAttribute("src")).toBeTruthy());
46
+ return new URL(container.querySelector("img")!.getAttribute("src")!);
47
+ }
48
+
49
+ describe("PlacementArt: each placement its own picture", () => {
50
+ beforeEach(() => {
51
+ (window as unknown as { snowcone?: unknown }).snowcone = { shop: SHOP, signMockupUrl: vi.fn(async (u: string) => `${u}&signature=client`) };
52
+ });
53
+ afterEach(() => {
54
+ cleanup();
55
+ delete (window as unknown as { snowcone?: unknown }).snowcone;
56
+ });
57
+
58
+ it("inside it, every placement asks for its own picture", async () => {
59
+ const url = await requested(render(<Hero art={ART} />).container);
60
+ for (const [key, src] of Object.entries(ART)) expect(url.searchParams.get(`asset.${key}`)).toBe(src);
61
+ expect([...url.searchParams.values()]).not.toContain(ONE);
62
+ });
63
+
64
+ it("without it (or with art null), the one artwork goes on every placement, as before (wrong case for a pieced product)", async () => {
65
+ for (const art of [undefined, null]) {
66
+ const url = await requested(render(<Hero art={art} />).container);
67
+ for (const key of Object.keys(ART)) expect(url.searchParams.get(`asset.${key}`)).toBe(ONE);
68
+ cleanup();
69
+ }
70
+ });
71
+
72
+ it("a map that arrives after the first picture (the page asked for it) asks for the pieced picture", async () => {
73
+ // the URL the hero asks for next (its new layer: jsdom never loads it, so it is read where the hero reports it)
74
+ const asked: string[] = [];
75
+ const onUrl = (u: string) => void asked.push(new URL(u).searchParams.get("asset.spine") ?? "");
76
+ const { container, rerender } = render(<Hero art={null} onUrl={onUrl} />);
77
+ expect((await requested(container)).searchParams.get("asset.spine")).toBe(ONE);
78
+ rerender(<Hero art={ART} onUrl={onUrl} />);
79
+ await waitFor(() => expect(asked.at(-1)).toBe(ART.spine));
80
+ expect(asked[0]).toBe(ONE);
81
+ });
82
+
83
+ it("the phone carousel hands back the spread picture it was given (realtimeUrl): the map still replaces it", async () => {
84
+ const urls: string[] = [];
85
+ const onUrl = (u: string) => void urls.push(u);
86
+ const { container, rerender } = render(<Hero art={null} onUrl={onUrl} />);
87
+ await requested(container);
88
+ await waitFor(() => expect(urls.length).toBeGreaterThan(0));
89
+ const spread = urls.at(-1)!;
90
+ // MobileProductCarousel passes the URL the hero generated back as realtimeUrl on its next render
91
+ rerender(<Hero art={null} onUrl={onUrl} realtimeUrl={spread} />);
92
+ rerender(<Hero art={ART} onUrl={onUrl} realtimeUrl={spread} />);
93
+ await waitFor(() => expect(new URL(urls.at(-1)!).searchParams.get("asset.spine")).toBe(ART.spine));
94
+ });
95
+
96
+ it("placementArtFor: by key, else the slugified label, else the hero's own artwork", () => {
97
+ expect(placementArtFor(ART, { label: "Back Cover", key: "back_cover" }, ONE)).toBe(ART.back_cover);
98
+ expect(placementArtFor(ART, { label: "Front Cover" }, ONE)).toBe(ART.front_cover);
99
+ expect(placementArtFor(ART, { label: "Inside", key: "inside" }, ONE)).toBe(ONE);
100
+ expect(placementArtFor(null, { label: "Spine", key: "spine" }, ONE)).toBe(ONE);
101
+ });
102
+ });
package/src/index.ts CHANGED
@@ -177,6 +177,14 @@ export {
177
177
  } from "./patterns/MockupBackground";
178
178
  export type { MockupBackgroundProps } from "./patterns/MockupBackground";
179
179
 
180
+ // PlacementArt - a picture per placement for the heroes inside it (asset.<key>)
181
+ export {
182
+ PlacementArt,
183
+ usePlacementArtOptional,
184
+ placementArtFor,
185
+ } from "./patterns/PlacementArt";
186
+ export type { PlacementArtProps, PlacementArtMap } from "./patterns/PlacementArt";
187
+
180
188
  // ProductPageProvider - Quick-start providers for product pages
181
189
  export {
182
190
  ProductPageProvider,
@@ -0,0 +1,49 @@
1
+ "use client";
2
+
3
+ /**
4
+ * PlacementArt — a picture per placement for every `HeroProductImage` inside it.
5
+ *
6
+ * By default a hero sends its ONE artwork to every image placement of the product. On a product printed piece by
7
+ * piece (an all-over zip hoodie) that spreads one picture over every cut piece, so the zip runs through it. Wrap the
8
+ * heroes in `<PlacementArt art={{ back: url1, front_left: url2, … }}>` and each placement gets its own picture
9
+ * (`asset.<key>` on the mockup URL), keyed by the catalog's placement key (`placements[].key`).
10
+ *
11
+ * `art={null}` (or no provider) leaves heroes as they are. A placement the map does not name keeps the hero's own
12
+ * artwork; a caller that needs every piece covered checks that before it passes the map.
13
+ */
14
+
15
+ import React, { createContext, useContext, useMemo } from "react";
16
+ import { slugifyPlacementKey } from "../composed/heroMockupUrl";
17
+
18
+ /** Placement key → picture URL. */
19
+ export type PlacementArtMap = Readonly<Record<string, string>>;
20
+
21
+ const PlacementArtContext = createContext<PlacementArtMap | null>(null);
22
+
23
+ export interface PlacementArtProps {
24
+ /** Placement key → picture, or null to leave every hero on its own artwork. */
25
+ art: PlacementArtMap | null;
26
+ children: React.ReactNode;
27
+ }
28
+
29
+ export function PlacementArt({ art, children }: PlacementArtProps) {
30
+ // a stable value for an unchanged map, so heroes do not rebuild their URLs on every parent render
31
+ const key = art ? JSON.stringify(art) : "";
32
+ const value = useMemo(() => (key ? (JSON.parse(key) as PlacementArtMap) : null), [key]);
33
+ return <PlacementArtContext.Provider value={value}>{children}</PlacementArtContext.Provider>;
34
+ }
35
+
36
+ /** The nearest PlacementArt's map, or null outside one. */
37
+ export function usePlacementArtOptional(): PlacementArtMap | null {
38
+ return useContext(PlacementArtContext);
39
+ }
40
+
41
+ /** The picture a placement shows: the map's (by the placement's key, else its slugified label), else `fallback`. */
42
+ export function placementArtFor(
43
+ art: PlacementArtMap | null,
44
+ placement: { label: string; key?: string | null },
45
+ fallback: string,
46
+ ): string {
47
+ if (!art) return fallback;
48
+ return art[placement.key || slugifyPlacementKey(placement.label)] ?? fallback;
49
+ }
@@ -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
  }