FIX - boot LB custom app frames

This commit is contained in:
Leon.Schmidt
2026-08-11 19:23:40 +02:00
parent 4be632759b
commit 8b205739a5
3 changed files with 25 additions and 1 deletions
+6 -1
View File
@@ -17,6 +17,7 @@ import type {
} from '@/types/apps'
import {
createCustomAppBridgeRequestHandler,
getCustomAppFrameBootstrapMessages,
getSkyPhoneAppCapabilities,
shouldReportCustomAppReady,
} from '@/utils/customAppBridge'
@@ -266,6 +267,11 @@ function onFrameLoad(): void {
loadTimeout = undefined
}
frameLoaded.value = true
for (const message of getCustomAppFrameBootstrapMessages(
props.app.compatibility,
)) {
postToFrame(message)
}
if (props.app.bridgeMode === 'legacy' || skyBridgeReady.value) {
frameUnavailable.value = false
}
@@ -331,7 +337,6 @@ watch(() => catalog.openRequests[props.app.id], flushOpenRequest, {
:class="{
'custom-app-frame--fix-blur': app.compatibility.fixBlur === true,
}"
:name="app.ownerResource"
:sandbox="sandbox"
:src="frameUrl"
:title="app.name"
@@ -2,6 +2,7 @@ import { beforeEach, describe, expect, it, vi } from 'vitest'
import {
createCustomAppBridgeRequestHandler,
getCustomAppFrameBootstrapMessages,
getSkyPhoneAppCapabilities,
shouldReportCustomAppReady,
type CustomAppBridgeNotification,
@@ -60,6 +61,15 @@ describe('custom app bridge', () => {
expect(shouldReportCustomAppReady('sky', 'bridge-ready')).toBe(true)
})
it('boots LB Phone frames with their documented ready signal', () => {
expect(
getCustomAppFrameBootstrapMessages({ provider: 'lb_phone' }),
).toEqual(['componentsLoaded'])
expect(
getCustomAppFrameBootstrapMessages({ provider: '17mov' }),
).toEqual([])
})
it('passes validated storage data and server response data through', async () => {
source.capabilities = ['device.storage']
storageCall.mockResolvedValue({
+9
View File
@@ -294,6 +294,15 @@ export function shouldReportCustomAppReady(
: signal === 'frame-load'
}
export function getCustomAppFrameBootstrapMessages(
compatibility: Readonly<Record<string, unknown>>,
): readonly unknown[] {
if (compatibility.provider === 'lb_phone') {
return ['componentsLoaded']
}
return []
}
export function createCustomAppBridgeRequestHandler(
dependencies: CustomAppBridgeDependencies,
): {