Files
orca/mobile/scripts/hosted-ios-settings-navigation.mjs
T
Jinwoo-H dd93e3b007 feat(mobile-web): host browser preferences and the settings menu
Share native presentation and apply paired-host page preferences to terminal link behavior. Preserve inherited native values, handle storage failures, and verify saved values plus Chat route recovery through a real iOS WebView restart.
2026-09-06 20:56:20 -04:00

38 lines
1.3 KiB
JavaScript

import {
activateHostedWebViewControl,
waitForVisibleHostedWebView
} from './hosted-webview-cdp-session.mjs'
export async function openHostedIosSettings(args, workspaceDocument, label, route, text) {
await activateHostedWebViewControl(workspaceDocument, { kind: 'label', value: 'Settings' })
const menu = await waitForVisibleHostedWebView({
discoveryUrl: args.discoveryUrl,
expectedHrefIncludes: '/settings',
expectedText: 'Chat UI',
timeoutMs: args.timeoutMs
})
await activateHostedWebViewControl(menu, { kind: 'label', value: label })
return waitForVisibleHostedWebView({
discoveryUrl: args.discoveryUrl,
expectedHrefIncludes: route,
expectedText: text,
timeoutMs: args.timeoutMs
})
}
export async function closeHostedIosSettings(args, document) {
await activateHostedWebViewControl(document, { kind: 'label', value: 'Back' })
const menu = await waitForVisibleHostedWebView({
discoveryUrl: args.discoveryUrl,
expectedHrefIncludes: '/settings',
expectedText: 'Chat UI',
timeoutMs: args.timeoutMs
})
await activateHostedWebViewControl(menu, { kind: 'label', value: 'Back' })
return waitForVisibleHostedWebView({
discoveryUrl: args.discoveryUrl,
expectedText: args.expectedWorkspace,
timeoutMs: args.timeoutMs
})
}