From 5dba13ce4bb855fa1098bdca2bed22f378e0c32c Mon Sep 17 00:00:00 2001 From: Alec Schitzkat Date: Thu, 20 Aug 2026 18:56:34 +0200 Subject: [PATCH] FIX - Implement LB guest app layout and lifecycle bridge Ensure custom LB apps are properly sized and visible by applying the required CSS contract on initialization and upon receiving the 'componentsLoaded' signal. --- frontend/src/utils/lbPhoneAppBridge.test.ts | 74 +++++++++++++++++++++ frontend/src/utils/lbPhoneAppBridge.ts | 29 +++++++- 2 files changed, 102 insertions(+), 1 deletion(-) diff --git a/frontend/src/utils/lbPhoneAppBridge.test.ts b/frontend/src/utils/lbPhoneAppBridge.test.ts index aca7ba1..1a8c3fd 100644 --- a/frontend/src/utils/lbPhoneAppBridge.test.ts +++ b/frontend/src/utils/lbPhoneAppBridge.test.ts @@ -1,4 +1,5 @@ import { describe, expect, it } from 'vitest' +import { runInNewContext } from 'node:vm' import type { ExternalPhoneAppDefinition } from '@/types/apps' import { @@ -139,6 +140,79 @@ describe('LB Phone app bridge', () => { expect(() => new Function(runtime)).not.toThrow() }) + it('applies the LB iframe layout contract before revealing vendor apps', () => { + const document = createLbPhoneFrameDocument( + '', + { + appName: 'radio-app', + localStorage: {}, + resourceName: 'lb-radioapp', + settings: createLbPhoneHostSettings({ + deviceName: 'Main phone', + isDarkMode: true, + language: 'en', + preferences: DEFAULT_PHONE_PREFERENCES, + securityEnabled: false, + }), + ui: 'https://cfx-nui-lb-radioapp/ui/dist/index.html', + }, + ) + const runtime = /