From 357f1161ea7aaa2646cfdaa3fc952a3d32a577ae Mon Sep 17 00:00:00 2001 From: andriiboliboksc <45969256+andriiboliboksc@users.noreply.github.com> Date: Thu, 9 Jul 2026 19:47:33 +0200 Subject: [PATCH 1/8] Update usePlaybackOptions.ts --- src/usePlaybackOptions.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/usePlaybackOptions.ts b/src/usePlaybackOptions.ts index 5344b2f..3811952 100644 --- a/src/usePlaybackOptions.ts +++ b/src/usePlaybackOptions.ts @@ -78,9 +78,10 @@ export function usePlaybackOptions(options: PlaybackOptions) { }, [currentSession, sdkStatus, options.muted, setMuted, log]); useEffect(() => { - if (sdkStatus !== "ready" || !currentSession || !options.screenRegions) return; - - setScreenRegions(options.screenRegions).catch((error) => { + if (sdkStatus !== "ready" || !currentSession) return; + + // Coalesce to {} so clearing the prop clears the regions — setScreenRegions replaces the full set. + setScreenRegions(options.screenRegions ?? {}).catch((error) => { log.error("screen_regions_apply_failed", { screenRegions: options.screenRegions }, error); }); }, [currentSession, sdkStatus, options.screenRegions, setScreenRegions, log]); From 25a61e88bb70d2b07c558308d3a5dd570303b491 Mon Sep 17 00:00:00 2001 From: andriiboliboksc <45969256+andriiboliboksc@users.noreply.github.com> Date: Thu, 9 Jul 2026 19:51:54 +0200 Subject: [PATCH 2/8] Update package.json --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index ea68024..d98013d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@snap/react-camera-kit", - "version": "0.5.0", + "version": "0.5.1", "description": "React Camera Kit for web applications", "type": "module", "main": "./dist/cjs/index.js", From dc813c5d01f7fdf876abaf9e4410743ff1a90c0b Mon Sep 17 00:00:00 2001 From: andriiboliboksc <45969256+andriiboliboksc@users.noreply.github.com> Date: Thu, 9 Jul 2026 19:53:17 +0200 Subject: [PATCH 3/8] Update package-lock.json --- package-lock.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index 4664eed..9c2975e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@snap/react-camera-kit", - "version": "0.5.0", + "version": "0.5.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@snap/react-camera-kit", - "version": "0.5.0", + "version": "0.5.1", "license": "MIT", "dependencies": { "stable-hash": "^0.0.6" From 0fc2651299ff181f4af84828789e687505141c5a Mon Sep 17 00:00:00 2001 From: andriiboliboksc <45969256+andriiboliboksc@users.noreply.github.com> Date: Thu, 9 Jul 2026 20:14:47 +0200 Subject: [PATCH 4/8] Update usePlaybackOptions.ts --- src/usePlaybackOptions.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/src/usePlaybackOptions.ts b/src/usePlaybackOptions.ts index 3811952..f817687 100644 --- a/src/usePlaybackOptions.ts +++ b/src/usePlaybackOptions.ts @@ -79,7 +79,6 @@ export function usePlaybackOptions(options: PlaybackOptions) { useEffect(() => { if (sdkStatus !== "ready" || !currentSession) return; - // Coalesce to {} so clearing the prop clears the regions — setScreenRegions replaces the full set. setScreenRegions(options.screenRegions ?? {}).catch((error) => { log.error("screen_regions_apply_failed", { screenRegions: options.screenRegions }, error); From 556592e0822db95df20110ebeb1bc8860b942a6d Mon Sep 17 00:00:00 2001 From: andriiboliboksc <45969256+andriiboliboksc@users.noreply.github.com> Date: Thu, 9 Jul 2026 20:17:38 +0200 Subject: [PATCH 5/8] Update usePlaybackOptions.test.ts --- src/usePlaybackOptions.test.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/usePlaybackOptions.test.ts b/src/usePlaybackOptions.test.ts index 9043f2f..8acace0 100644 --- a/src/usePlaybackOptions.test.ts +++ b/src/usePlaybackOptions.test.ts @@ -202,11 +202,13 @@ describe("usePlaybackOptions", () => { }); }); - it("should not set screen regions when undefined", () => { + it("should clear screen regions when undefined", async () => { const options: PlaybackOptions = {}; renderHook(() => usePlaybackOptions(options)); - expect(mockSetScreenRegions).not.toHaveBeenCalled(); + await waitFor(() => { + expect(mockSetScreenRegions).toHaveBeenCalledWith({}); + }); }); it("should update screen regions when changed", async () => { From 1338ba1136c3d183319ff4457d371e171f2d2b66 Mon Sep 17 00:00:00 2001 From: andriiboliboksc <45969256+andriiboliboksc@users.noreply.github.com> Date: Mon, 13 Jul 2026 16:13:19 +0200 Subject: [PATCH 6/8] Update usePlaybackOptions.ts --- src/usePlaybackOptions.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/usePlaybackOptions.ts b/src/usePlaybackOptions.ts index f817687..9781220 100644 --- a/src/usePlaybackOptions.ts +++ b/src/usePlaybackOptions.ts @@ -21,11 +21,14 @@ export interface PlaybackOptions { muted?: boolean; /** - * Configuration object containing the current set of screen regions. + * Configuration object containing the complete set of active screen regions. * * Screen regions define areas of the screen that have special meaning for Lens rendering, * such as safe rendering areas, UI button locations, keyboard areas, etc. This allows lenses * to adapt their content placement based on the host application's UI layout. + * + * This value is applied as a full replacement set: regions not included in the object are + * removed. Pass `undefined` or omit this option to clear all screen regions. */ screenRegions?: ScreenRegions; From 8b900e7ba5dc881a28e01e8cffeaadde7e9088eb Mon Sep 17 00:00:00 2001 From: andriiboliboksc <45969256+andriiboliboksc@users.noreply.github.com> Date: Mon, 13 Jul 2026 16:13:53 +0200 Subject: [PATCH 7/8] Update LensPlayer.tsx --- src/LensPlayer.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/LensPlayer.tsx b/src/LensPlayer.tsx index bf463b1..6e236ca 100644 --- a/src/LensPlayer.tsx +++ b/src/LensPlayer.tsx @@ -60,11 +60,14 @@ export interface LensPlayerProps { muted?: boolean; /** - * Configuration object containing the current set of screen regions. + * Configuration object containing the complete set of active screen regions. * * Screen regions define areas of the screen that have special meaning for Lens rendering, * such as safe rendering areas, UI button locations, keyboard areas, etc. This allows lenses * to adapt their content placement based on the host application's UI layout. + * + * This value is applied as a full replacement set: regions not included in the object are + * removed. Pass `undefined` or omit this option to clear all screen regions. */ screenRegions?: ScreenRegions; From 6c693db8a7322cbb70959cf20b83dce45cb48246 Mon Sep 17 00:00:00 2001 From: andriiboliboksc <45969256+andriiboliboksc@users.noreply.github.com> Date: Mon, 13 Jul 2026 16:16:46 +0200 Subject: [PATCH 8/8] Update usePlaybackOptions.test.ts --- src/usePlaybackOptions.test.ts | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/src/usePlaybackOptions.test.ts b/src/usePlaybackOptions.test.ts index 8acace0..635358b 100644 --- a/src/usePlaybackOptions.test.ts +++ b/src/usePlaybackOptions.test.ts @@ -211,6 +211,28 @@ describe("usePlaybackOptions", () => { }); }); + it("should clear screen regions when they change from set to undefined", async () => { + const regions: any = { + safeRenderArea: { top: 0, left: 0, bottom: 1, right: 1 }, + }; + + const { rerender } = renderHook(({ screenRegions }) => usePlaybackOptions({ screenRegions }), { + initialProps: { screenRegions: regions }, + }); + + await waitFor(() => { + expect(mockSetScreenRegions).toHaveBeenCalledWith(regions); + }); + + mockSetScreenRegions.mockClear(); + + rerender({ screenRegions: undefined }); + + await waitFor(() => { + expect(mockSetScreenRegions).toHaveBeenCalledWith({}); + }); + }); + it("should update screen regions when changed", async () => { const regions1: any = { safeRenderArea: { top: 0, left: 0, bottom: 1, right: 1 },