peachsim 0.1.687 → 0.1.688

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (116) hide show
  1. package/cli/cloud-client.ts +3 -3
  2. package/cli/command-registry.ts +2 -0
  3. package/cli/commands/control.ts +1 -0
  4. package/cli/commands/debug.ts +10 -33
  5. package/cli/commands/do-chain.ts +56 -6
  6. package/cli/commands/inspect/core.ts +2 -0
  7. package/cli/commands/inspect/list.ts +2 -1
  8. package/cli/commands/inspect/settling.ts +17 -3
  9. package/cli/commands/inspect/shared.ts +2 -0
  10. package/cli/commands/inspect/wait-idle.ts +2 -2
  11. package/cli/commands/inspect/wait-ready.ts +3 -3
  12. package/cli/commands/inspect.ts +33 -7
  13. package/cli/commands/location.ts +164 -0
  14. package/cli/commands/platform.ts +1 -1
  15. package/cli/drivers/playwright-sim-host.ts +46 -25
  16. package/cli/main.ts +6 -0
  17. package/detox/index.ts +13 -8
  18. package/dist-lib/agent-daemon-client.cjs +1 -1
  19. package/dist-lib/agent-events.cjs +1 -1
  20. package/dist-lib/agent-identity.cjs +1 -1
  21. package/dist-lib/agent-sessions.cjs +1 -1
  22. package/dist-lib/attached-projects.cjs +1 -1
  23. package/dist-lib/auth/shared-session.cjs +1 -1
  24. package/dist-lib/backend-origin.cjs +1 -1
  25. package/dist-lib/beta.cjs +1 -1
  26. package/dist-lib/beta.mjs +1 -1
  27. package/dist-lib/bridge-constants.cjs +4 -3
  28. package/dist-lib/bridge-contract-input.cjs +12 -1
  29. package/dist-lib/bridge-contract-input.mjs +12 -1
  30. package/dist-lib/bridge-contract.cjs +4 -3
  31. package/dist-lib/bridge-contract.mjs +4 -3
  32. package/dist-lib/capture-contract.cjs +1 -1
  33. package/dist-lib/capture-contract.mjs +1 -1
  34. package/dist-lib/cli-constants.cjs +1 -1
  35. package/dist-lib/cloud-contract.cjs +2 -1
  36. package/dist-lib/cloud-contract.mjs +2 -1
  37. package/dist-lib/cloud-test-args.cjs +1 -1
  38. package/dist-lib/cloud-test-args.mjs +1 -1
  39. package/dist-lib/cloud.cjs +2 -1
  40. package/dist-lib/cloud.mjs +2 -1
  41. package/dist-lib/config.cjs +1 -1
  42. package/dist-lib/detox/index.cjs +1197 -65
  43. package/dist-lib/dev-bundle-resolution.cjs +1 -1
  44. package/dist-lib/home-paths.cjs +1 -1
  45. package/dist-lib/host/bridge-host.cjs +362 -108
  46. package/dist-lib/host/fetch-proxy-handler.cjs +50 -40
  47. package/dist-lib/host/fetch-proxy-overrides.cjs +50 -6
  48. package/dist-lib/host/fetch-proxy-overrides.mjs +48 -5
  49. package/dist-lib/host/replacement-module-handler.cjs +1 -1
  50. package/dist-lib/host/websocket-proxy.cjs +1 -1
  51. package/dist-lib/index.cjs +29 -11
  52. package/dist-lib/jump-to-source-babel.cjs +1 -1
  53. package/dist-lib/jump-to-source-native.cjs +1 -1
  54. package/dist-lib/kotlin-host.cjs +89 -13
  55. package/dist-lib/menu.cjs +1 -1
  56. package/dist-lib/menu.mjs +1 -1
  57. package/dist-lib/metro-fingerprint-registry.cjs +1 -1
  58. package/dist-lib/metro-fingerprint-registry.mjs +1 -1
  59. package/dist-lib/metro-production-bundle.cjs +1 -1
  60. package/dist-lib/metro-production-bundle.mjs +1 -1
  61. package/dist-lib/metro.cjs +5 -3
  62. package/dist-lib/native-app-identity.cjs +8 -3
  63. package/dist-lib/native-app-identity.mjs +8 -3
  64. package/dist-lib/native-firebase-metadata.cjs +1 -1
  65. package/dist-lib/native-firebase-metadata.mjs +1 -1
  66. package/dist-lib/plist.cjs +1 -1
  67. package/dist-lib/plist.mjs +1 -1
  68. package/dist-lib/profiles.cjs +1 -1
  69. package/dist-lib/public-brand.cjs +1 -1
  70. package/dist-lib/react-native-host-modules.cjs +1 -1
  71. package/dist-lib/react-native-host-modules.mjs +1 -1
  72. package/dist-lib/render-mode.cjs +1 -1
  73. package/dist-lib/scripts/dev-server-scanner.cjs +2 -2
  74. package/dist-lib/sdk.cjs +21 -6
  75. package/dist-lib/sdk.mjs +21 -6
  76. package/dist-lib/skills.cjs +401 -130
  77. package/dist-lib/swift-compile.cjs +277 -22
  78. package/dist-lib/swift-compile.mjs +275 -22
  79. package/dist-lib/swift-package.cjs +1 -1
  80. package/dist-lib/swift-package.mjs +1 -1
  81. package/dist-lib/swift-submit.cjs +2 -2
  82. package/dist-lib/swift-submit.mjs +2 -2
  83. package/dist-lib/swift-toolchain.cjs +10 -10
  84. package/dist-lib/swift.cjs +1 -1
  85. package/dist-lib/vite-swift.cjs +280 -44
  86. package/dist-lib/vite.cjs +1 -1
  87. package/kotlin/AppSources/android/content/res/Configuration.kt +2 -0
  88. package/kotlin/AppSources/android/content/res/Resources.kt +6 -3
  89. package/kotlin/AppSources/android/util/DisplayMetrics.kt +12 -0
  90. package/kotlin/AppSources/androidx/compose/ui/res/PainterResources.kt +70 -0
  91. package/kotlin/AppSources/dev/peach/app/PeachApp.kt +12 -10
  92. package/kotlin/AppSources/dev/peach/app/PeachDrawable.kt +95 -0
  93. package/kotlin/fixtures/kotlin-app-variants/Bitmaps.kt +50 -0
  94. package/kotlin/fixtures/kotlin-app-variants/Drawables.kt +53 -0
  95. package/package.json +2 -2
  96. package/scripts/dev-server-scanner.ts +3 -1
  97. package/skills/contrast/SKILL.md +1 -0
  98. package/src/android-drawables.ts +315 -0
  99. package/src/android-theme.ts +9 -0
  100. package/src/bridge-constants.ts +3 -2
  101. package/src/bridge-contract-input.ts +11 -0
  102. package/src/bridge-contract.ts +45 -3
  103. package/src/cloud-contract.ts +1 -0
  104. package/src/host/fetch-proxy-handler.ts +13 -49
  105. package/src/host/fetch-proxy-overrides.ts +69 -12
  106. package/src/kotlin-app.ts +6 -0
  107. package/src/kotlin-host.ts +103 -15
  108. package/src/native-app-identity.ts +16 -3
  109. package/src/swift-compile.ts +366 -24
  110. package/src/swift-distribution-contract.ts +11 -4
  111. package/src/swift-distribution.lock.json +11 -9
  112. package/src/swift-distribution.ts +4 -4
  113. package/src/swift-icu.ts +8 -11
  114. package/src/swift-submit.ts +13 -1
  115. package/src/swift-toolchain.ts +17 -9
  116. package/src/vite-plugin.ts +86 -34
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.687 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.688 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
3
3
  "use strict";
4
4
  var __defProp = Object.defineProperty;
@@ -50,6 +50,8 @@ function isNativeAppIdentity(value) {
50
50
  if (platform !== "ios" && platform !== "android") return false;
51
51
  const applicationName = value.applicationName;
52
52
  if (applicationName !== null && nonEmptyString(applicationName) === null) return false;
53
+ if (value.bundleName !== void 0 && nonEmptyString(value.bundleName) === null)
54
+ return false;
53
55
  if (nonEmptyString(value.appVersion) === null) return false;
54
56
  if (nonEmptyString(value.bundleIdentifier) === null) return false;
55
57
  const buildVersion = nonEmptyString(value.buildVersion);
@@ -64,6 +66,7 @@ function readNativeAppIdentity(value) {
64
66
  }
65
67
  return {
66
68
  applicationName: value.applicationName,
69
+ ...value.bundleName === void 0 ? {} : { bundleName: value.bundleName },
67
70
  appVersion: value.appVersion,
68
71
  buildVersion: value.buildVersion,
69
72
  bundleIdentifier: value.bundleIdentifier,
@@ -252,12 +255,13 @@ function nativeAppIdentityFromIos(files, parseInfoPlist) {
252
255
  settings.CURRENT_PROJECT_VERSION
253
256
  );
254
257
  if (!appVersion || !buildVersion) return null;
255
- const applicationName = identityFieldFrom(settings, plistString(plist, "CFBundleDisplayName"), void 0) ?? identityFieldFrom(
258
+ const bundleName = identityFieldFrom(
256
259
  settings,
257
260
  plistString(plist, "CFBundleName"),
258
261
  settings.PRODUCT_NAME
259
262
  ) ?? resolvedIdentityField(resolveBuildSetting(settings.PRODUCT_NAME ?? "", settings)) ?? resolvedIdentityField(targetName);
260
- if (!applicationName) return null;
263
+ if (!bundleName) return null;
264
+ const applicationName = identityFieldFrom(settings, plistString(plist, "CFBundleDisplayName"), void 0) ?? bundleName;
261
265
  const dictionary = parseInfoPlist(plist);
262
266
  if (!isRecord(dictionary)) throw new Error("native app Info.plist is not a dictionary");
263
267
  const permissionUsageDescriptions = {};
@@ -283,6 +287,7 @@ function nativeAppIdentityFromIos(files, parseInfoPlist) {
283
287
  }
284
288
  return {
285
289
  applicationName,
290
+ bundleName,
286
291
  appVersion,
287
292
  buildVersion,
288
293
  bundleIdentifier,
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.687 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.688 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
 
3
3
  // src/native-app-identity.ts
4
4
  var NATIVE_APP_IDENTITY_PREFIX = "globalThis.__sootsimNativeAppIdentity=";
@@ -17,6 +17,8 @@ function isNativeAppIdentity(value) {
17
17
  if (platform !== "ios" && platform !== "android") return false;
18
18
  const applicationName = value.applicationName;
19
19
  if (applicationName !== null && nonEmptyString(applicationName) === null) return false;
20
+ if (value.bundleName !== void 0 && nonEmptyString(value.bundleName) === null)
21
+ return false;
20
22
  if (nonEmptyString(value.appVersion) === null) return false;
21
23
  if (nonEmptyString(value.bundleIdentifier) === null) return false;
22
24
  const buildVersion = nonEmptyString(value.buildVersion);
@@ -31,6 +33,7 @@ function readNativeAppIdentity(value) {
31
33
  }
32
34
  return {
33
35
  applicationName: value.applicationName,
36
+ ...value.bundleName === void 0 ? {} : { bundleName: value.bundleName },
34
37
  appVersion: value.appVersion,
35
38
  buildVersion: value.buildVersion,
36
39
  bundleIdentifier: value.bundleIdentifier,
@@ -219,12 +222,13 @@ function nativeAppIdentityFromIos(files, parseInfoPlist) {
219
222
  settings.CURRENT_PROJECT_VERSION
220
223
  );
221
224
  if (!appVersion || !buildVersion) return null;
222
- const applicationName = identityFieldFrom(settings, plistString(plist, "CFBundleDisplayName"), void 0) ?? identityFieldFrom(
225
+ const bundleName = identityFieldFrom(
223
226
  settings,
224
227
  plistString(plist, "CFBundleName"),
225
228
  settings.PRODUCT_NAME
226
229
  ) ?? resolvedIdentityField(resolveBuildSetting(settings.PRODUCT_NAME ?? "", settings)) ?? resolvedIdentityField(targetName);
227
- if (!applicationName) return null;
230
+ if (!bundleName) return null;
231
+ const applicationName = identityFieldFrom(settings, plistString(plist, "CFBundleDisplayName"), void 0) ?? bundleName;
228
232
  const dictionary = parseInfoPlist(plist);
229
233
  if (!isRecord(dictionary)) throw new Error("native app Info.plist is not a dictionary");
230
234
  const permissionUsageDescriptions = {};
@@ -250,6 +254,7 @@ function nativeAppIdentityFromIos(files, parseInfoPlist) {
250
254
  }
251
255
  return {
252
256
  applicationName,
257
+ bundleName,
253
258
  appVersion,
254
259
  buildVersion,
255
260
  bundleIdentifier,
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.687 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.688 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
3
3
  "use strict";
4
4
  var __defProp = Object.defineProperty;
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.687 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.688 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
 
3
3
  // src/native-firebase-metadata.ts
4
4
  var PREFIX = "globalThis.__peachNativeFirebaseConfig=";
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.687 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.688 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
3
3
  "use strict";
4
4
  var __create = Object.create;
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.687 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.688 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
 
3
3
  // src/plist.ts
4
4
  import plistModule from "@expo/plist";
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.687 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.688 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
3
3
  "use strict";
4
4
  var __create = Object.create;
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.687 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.688 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
3
3
  "use strict";
4
4
  var __defProp = Object.defineProperty;
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.687 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.688 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
3
3
  "use strict";
4
4
  var __defProp = Object.defineProperty;
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.687 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.688 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
 
3
3
  // src/react-native-host-modules.ts
4
4
  var REACT_NATIVE_PASSTHROUGH_SPECIFIERS = [
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.687 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.688 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
3
3
  "use strict";
4
4
  var __defProp = Object.defineProperty;
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.687 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.688 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
3
3
  "use strict";
4
4
  var __create = Object.create;
@@ -1403,7 +1403,7 @@ async function scanDevServers(opts = {}) {
1403
1403
  for (const pid of [...cwdByPid.keys()]) {
1404
1404
  if (!livePids.has(pid)) cwdByPid.delete(pid);
1405
1405
  }
1406
- return results.filter((r) => !isSootSimSelfServer(r));
1406
+ return results.filter((r) => !isSootSimSelfServer(r)).sort((a, b) => a.port - b.port);
1407
1407
  }
1408
1408
  // Annotate the CommonJS export names for ESM import in node:
1409
1409
  0 && (module.exports = {
package/dist-lib/sdk.cjs CHANGED
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.687 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.688 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  let __sootsim_import_meta_url = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; } catch {}
3
3
  "use strict";
4
4
  var __defProp = Object.defineProperty;
@@ -111,10 +111,10 @@ var SEMANTIC_READY_CONTENT_NODE_FLOOR = 100;
111
111
  var PUBLIC_NO_NETWORK_MARKER = "public Peach Cloud simulators have no network";
112
112
  var HEADLESS_TENANT_FETCH_HUNG_MARKER = "headless tenant fetch hung";
113
113
  function readyProbeHasContent(probe) {
114
- return probe.liveFrameActive || probe.targets > 0 || probe.nodes >= SEMANTIC_READY_CONTENT_NODE_FLOOR;
114
+ return (probe.browserSurfaceCount ?? 0) > 0 || probe.liveFrameActive || probe.targets > 0 || probe.nodes >= SEMANTIC_READY_CONTENT_NODE_FLOOR;
115
115
  }
116
116
  function readyProbeHasTargetContent(probe) {
117
- return probe.liveFrameActive || probe.targets > 0;
117
+ return (probe.browserSurfaceCount ?? 0) > 0 || probe.liveFrameActive || probe.targets > 0;
118
118
  }
119
119
  function readyProbeIsReady(probe) {
120
120
  return (probe.flag === true ? readyProbeHasContent(probe) : readyProbeHasTargetContent(probe)) && probe.externalReady !== false && !probe.externalError && !probe.loadingText;
@@ -903,6 +903,7 @@ function waitReadyStatus(result, ready) {
903
903
  nodes: probe?.nodes ?? 0,
904
904
  targets: probe?.targets ?? 0,
905
905
  liveFrameActive: probe?.liveFrameActive ?? false,
906
+ browserSurfaceCount: probe?.browserSurfaceCount ?? 0,
906
907
  liveFrameChannels: probe?.liveFrameChannels ?? 0,
907
908
  liveFramePublishes: probe?.liveFramePublishes ?? 0,
908
909
  flag: probe?.flag,
@@ -1564,6 +1565,16 @@ async function waitForSootsimIdle({
1564
1565
  let requestInFlight = 0
1565
1566
  let renderStatsAvailable = false
1566
1567
  let frameCount = -1
1568
+ let shellAnimating = false
1569
+ // strict also waits out shell motion: a system alert, sheet or menu
1570
+ // animates in the shell worker while the app's own stats read still,
1571
+ // so its presentation is complete only once the shell's list empties.
1572
+ if (strict) {
1573
+ try {
1574
+ const motion = await window.__sootsimTest?.listAnimations?.()
1575
+ shellAnimating = Array.isArray(motion) && motion.some((anim) => anim.realm === 'shell')
1576
+ } catch {}
1577
+ }
1567
1578
  try {
1568
1579
  const stats = await window.__sootsimRenderHost?.queryStats?.()
1569
1580
  if (stats) {
@@ -1601,7 +1612,7 @@ async function waitForSootsimIdle({
1601
1612
  }
1602
1613
  walk(root)
1603
1614
  }
1604
- return { layout: nodes.join(';'), frameCount, animating, layoutDirty, pendingFetches, renderStatsAvailable, requestTotal, requestInFlight }
1615
+ return { layout: nodes.join(';'), frameCount, animating, shellAnimating, layoutDirty, pendingFetches, renderStatsAvailable, requestTotal, requestInFlight }
1605
1616
  }
1606
1617
 
1607
1618
  // how long generic background network is allowed to keep us waiting AFTER
@@ -1632,13 +1643,16 @@ async function waitForSootsimIdle({
1632
1643
  const snapshot = await readSnapshot()
1633
1644
  polls++
1634
1645
  if (snapshot.layoutDirty) dirtyPolls++
1635
- if (snapshot.animating) animatingPolls++
1646
+ if (snapshot.animating || snapshot.shellAnimating) animatingPolls++
1636
1647
  if (polls > 1 && snapshot.layout !== lastLayout) layoutChangedPolls++
1637
1648
  const painted = paintStill && snapshot.frameCount !== lastFrameCount
1638
1649
  if (polls > 1 && painted) paintedPolls++
1639
1650
  const strictOk =
1640
1651
  !strict ||
1641
- (snapshot.renderStatsAvailable && !snapshot.animating && !snapshot.layoutDirty)
1652
+ (snapshot.renderStatsAvailable &&
1653
+ !snapshot.animating &&
1654
+ !snapshot.shellAnimating &&
1655
+ !snapshot.layoutDirty)
1642
1656
  // visually settled: no animations, no image content loading, layout
1643
1657
  // unchanged since the last poll.
1644
1658
  const visuallyStill =
@@ -1674,6 +1688,7 @@ async function waitForSootsimIdle({
1674
1688
  const blockers = []
1675
1689
  if (strict && !last.renderStatsAvailable) blockers.push('render stats unavailable')
1676
1690
  if (last.animating) blockers.push('animations still running')
1691
+ if (last.shellAnimating) blockers.push('shell animations still running')
1677
1692
  if (last.layoutDirty) blockers.push('layout still dirty')
1678
1693
  if (last.pendingFetches > 0) blockers.push(last.pendingFetches + ' image fetches pending')
1679
1694
  if (last.layout !== lastLayout) blockers.push('layout still changing')
package/dist-lib/sdk.mjs CHANGED
@@ -1,4 +1,4 @@
1
- /*! rnx v0.1.687 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
1
+ /*! rnx v0.1.688 | (c) 2026 Tamagui LLC | Proprietary — see LICENSE */
2
2
  var __defProp = Object.defineProperty;
3
3
  var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
4
4
  var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
@@ -8,10 +8,10 @@ var SEMANTIC_READY_CONTENT_NODE_FLOOR = 100;
8
8
  var PUBLIC_NO_NETWORK_MARKER = "public Peach Cloud simulators have no network";
9
9
  var HEADLESS_TENANT_FETCH_HUNG_MARKER = "headless tenant fetch hung";
10
10
  function readyProbeHasContent(probe) {
11
- return probe.liveFrameActive || probe.targets > 0 || probe.nodes >= SEMANTIC_READY_CONTENT_NODE_FLOOR;
11
+ return (probe.browserSurfaceCount ?? 0) > 0 || probe.liveFrameActive || probe.targets > 0 || probe.nodes >= SEMANTIC_READY_CONTENT_NODE_FLOOR;
12
12
  }
13
13
  function readyProbeHasTargetContent(probe) {
14
- return probe.liveFrameActive || probe.targets > 0;
14
+ return (probe.browserSurfaceCount ?? 0) > 0 || probe.liveFrameActive || probe.targets > 0;
15
15
  }
16
16
  function readyProbeIsReady(probe) {
17
17
  return (probe.flag === true ? readyProbeHasContent(probe) : readyProbeHasTargetContent(probe)) && probe.externalReady !== false && !probe.externalError && !probe.loadingText;
@@ -800,6 +800,7 @@ function waitReadyStatus(result, ready) {
800
800
  nodes: probe?.nodes ?? 0,
801
801
  targets: probe?.targets ?? 0,
802
802
  liveFrameActive: probe?.liveFrameActive ?? false,
803
+ browserSurfaceCount: probe?.browserSurfaceCount ?? 0,
803
804
  liveFrameChannels: probe?.liveFrameChannels ?? 0,
804
805
  liveFramePublishes: probe?.liveFramePublishes ?? 0,
805
806
  flag: probe?.flag,
@@ -1461,6 +1462,16 @@ async function waitForSootsimIdle({
1461
1462
  let requestInFlight = 0
1462
1463
  let renderStatsAvailable = false
1463
1464
  let frameCount = -1
1465
+ let shellAnimating = false
1466
+ // strict also waits out shell motion: a system alert, sheet or menu
1467
+ // animates in the shell worker while the app's own stats read still,
1468
+ // so its presentation is complete only once the shell's list empties.
1469
+ if (strict) {
1470
+ try {
1471
+ const motion = await window.__sootsimTest?.listAnimations?.()
1472
+ shellAnimating = Array.isArray(motion) && motion.some((anim) => anim.realm === 'shell')
1473
+ } catch {}
1474
+ }
1464
1475
  try {
1465
1476
  const stats = await window.__sootsimRenderHost?.queryStats?.()
1466
1477
  if (stats) {
@@ -1498,7 +1509,7 @@ async function waitForSootsimIdle({
1498
1509
  }
1499
1510
  walk(root)
1500
1511
  }
1501
- return { layout: nodes.join(';'), frameCount, animating, layoutDirty, pendingFetches, renderStatsAvailable, requestTotal, requestInFlight }
1512
+ return { layout: nodes.join(';'), frameCount, animating, shellAnimating, layoutDirty, pendingFetches, renderStatsAvailable, requestTotal, requestInFlight }
1502
1513
  }
1503
1514
 
1504
1515
  // how long generic background network is allowed to keep us waiting AFTER
@@ -1529,13 +1540,16 @@ async function waitForSootsimIdle({
1529
1540
  const snapshot = await readSnapshot()
1530
1541
  polls++
1531
1542
  if (snapshot.layoutDirty) dirtyPolls++
1532
- if (snapshot.animating) animatingPolls++
1543
+ if (snapshot.animating || snapshot.shellAnimating) animatingPolls++
1533
1544
  if (polls > 1 && snapshot.layout !== lastLayout) layoutChangedPolls++
1534
1545
  const painted = paintStill && snapshot.frameCount !== lastFrameCount
1535
1546
  if (polls > 1 && painted) paintedPolls++
1536
1547
  const strictOk =
1537
1548
  !strict ||
1538
- (snapshot.renderStatsAvailable && !snapshot.animating && !snapshot.layoutDirty)
1549
+ (snapshot.renderStatsAvailable &&
1550
+ !snapshot.animating &&
1551
+ !snapshot.shellAnimating &&
1552
+ !snapshot.layoutDirty)
1539
1553
  // visually settled: no animations, no image content loading, layout
1540
1554
  // unchanged since the last poll.
1541
1555
  const visuallyStill =
@@ -1571,6 +1585,7 @@ async function waitForSootsimIdle({
1571
1585
  const blockers = []
1572
1586
  if (strict && !last.renderStatsAvailable) blockers.push('render stats unavailable')
1573
1587
  if (last.animating) blockers.push('animations still running')
1588
+ if (last.shellAnimating) blockers.push('shell animations still running')
1574
1589
  if (last.layoutDirty) blockers.push('layout still dirty')
1575
1590
  if (last.pendingFetches > 0) blockers.push(last.pendingFetches + ' image fetches pending')
1576
1591
  if (last.layout !== lastLayout) blockers.push('layout still changing')