Wait for the Even app host before choosing browser-preview mode

Found on the first real-phone run: the Even app's WebView provided
window.flutter_inappwebview after the page's script had started, so the
page wrongly fell back to browser-preview mode and never created the HUD
page on the glasses. The page now waits (up to 6 s, polling and listening
for the WebView's platform-ready event) and, if the host appears later
still, reloads once into the real mode. Diagnostics show how long
detection took and the browser's user agent.

Tests: 205 passed (7 new); simulator 6 passed. Not reviewed.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
Dan
2026-11-21 12:14:39 -08:00
co-authored by Claude Fable 5.2
parent 98c7b03aa7
commit e5559dc5e7
4 changed files with 199 additions and 4 deletions
+1
View File
@@ -196,6 +196,7 @@ export function mountPhoneUi(root: HTMLElement, controller: Controller, defaults
rows(diagList, [
['Runtime', defaults.runtime],
['Page origin', location.origin],
['Browser', navigator.userAgent],
['HUD page', s.hudReady ? 'created' : 'not created'],
['Device id', s.deviceId || 'none'],
['Conversation id', s.state.conversationId ?? 'none'],