@wildshard/engine 0.1.15 → 0.1.18

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 (262) hide show
  1. package/CHANGELOG.md +23 -0
  2. package/index.html +157 -11
  3. package/lint/engine-sides.json +23 -0
  4. package/lint/host-callback-syntax.mjs +2 -1
  5. package/lint/host-callbacks.mjs +3 -3
  6. package/lint/host-files.mjs +5 -4
  7. package/lint/host-register.json +496 -0
  8. package/lint/no-base64.mjs +3 -1
  9. package/lint/ratchet.json +2 -2
  10. package/lint/shard-imports.d.mts +1 -0
  11. package/lint/shard-imports.mjs +60 -13
  12. package/lint/shard-source.d.mts +9 -0
  13. package/lint/shard-source.mjs +91 -0
  14. package/lint/shardfile-boundaries.mjs +10 -8
  15. package/lint/sim-closure.mjs +6 -3
  16. package/lint/wildshard-plugin.d.ts +4 -0
  17. package/lint/wildshard-plugin.js +44 -27
  18. package/package.json +24 -6
  19. package/scripts/app-build/buildIdentity.d.mts +3 -1
  20. package/scripts/app-build/buildIdentity.mjs +25 -5
  21. package/scripts/app-build/builtAt.d.mts +4 -0
  22. package/scripts/app-build/builtAt.mjs +21 -0
  23. package/scripts/app-build/outputProducts.d.mts +3 -0
  24. package/scripts/app-build/outputProducts.mjs +31 -0
  25. package/scripts/app-build/serviceWorker.ts +16 -2
  26. package/scripts/app-build/versionFiles.ts +2 -1
  27. package/scripts/app-build-pipeline.mjs +7 -1
  28. package/scripts/audio-download-proof.mjs +843 -0
  29. package/scripts/build-app.mjs +4 -0
  30. package/scripts/build-mirror.d.mts +2 -0
  31. package/scripts/build-mirror.mjs +5 -4
  32. package/scripts/built-product.mjs +3 -3
  33. package/scripts/cell-mem/metrics-preload.mjs +65 -0
  34. package/scripts/cell-mem-bench.mjs +130 -0
  35. package/scripts/check-chunks.mjs +2 -1
  36. package/scripts/check-devserver.mjs +1 -1
  37. package/scripts/chromium-keychain-check.mjs +4 -2
  38. package/scripts/chromium-keychain.mjs +3 -1
  39. package/scripts/cook.mjs +7 -3
  40. package/scripts/devices.d.mts +4 -0
  41. package/scripts/devices.mjs +39 -0
  42. package/scripts/devserver-client.d.mts +7 -0
  43. package/scripts/devserver-client.mjs +85 -0
  44. package/scripts/doctor-proof.mjs +1 -1
  45. package/scripts/e2e-faults.mjs +159 -0
  46. package/scripts/engine-ci-budget.ts +7 -1
  47. package/scripts/format-lock.mjs +20 -11
  48. package/scripts/generate-title-launch.mjs +3 -2
  49. package/scripts/grid-crossing-walk-proof.mjs +30 -11
  50. package/scripts/heavy-lane.py +25 -1
  51. package/scripts/host-ruler/register-migrate.mjs +242 -0
  52. package/scripts/host-ruler/register.d.mts +36 -0
  53. package/scripts/host-ruler/register.mjs +116 -0
  54. package/scripts/host-ruler/roots.d.mts +29 -0
  55. package/scripts/host-ruler/roots.mjs +333 -0
  56. package/scripts/host-ruler/server-roots.d.mts +23 -0
  57. package/scripts/host-ruler/server-roots.mjs +272 -0
  58. package/scripts/main-watch.d.mts +1 -1
  59. package/scripts/main-watch.mjs +10 -6
  60. package/scripts/map-hash.mjs +3 -6
  61. package/scripts/memory-proof.mjs +158 -0
  62. package/scripts/mmo-bots.mjs +2 -2
  63. package/scripts/offline-proof-rules.d.mts +5 -2
  64. package/scripts/offline-proof-rules.mjs +43 -6
  65. package/scripts/offline-proof.mjs +15 -6
  66. package/scripts/online-rig.mjs +4 -4
  67. package/scripts/page-release/flow.d.mts +1 -0
  68. package/scripts/page-release/flow.mjs +6 -2
  69. package/scripts/page-release.mjs +5 -1
  70. package/scripts/physics-route.json +0 -71
  71. package/scripts/pins-catalogue.ts +103 -0
  72. package/scripts/pins-reuse.mjs +3 -1
  73. package/scripts/pins.ts +22 -14
  74. package/scripts/preview-grid.ts +203 -0
  75. package/scripts/road-preload-proof.mjs +167 -0
  76. package/scripts/server-release/publish.mjs +2 -2
  77. package/scripts/server-release/served-slug.d.mts +2 -0
  78. package/scripts/server-release/served-slug.mjs +10 -0
  79. package/scripts/server-release/sign.d.mts +1 -0
  80. package/scripts/server-release/sign.mjs +3 -7
  81. package/scripts/shard-components.mjs +0 -2
  82. package/scripts/shard-outputs.d.mts +8 -0
  83. package/scripts/shard-outputs.mjs +45 -11
  84. package/scripts/side-parity.d.mts +2 -1
  85. package/scripts/side-parity.mjs +25 -4
  86. package/scripts/test-amber.d.mts +1 -0
  87. package/scripts/test-amber.mjs +10 -0
  88. package/scripts/test-products.json +3 -3
  89. package/scripts/tier-textures-proof.mjs +101 -0
  90. package/scripts/tier-textures.mjs +60 -0
  91. package/scripts/tracked-public.d.mts +1 -0
  92. package/scripts/tracked-public.mjs +17 -0
  93. package/scripts/tsconfig.json +1 -0
  94. package/scripts/vps/wildshard-config +79 -23
  95. package/scripts/worker-client-play.mjs +1 -0
  96. package/scripts/worker-client-proof.mjs +1 -1
  97. package/scripts/worker-client-slug.mjs +44 -0
  98. package/src/cli/engine.mjs +8 -0
  99. package/src/client/app/bootRoute.ts +4 -1
  100. package/src/client/app/dropModal.ts +15 -2
  101. package/src/client/app/entry.ts +96 -13
  102. package/src/client/app/slugPath.ts +5 -0
  103. package/src/client/engine/audio/Audio.ts +20 -2
  104. package/src/client/engine/boot/bakedTextures.ts +3 -2
  105. package/src/client/engine/boot/bootTrace.ts +6 -1
  106. package/src/client/engine/boot/bytes.ts +4 -3
  107. package/src/client/engine/boot/clearDownloads.ts +1 -1
  108. package/src/client/engine/boot/contentRead.ts +4 -0
  109. package/src/client/engine/boot/dropNotice.ts +20 -6
  110. package/src/client/engine/boot/gpuFiles.ts +25 -2
  111. package/src/client/engine/boot/lastEnd.ts +8 -2
  112. package/src/client/engine/boot/parsedPages.ts +127 -58
  113. package/src/client/engine/boot/shardPrefetch.ts +7 -1
  114. package/src/client/engine/boot/sw.ts +19 -0
  115. package/src/client/engine/build.d.ts +2 -0
  116. package/src/client/engine/core/Game.ts +29 -3
  117. package/src/client/engine/core/GpuRecovery.ts +7 -0
  118. package/src/client/engine/core/Volumetrics.ts +5 -0
  119. package/src/client/engine/core/assets.ts +27 -20
  120. package/src/client/engine/core/bootstrap.ts +5 -3
  121. package/src/client/engine/core/ktx2.ts +84 -11
  122. package/src/client/engine/debug/probe.ts +18 -1
  123. package/src/client/engine/explore/Compare.ts +2 -2
  124. package/src/client/engine/explore/TouchFly.ts +3 -5
  125. package/src/client/engine/fx/LightPool.ts +41 -1
  126. package/src/client/engine/input/dom.ts +12 -0
  127. package/src/client/engine/net/predictor.ts +6 -2
  128. package/src/client/engine/player/Player.ts +10 -2
  129. package/src/client/engine/player/TouchControls.ts +12 -4
  130. package/src/client/engine/pwa/sw.js +59 -11
  131. package/src/client/engine/render/drawCheck.ts +96 -0
  132. package/src/client/engine/render/precompile.ts +20 -14
  133. package/src/client/engine/saves/staleBuildNote.ts +46 -0
  134. package/src/client/engine/telemetry/browserErrors.ts +161 -21
  135. package/src/client/engine/telemetry/deviceSnapshot.ts +155 -0
  136. package/src/client/engine/telemetry/screenOutbox.ts +61 -0
  137. package/src/client/engine/telemetry/staleBuildReport.ts +12 -0
  138. package/src/client/engine/ui/DeathFade.ts +99 -11
  139. package/src/client/engine/ui/ErrorModal.ts +13 -6
  140. package/src/client/engine/ui/Feedback.ts +2 -1
  141. package/src/client/engine/ui/Loading.ts +10 -6
  142. package/src/client/engine/ui/Map.ts +2 -1
  143. package/src/client/engine/ui/WeaponStrip.ts +2 -1
  144. package/src/client/engine/ui/backGuard.ts +104 -0
  145. package/src/client/engine/ui/hudAdapters.ts +30 -4
  146. package/src/client/engine/ui/loading.css +17 -0
  147. package/src/client/engine/ui/namePrompt.ts +6 -5
  148. package/src/client/engine/ui/styles/combat.css +12 -0
  149. package/src/client/engine/ui/styles/namePrompt.css +4 -2
  150. package/src/client/game/boot/audio.generated.ts +0 -396
  151. package/src/client/game/boot/bytes.generated.ts +42 -71
  152. package/src/client/game/boot/versions.generated.ts +0 -13
  153. package/src/client/game/compendium/keepsakes.ts +16 -6
  154. package/src/client/game/grapple/tool.ts +10 -7
  155. package/src/client/game/grid/area.ts +38 -0
  156. package/src/client/game/grid/cellLoading.ts +23 -12
  157. package/src/client/game/grid/cellScreens.ts +39 -74
  158. package/src/client/game/grid/live.ts +28 -2
  159. package/src/client/game/grid/liveSession.ts +54 -10
  160. package/src/client/game/grid/menu.ts +4 -0
  161. package/src/client/game/grid/nearPlaceholderPlan.ts +8 -0
  162. package/src/client/game/grid/nearPlaceholderView.ts +9 -3
  163. package/src/client/game/grid/neighbourPanels.ts +10 -1
  164. package/src/client/game/grid/oneWayIn.ts +92 -27
  165. package/src/client/game/grid/pageEntry.ts +19 -0
  166. package/src/client/game/grid/pageShell.ts +1 -1
  167. package/src/client/game/grid/placedCards.ts +55 -0
  168. package/src/client/game/grid/placedCells.ts +131 -0
  169. package/src/client/game/grid/plotAudio.ts +114 -0
  170. package/src/client/game/grid/products.ts +55 -5
  171. package/src/client/game/grid/regionalRuntime.ts +6 -0
  172. package/src/client/game/grid/regionalWorld.ts +15 -2
  173. package/src/client/game/grid/roadCull.ts +44 -14
  174. package/src/client/game/grid/roadLookPlatform.ts +2 -2
  175. package/src/client/game/grid/roadTileBacking.ts +13 -3
  176. package/src/client/game/grid/session.ts +47 -22
  177. package/src/client/game/grid/shardfileFar.ts +9 -3
  178. package/src/client/game/grid/spawnGround.ts +68 -0
  179. package/src/client/game/grid/voidLook.ts +29 -23
  180. package/src/client/game/loot/runtime.ts +3 -1
  181. package/src/client/game/mainMenu.ts +14 -6
  182. package/src/client/game/riding/hud.ts +6 -4
  183. package/src/client/game/session/finish.ts +22 -4
  184. package/src/client/game/session/play.ts +8 -2
  185. package/src/client/game/session/session.ts +4 -1
  186. package/src/client/game/shard/titleList.ts +6 -2
  187. package/src/client/game/shardfile/clientWorker.ts +43 -13
  188. package/src/client/game/shardfile/serverRoute.ts +10 -22
  189. package/src/client/game/slugPage.css +11 -0
  190. package/src/client/game/slugPage.ts +84 -0
  191. package/src/client/game/systems/viewmodel/heldView.ts +6 -3
  192. package/src/client/game/titleDeck.ts +56 -32
  193. package/src/client/host/online/doctor.ts +7 -6
  194. package/src/client/host/online/linkScreens.ts +16 -0
  195. package/src/client/host/online/release.ts +51 -5
  196. package/src/client/host/online/shell.ts +62 -27
  197. package/src/client/host/standalone/shell.ts +7 -3
  198. package/src/cook/game/audioReport.ts +57 -0
  199. package/src/cook/game/entryTotals.ts +26 -6
  200. package/src/cook/game/installedRuntimeReads.ts +3 -0
  201. package/src/cook/game/shardCook.ts +38 -8
  202. package/src/cook/game/tierTextures.ts +276 -0
  203. package/src/e2e/smoke/game.ts +19 -14
  204. package/src/e2e/smoke/page-globals.d.ts +9 -8
  205. package/src/e2e/smoke/template2.spec.ts +8 -7
  206. package/src/server/engine/sim/respawn.ts +6 -1
  207. package/src/server/engine/sim.ts +3 -0
  208. package/src/server/game/grid/simulation.ts +35 -0
  209. package/src/server/game/loot/harvest.ts +2 -0
  210. package/src/server/game/loot/keepsakeProgression.ts +40 -0
  211. package/src/server/game/loot/playerOwned.ts +5 -1
  212. package/src/server/game/plugin/simulation.ts +4 -0
  213. package/src/server/game/population/nativeBake.ts +2 -1
  214. package/src/server/game/quest/chapterRecords.ts +2 -0
  215. package/src/server/game/quest/serverChapters.ts +4 -0
  216. package/src/server/game/quest/serverDoors.ts +11 -5
  217. package/src/server/game/roomRespawn.ts +4 -0
  218. package/src/server/game/shardfile/installedSides.ts +18 -0
  219. package/src/server/game/shardfile/nativeAssemblyHosts.ts +19 -10
  220. package/src/server/game/shardfile/nativeAssemblyInput.ts +1 -4
  221. package/src/server/host/bake/headlessWorker.ts +5 -1
  222. package/src/server/host/dedicated/cellHost.ts +98 -29
  223. package/src/server/host/dedicated/cellProtocol.ts +11 -1
  224. package/src/server/host/dedicated/cellWorker.ts +9 -3
  225. package/src/server/host/dedicated/crossing.ts +6 -2
  226. package/src/server/host/dedicated/dedicatedRoom.ts +21 -8
  227. package/src/server/host/dedicated/gridCells.ts +52 -9
  228. package/src/server/host/dedicated/main.ts +31 -12
  229. package/src/server/host/dedicated/placementFile.ts +56 -0
  230. package/src/server/host/dedicated/releaseFile.ts +17 -10
  231. package/src/server/host/dedicated/roadRoom.ts +21 -5
  232. package/src/server/host/dedicated/socketTransport.ts +2 -1
  233. package/src/server/host/dedicated/workerTable.ts +13 -1
  234. package/src/server/host/dedicated/world.ts +111 -10
  235. package/src/server/host/headlessRuntime.ts +10 -5
  236. package/src/server/host/installers.ts +62 -0
  237. package/src/server/host/openWorld.ts +59 -0
  238. package/src/server/host/ropeDecks.ts +2 -0
  239. package/src/server/host/standalone/cellWorld.ts +25 -19
  240. package/src/server/host/standalone/fallFloor.ts +2 -2
  241. package/src/server/host/standalone/gridServer.ts +7 -4
  242. package/src/server/host/standalone/roadWorld.ts +41 -4
  243. package/src/shared/engine/audio/bootAudio.ts +33 -0
  244. package/src/shared/engine/level/spec.ts +3 -3
  245. package/src/shared/engine/net/acts.ts +3 -0
  246. package/src/shared/engine/net/deviceWord.ts +138 -0
  247. package/src/shared/engine/net/socketFrames.ts +7 -4
  248. package/src/shared/engine/physics/query.ts +27 -0
  249. package/src/shared/engine/physics/terrain.ts +19 -28
  250. package/src/shared/engine/saves/saves.lock.json +15 -0
  251. package/src/shared/engine/sim/actRoutes.ts +2 -0
  252. package/src/shared/game/compendium/keepsakeProgression.ts +24 -0
  253. package/src/shared/game/grid/catalogue.ts +12 -5
  254. package/src/shared/game/grid/catalogueSlot.ts +18 -0
  255. package/src/shared/game/grid/farProxy.ts +6 -5
  256. package/src/shared/game/grid/pageMode.ts +1 -1
  257. package/src/shared/game/grid/placementRows.ts +33 -0
  258. package/src/shared/game/grid/roadLayout.ts +26 -3
  259. package/src/shared/game/grid/singleplayer.json +0 -13
  260. package/src/shared/game/grid/voidFloor.ts +122 -0
  261. package/src/shared/game/strings.ts +15 -0
  262. package/src/shared/host/standalone/netInput.ts +2 -1
@@ -1,6 +1,7 @@
1
1
  import { smoothstep } from '../../../shared/engine/core/noise';
2
2
  import { uiScope, mountUi } from './ownership';
3
3
  import { app } from '../app/runtime';
4
+ import { listenPage, listenTap } from '../input/dom';
4
5
  import './styles/combat.css';
5
6
 
6
7
  /**
@@ -9,20 +10,32 @@ import './styles/combat.css';
9
10
  * respawn happens under the dark, and the view fades back in. DOM in `#hud`, styled in `src/client/engine/ui/styles/combat.css`
10
11
  * (prefix `ws-combat-death`). Driven by the game's dt, so a paused game holds the fade where it is.
11
12
  *
12
- * const death = new DeathFade();
13
+ * const death = new DeathFade({ now: 'Respawn now', waiting: 'Respawning…' });
13
14
  * death.play(deathCause(killer), respawnWhere(chunk, place), { dark: () => respawn(), done: () => unfreeze() });
14
15
  * game.onUpdate((dt) => death.update(dt));
15
16
  * death.active // true from play() to done: input frozen, no damage taken
16
17
  *
18
+ * QA 11-13 (Jake, Sky Reach on an iPhone: "Respawning when you fell, that modal took forever. It needs a button, a Respawn now
19
+ * button"): the card carries a Respawn now button (a tap, or Enter / Space on a keyboard). It runs `dark` at once and fades back
20
+ * in over `SKIP_IN`. `ready` (optional) says whether the respawn point can take the player yet: until it does, neither the
21
+ * timer nor the button respawns, and the button says it is waiting and fires the moment it can (never longer than `READY_WAIT`).
22
+ * The wait itself is only what the card needs: 0.35 s to dark, the card readable to 0.9 s, back by 1.35 s (was 1.8 s).
23
+ *
17
24
  * A boss fight's death (Nalati's King / Titan, Pine Hollow's Antler King) keeps its own checkpoint and never plays this.
18
25
  */
19
26
 
20
- /** s: the fade to dark */
21
- export const FADE_OUT = 0.5;
22
- /** s: the view is fully dark from FADE_OUT to this; the respawn happens at FADE_OUT */
23
- export const DARK_UNTIL = 1.2;
27
+ /** s: the fade to dark (hides the respawn's jump) */
28
+ export const FADE_OUT = 0.35;
29
+ /** s: the view is fully dark from FADE_OUT to this, the card readable; the respawn happens at FADE_OUT */
30
+ export const DARK_UNTIL = 0.9;
24
31
  /** s: the fade back in */
25
- export const FADE_IN = 0.6;
32
+ export const FADE_IN = 0.45;
33
+ /** s: the fade back in after Respawn now */
34
+ export const SKIP_IN = 0.2;
35
+ /** s: the longest the dark waits on a respawn point that is not ready, before it respawns anyway (the old fade waited for nothing) */
36
+ export const READY_WAIT = 3;
37
+ /** s: the most one frame advances the fade: a hitch can't skip the card, and a 4 fps phone still sees it end on time */
38
+ const MAX_STEP = 0.25;
26
39
  const CARD_IN = 0.15, CARD_ON = 0.4;
27
40
  const END = DARK_UNTIL + FADE_IN;
28
41
 
@@ -31,6 +44,18 @@ export interface DeathHooks {
31
44
  dark: () => void;
32
45
  /** the view is back: give the player their input back */
33
46
  done: () => void;
47
+ /** whether the respawn point can take the player yet (absent: always) */
48
+ ready?: () => boolean;
49
+ /** Respawn now has respawned the player: a server's world ends its own fade too (RESPAWN_NOW_ACT), or its commands stay held */
50
+ skipped?: () => void;
51
+ }
52
+
53
+ /** The Respawn now button's words. The game passes them in: the engine's string table rides in the title chunk, this card never does. */
54
+ export interface DeathLabels {
55
+ /** the button: "Respawn now" */
56
+ now: string;
57
+ /** the button while the respawn point is not ready: "Respawning…" */
58
+ waiting: string;
34
59
  }
35
60
 
36
61
 
@@ -40,11 +65,21 @@ export class DeathFade {
40
65
  private readonly cause: HTMLElement;
41
66
  private readonly where: HTMLElement;
42
67
  private readonly card: HTMLElement;
68
+ private readonly now: HTMLButtonElement;
43
69
  private t = 0;
70
+ /** time runs this many times faster: the fade back in after Respawn now */
71
+ private rate = 1;
44
72
  private hooks: DeathHooks | null = null;
45
73
  private darkDone = false;
74
+ /** Respawn now was pressed and has not respawned yet */
75
+ private asked = false;
76
+ /** s the dark has waited on a respawn point that is not ready */
77
+ private waited = 0;
78
+
79
+ private readonly labels: DeathLabels;
46
80
 
47
- constructor() {
81
+ constructor(labels: DeathLabels) {
82
+ this.labels = labels;
48
83
  for (const old of document.querySelectorAll('.ws-combat-death')) old.remove(); // the last shard's (a shard switch builds a new one)
49
84
  this.root = document.createElement('div');
50
85
  this.root.className = 'ws-combat-death';
@@ -58,9 +93,54 @@ export class DeathFade {
58
93
  rule.className = 'ws-combat-death-rule';
59
94
  this.where = document.createElement('div');
60
95
  this.where.className = 'ws-combat-death-where';
61
- this.card.append(this.cause, rule, this.where);
96
+ this.now = document.createElement('button');
97
+ this.now.type = 'button';
98
+ this.now.className = 'ws-combat-death-now';
99
+ this.now.textContent = labels.now;
100
+ this.card.append(this.cause, rule, this.where, this.now);
62
101
  this.root.append(this.card);
63
102
  mountUi(this.root, this.scope);
103
+ listenTap(this.scope, this.now, () => { this.respawnNow(); }); // an iOS tap answers on its pointerup, not the late click
104
+ // a keyboard: Enter or Space, first in the capture phase so neither reaches the game (a jump) or scrolls; a held key's repeat is not a press
105
+ // Only the game's own keys (the page, the canvas, this button): a focused button on a card over this one (the pause menu, a
106
+ // failure card) keeps its Enter and Space. Not before the card shows, so a Space tapped during the fall never skips it unseen.
107
+ listenPage(this.scope, 'keydown', (e) => {
108
+ if (this.hooks === null || e.repeat || app.clock.paused || this.t < CARD_IN) return;
109
+ if (e.key !== 'Enter' && e.key !== ' ' && e.code !== 'Space' && e.code !== 'Enter' && e.code !== 'NumpadEnter') return;
110
+ const at = e.target;
111
+ if (at instanceof Element && at !== this.now && at !== document.body && at !== document.documentElement && !(at instanceof HTMLCanvasElement)) return;
112
+ e.preventDefault(); e.stopPropagation();
113
+ this.respawnNow();
114
+ }, { capture: true });
115
+ }
116
+
117
+ /** Respawn now (the button, Enter, Space): respawn as soon as the point is ready, then a short fade back in. */
118
+ respawnNow(): void {
119
+ if (this.hooks === null) return;
120
+ this.asked = true;
121
+ this.tryDark();
122
+ this.paintButton();
123
+ this.paint();
124
+ }
125
+
126
+ /** the respawn under the dark, once the point is ready (or has kept the dark waiting READY_WAIT); after a press, the short way back */
127
+ private tryDark(): void {
128
+ const h = this.hooks;
129
+ if (h === null) return;
130
+ if (!this.darkDone) {
131
+ if (!this.asked && this.t < FADE_OUT) return;
132
+ if (h.ready?.() === false && this.waited < READY_WAIT) return;
133
+ this.darkDone = true; h.dark();
134
+ }
135
+ if (this.asked) { this.asked = false; this.t = Math.max(this.t, DARK_UNTIL); this.rate = FADE_IN / SKIP_IN; h.skipped?.(); }
136
+ }
137
+
138
+ private paintButton(): void {
139
+ const waiting = this.asked && !this.darkDone;
140
+ this.now.classList.toggle('waiting', waiting);
141
+ this.now.setAttribute('aria-busy', String(waiting));
142
+ this.now.textContent = waiting ? this.labels.waiting : this.labels.now;
143
+ this.now.disabled = this.darkDone && this.rate !== 1;
64
144
  }
65
145
 
66
146
  /** from play() until the view is back */
@@ -70,17 +150,25 @@ export class DeathFade {
70
150
  if (this.hooks !== null) return;
71
151
  this.cause.textContent = cause;
72
152
  this.where.textContent = where;
73
- this.hooks = hooks; this.t = 0; this.darkDone = false;
153
+ this.hooks = hooks; this.t = 0; this.darkDone = false; this.asked = false; this.rate = 1; this.waited = 0;
74
154
  app.setState('dead');
75
155
  this.root.classList.add('show');
156
+ this.paintButton();
76
157
  this.paint();
77
158
  }
78
159
 
79
160
  update(dt: number): void {
80
161
  const h = this.hooks;
81
162
  if (h === null) return;
82
- this.t += Math.min(dt, 0.1); // a long frame (a hitch, a tab switch) doesn't skip the card
83
- if (!this.darkDone && this.t >= FADE_OUT) { this.darkDone = true; h.dark(); }
163
+ const step = Math.min(dt, MAX_STEP); // a long frame (a hitch, a tab switch) doesn't skip the card
164
+ this.t += step * this.rate;
165
+ if (!this.darkDone) {
166
+ if (this.t >= FADE_OUT) this.waited += step;
167
+ const asked = this.asked;
168
+ this.tryDark();
169
+ if (asked) this.paintButton();
170
+ if (!this.darkDone) this.t = Math.min(this.t, DARK_UNTIL); // no fade back in before the respawn: the dark holds while the point is not ready
171
+ }
84
172
  if (this.t >= END) {
85
173
  this.hooks = null;
86
174
  app.setState('play');
@@ -36,7 +36,7 @@ import { leaveSaved, markReload, markUnload } from '../boot/lastEnd';
36
36
  import { leftByPlayer } from '../boot/dropNotice';
37
37
  import { showReloading } from './reloadCover';
38
38
  import { leaveAfterPaint } from '../boot/leaveAfterPaint';
39
- import { captureBrowserError } from '../telemetry/browserErrors';
39
+ import { captureBrowserError, flushScreenReports, type ErrorScreen } from '../telemetry/browserErrors';
40
40
  import { bootDiagnostic, bootDiagnosticJson } from '../boot/bootTrace';
41
41
  // reloads from this modal (and the boot's stuck-loader recovery, src/client/engine/boot/stuck.ts) inside RELOAD_WINDOW_MS before
42
42
  // RELOAD HERE stops returning to the spot: one shared budget
@@ -236,7 +236,8 @@ function showChip(sent: Promise<ReportOutcome>): void {
236
236
  } catch { /* never throw from here */ }
237
237
  }
238
238
 
239
- function report(system: string, error: unknown, flags: { fatal?: boolean; disabled?: boolean; stall?: Record<string, unknown> }): Promise<ReportOutcome> {
239
+ /** `screen` (SENTRY-TRIAGE S13): the screen this report opens; only the report that opens it names it, so a screen is one event */
240
+ function report(system: string, error: unknown, flags: { fatal?: boolean; disabled?: boolean; stall?: Record<string, unknown>; screen?: ErrorScreen }): Promise<ReportOutcome> {
240
241
  if (system !== 'lifecycle') {
241
242
  let level = '';
242
243
  try { level = activeLevel().id; } catch { /* the registry may not be ready during early boot */ }
@@ -247,15 +248,20 @@ function report(system: string, error: unknown, flags: { fatal?: boolean; disabl
247
248
  bootStage: document.querySelector<HTMLElement>('.ws-load')?.dataset['step'] ?? loopState(),
248
249
  fatal: flags.fatal === true,
249
250
  diagnostic: flags.stall === undefined ? bootDiagnostic() : { ...bootDiagnostic(), stall: flags.stall },
251
+ ...(flags.screen === undefined ? {} : { screen: flags.screen }),
250
252
  });
251
253
  }
252
- try { return reporter?.report(system, error, flags) ?? Promise.resolve('dropped'); } catch { return Promise.resolve('dropped'); }
254
+ const inbox = { ...(flags.fatal === undefined ? {} : { fatal: flags.fatal }), ...(flags.disabled === undefined ? {} : { disabled: flags.disabled }) };
255
+ try { return reporter?.report(system, error, inbox) ?? Promise.resolve('dropped'); } catch { return Promise.resolve('dropped'); }
253
256
  }
254
257
 
255
258
  /** a fault from the frame loop or the window: report it and open the modal (G880: every reported error) */
256
259
  function handle(f: Fault): void {
257
260
  const fatal = f.verdict === 'fatal' || (f.verdict === 'uncaught' && loopState() === 'boot');
258
- const sent = report(f.system, f.error, { fatal });
261
+ // S13: the screen this fault opens, if any: the modal (first one), the chip (once a session), or none (a later fault, a retry)
262
+ const shows = !fatal && f.verdict !== 'uncaught' ? null : !fatal && !isDev() ? 'glitch-chip' : 'error-modal';
263
+ const screen = shows === 'glitch-chip' ? (chipShown || root ? undefined : shows) : shows === 'error-modal' && !root ? shows : undefined;
264
+ const sent = report(f.system, f.error, { fatal, ...(screen === undefined ? {} : { screen }) });
259
265
  if (!fatal && f.verdict !== 'uncaught') return; // internal retry bookkeeping is not a separate report
260
266
  // G901 (refines G880): with Developer on every error opens the modal; with it off only a play-breaking one does (the loop
261
267
  // stopped, or the boot failed), and a recoverable error (the system goes on, MF6) gets the quiet chip
@@ -268,7 +274,8 @@ function handle(f: Fault): void {
268
274
  export function showError(message: string, stack = '', stall?: Record<string, unknown>): void {
269
275
  app.setState('error');
270
276
  try {
271
- showFatal(message, stack, report('boot', new DescribedError(message, stack), { fatal: true, ...(stall === undefined ? {} : { stall }) }));
277
+ const screen: ErrorScreen | undefined = root ? undefined : stall === undefined ? 'error-modal' : 'stuck-step';
278
+ showFatal(message, stack, report('boot', new DescribedError(message, stack), { fatal: true, ...(stall === undefined ? {} : { stall }), ...(screen === undefined ? {} : { screen }) }));
272
279
  } catch { /* the modal must never throw */ }
273
280
  }
274
281
 
@@ -305,5 +312,5 @@ export function installErrorModal(): void {
305
312
  scope.listen(window, 'unhandledrejection', (e) => { emitFault({ system: 'promise', error: e.reason, verdict: 'uncaught' }); });
306
313
  // what an offline page queued goes once the network is back (and a little after boot, off the critical path)
307
314
  scope.listen(window, 'online', () => { void reporter?.flushQueue(); });
308
- scope.timeout(8000, () => { void reporter?.flushQueue(); });
315
+ scope.timeout(8000, () => { void reporter?.flushQueue(); flushScreenReports(); });
309
316
  }
@@ -1,3 +1,4 @@
1
+ import { capturePointer } from '../input/dom';
1
2
  import { uiScope, mountUi } from './ownership';
2
3
  import { app } from '../app/runtime';
3
4
  import type { UiHandle } from './layers';
@@ -293,7 +294,7 @@ export class Feedback {
293
294
  fit(); paint();
294
295
  let live: Stroke | null = null;
295
296
  const at = (e: PointerEvent): [number, number] => { const r = cv.getBoundingClientRect(); return [(e.clientX - r.left) / r.width, (e.clientY - r.top) / r.height]; };
296
- penScope.listen(cv, 'pointerdown', (e) => { e.preventDefault(); cv.setPointerCapture(e.pointerId); live = { pts: at(e) }; this.strokes.push(live); paint(); });
297
+ penScope.listen(cv, 'pointerdown', (e) => { e.preventDefault(); capturePointer(cv, e.pointerId); live = { pts: at(e) }; this.strokes.push(live); paint(); });
297
298
  penScope.listen(cv, 'pointermove', (e) => { if (!live) return; live.pts.push(...at(e)); paint(); });
298
299
  const end = (): void => { live = null; };
299
300
  penScope.listen(cv, 'pointerup', end); penScope.listen(cv, 'pointercancel', end);
@@ -164,10 +164,12 @@ export class Loading {
164
164
  private slowGpu = false;
165
165
  private timeLeftShown = false;
166
166
 
167
- constructor(chunk: { id: string; name: string; trace?: boolean }, mode: { readonly scoped?: boolean } = {}) {
168
- bootMark('app:loading-adopt', {scoped: mode.scoped === true, chunk: chunk.id});
169
- app.ui.bindPresentation(this.scope);app.ui.holdCovered(this.scope);
170
- this.scoped = mode.scoped === true;
167
+ /** QA 2026-11-13 (Jake: "make it look the same as the one for Shard Select"): `inset`, a scoped card drawn over the live
168
+ * world (a grid cell's preparation): the same panel, no backdrop, head or foot; it never covers the world or takes input. */
169
+ constructor(chunk: { id: string; name: string; trace?: boolean }, mode: { readonly scoped?: boolean; readonly inset?: boolean } = {}) {
170
+ bootMark('app:loading-adopt', {scoped: mode.scoped === true || mode.inset === true, chunk: chunk.id});
171
+ if (mode.inset !== true) { app.ui.bindPresentation(this.scope); app.ui.holdCovered(this.scope); }
172
+ this.scoped = mode.scoped === true || mode.inset === true;
171
173
  if (!this.scoped) startBoot({ id: chunk.id, name: chunk.name }, TIER === 'phone' && chunk.trace === true);
172
174
  // LS4: a fatal load screen covers this card; it copies the same report through this source.
173
175
  if (!this.scoped) setDiagnosticsSource(() => this.diagnosticsText());
@@ -177,6 +179,7 @@ export class Loading {
177
179
  else {
178
180
  this.root = document.createElement('div');
179
181
  this.root.className = 'ws-load';
182
+ if (mode.inset === true) this.root.dataset['inset'] = '';
180
183
  this.root.innerHTML = loadShellTemplate();
181
184
  mountUi(this.root, this.scope, document.body);
182
185
  }
@@ -216,7 +219,8 @@ export class Loading {
216
219
  if (shell === null || this.els.slug.textContent === '') this.els.slug.textContent = chunk.name;
217
220
  const key = 'loadAttempt';
218
221
  let attempt = 1;
219
- try {
222
+ // a scoped (mid-play) load is not a page boot: it keeps the boot's attempt count
223
+ if (!this.scoped) try {
220
224
  const previous: unknown = JSON.parse(savedStorage.getItem(key) ?? 'null');
221
225
  if (typeof previous === 'object' && previous !== null && Reflect.get(previous, 'slug') === chunk.id) {
222
226
  const when: unknown = Reflect.get(previous, 'at');
@@ -226,7 +230,7 @@ export class Loading {
226
230
  savedStorage.setItem(key, JSON.stringify({ slug: chunk.id, at: Date.now(), count: attempt }));
227
231
  } catch { /* a storage-denied PWA still gets the loader */ }
228
232
  this.attempt = attempt;
229
- const earlyTiming = bootTiming(); if (earlyTiming !== undefined) earlyTiming.attemptCount = attempt;
233
+ const earlyTiming = this.scoped ? undefined : bootTiming(); if (earlyTiming !== undefined) earlyTiming.attemptCount = attempt;
230
234
  set(this.els.tier, this.tierText());
231
235
  this.rowsEl = this.els.suRows;
232
236
  // Start ends here: the game's own code owns the card. A scoped (mid-play) load has no Start.
@@ -1,3 +1,4 @@
1
+ import { capturePointer } from '../input/dom';
1
2
  import { app } from '../app/runtime';
2
3
  import type { UiHandle } from './layers';
3
4
  import type { Scope } from '../../../shared/engine/app/scope';
@@ -85,7 +86,7 @@ export class FullMap {
85
86
  this.root.append(this.canvas);
86
87
 
87
88
  // pan / pinch
88
- this.scope.listen(this.canvas, 'pointerdown', (e) => { this.canvas.setPointerCapture(e.pointerId); this.pointers.set(e.pointerId, { x: e.clientX, y: e.clientY }); if (this.pointers.size === 2) { this.pinchDist = this.dist(); this.pinchZoom = this.zoom; } });
89
+ this.scope.listen(this.canvas, 'pointerdown', (e) => { capturePointer(this.canvas, e.pointerId); this.pointers.set(e.pointerId, { x: e.clientX, y: e.clientY }); if (this.pointers.size === 2) { this.pinchDist = this.dist(); this.pinchZoom = this.zoom; } });
89
90
  this.scope.listen(this.canvas, 'pointermove', (e) => {
90
91
  const p = this.pointers.get(e.pointerId); if (!p) return;
91
92
  if (this.pointers.size === 1) { this.panBy(e.clientX - p.x, e.clientY - p.y); }
@@ -1,3 +1,4 @@
1
+ import { capturePointer } from '../input/dom';
1
2
  import type { Scope } from '../../../shared/engine/app/scope';
2
3
  import { uiScope, mountUi } from './ownership';
3
4
  import { engineString } from '../../../shared/engine/strings';
@@ -165,7 +166,7 @@ export class WeaponStrip {
165
166
  this.scope.listen(ring, 'pointerdown', (e) => {
166
167
  e.stopPropagation(); e.preventDefault();
167
168
  if (this.press !== null || !this.weapons.enabled) return;
168
- ring.setPointerCapture(e.pointerId);
169
+ capturePointer(ring, e.pointerId);
169
170
  ring.classList.add('down');
170
171
  const press: NonNullable<WeaponStrip['press']> = { id: e.pointerId, timer: 0, open: false };
171
172
  press.timer = this.scope.timeout(HOLD_MS, () => { press.open = true; this.openPie(); });
@@ -0,0 +1,104 @@
1
+ /**
2
+ * The back guard: in play, the browser's back (iOS Safari's left-edge swipe, Android's back gesture, the back button)
3
+ * stays in the world instead of leaving it (Jake, 2026-11-13: "iOS swipe, edge swipe, back gesture, whatever it is,
4
+ * disable that"; QA-FEEDBACK-2026-11-13 row 20).
5
+ *
6
+ * Arming pushes one same-URL history entry marked as the guard. A back lands on the entry under it, in this same
7
+ * document (a `popstate`, no page load), and the guard pushes itself again: the player stays where they stood.
8
+ * Only play arms it; the title and menus are other documents, so their back is the browser's own.
9
+ *
10
+ * The game's own ways out (Exit, a shard switch, a reload) go through `leaveSaved`, which first releases the guard:
11
+ * it steps back off the guard entry, so the `location.replace` that follows replaces the play entry itself and no
12
+ * stale play page is left behind the title.
13
+ */
14
+
15
+ import { pageScope } from '../../../shared/engine/app/resources';
16
+ import { beforeLeaving } from '../boot/lastEnd';
17
+
18
+ const MARK = 'wsBackGuard';
19
+
20
+ export interface BackGuardPorts {
21
+ readonly history: Pick<History, 'pushState' | 'replaceState' | 'back'> & { readonly state: unknown };
22
+ readonly url: () => string;
23
+ listen: (handler: () => void) => () => void;
24
+ /** a fallback for a browser that never answers the release's back */
25
+ later: (go: () => void, ms: number) => void;
26
+ }
27
+
28
+ export interface BackGuard {
29
+ /** Whether the guard holds the history now. */
30
+ readonly armed: boolean;
31
+ /** How many backs it has turned away. */
32
+ readonly turned: number;
33
+ /** Step off the guard entry and stop guarding; resolves once the history is back on the play entry. */
34
+ release: () => Promise<void>;
35
+ }
36
+
37
+ const guardState = (state: unknown): boolean => typeof state === 'object' && state !== null && (state as Record<string, unknown>)[MARK] === true;
38
+ const withMark = (state: unknown): Record<string, unknown> => ({ ...(typeof state === 'object' && state !== null ? state : {}), [MARK]: true });
39
+ const withoutMark = (state: unknown): unknown => {
40
+ if (!guardState(state)) return state;
41
+ const { [MARK]: _mark, ...rest } = state as Record<string, unknown>;
42
+ return rest;
43
+ };
44
+ /** How long a release waits for its back's popstate before the game leaves anyway (a busy phone answers late). */
45
+ const RELEASE_WAIT_MS = 1500;
46
+
47
+ export function armBackGuard(ports: BackGuardPorts): BackGuard {
48
+ let armed = true, turned = 0, releasing: (() => void) | null = null;
49
+ // A reload (or iOS reviving an evicted tab) keeps history.state, so this page may start on an old guard entry:
50
+ // make it this page's play entry again, so a release steps back onto an entry the replace can take.
51
+ const base = withoutMark(ports.history.state);
52
+ if (guardState(ports.history.state)) ports.history.replaceState(base, '', ports.url());
53
+ ports.history.pushState(withMark(base), '', ports.url());
54
+ const stop = ports.listen(() => {
55
+ if (releasing !== null) { const done = releasing; releasing = null; done(); return; }
56
+ // Any traverse while armed is a back off our entry (forward entries are cleared by each push). The entry under it
57
+ // may itself be marked: a reload keeps history.state, so check nothing but that we are armed.
58
+ if (!armed) return;
59
+ turned++;
60
+ ports.history.pushState(withMark(ports.history.state), '', ports.url());
61
+ });
62
+ return {
63
+ get armed() { return armed; },
64
+ get turned() { return turned; },
65
+ release: () => new Promise<void>((resolve) => {
66
+ if (!armed) { resolve(); return; }
67
+ armed = false;
68
+ const finish = (): void => { stop(); resolve(); };
69
+ if (!guardState(ports.history.state)) { finish(); return; }
70
+ let settled = false;
71
+ const once = (): void => { if (!settled) { settled = true; finish(); } };
72
+ releasing = once;
73
+ ports.history.back();
74
+ ports.later(once, RELEASE_WAIT_MS);
75
+ }),
76
+ };
77
+ }
78
+
79
+ const browserPorts = (): BackGuardPorts => ({
80
+ history,
81
+ url: () => location.href,
82
+ listen: (handler) => pageScope.listen(window, 'popstate', handler),
83
+ later: (go, ms) => { pageScope.timeout(ms, go); },
84
+ });
85
+
86
+ let current: BackGuard | null = null;
87
+
88
+ /** Arm the guard for this page's play (idempotent). */
89
+ export function guardPlayBack(ports: BackGuardPorts = browserPorts()): BackGuard {
90
+ if (current?.armed === true) return current;
91
+ current = armBackGuard(ports);
92
+ beforeLeaving(releasePlayBack);
93
+ return current;
94
+ }
95
+
96
+ /** Release the page's guard before the game leaves on its own; resolves at once when none is armed. */
97
+ export function releasePlayBack(): Promise<void> {
98
+ const guard = current;
99
+ current = null;
100
+ return guard === null ? Promise.resolve() : guard.release();
101
+ }
102
+
103
+ /** Whether play holds the back now (for a proof or the debug overlay). */
104
+ export function playBackGuarded(): boolean { return current?.armed === true; }
@@ -1,16 +1,32 @@
1
- import { Vector2, Vector3 } from 'three';
1
+ import { Vector2, Vector3, type Vector3Like } from 'three';
2
2
  import type { Game } from '../core/Game';
3
3
  import type { Scope } from '../../../shared/engine/app/scope';
4
4
  import type { LevelAdapters } from '../../../server/engine/level/context';
5
5
  import { hudSlots, type DiscSpot, type TouchRelabel } from './hudSlots';
6
6
  import { controlRects, placePin, type PinRect } from './pinKeepOut';
7
7
 
8
+ /**
9
+ * The page-space offset of the frame pins stand in (QA 2026-11-13, Sky Reach: the Keeper's pin drew ahead while he stood
10
+ * behind). A pin's point is in the frame its content stands in; in a grid frame other than the page's home the live session
11
+ * stands the camera at that frame's render offset (liveSession `applied`, the same offset the interact pick takes off,
12
+ * enteredInteract.ts), so the pass adds it before projecting. Zero on a standalone page and in the home frame.
13
+ */
14
+ export const pinFrameOffset: Vector3 = new Vector3();
15
+ /**
16
+ * A frame-local point where the page camera sees it (`point` + pinFrameOffset), into `out`. Every overlay that projects
17
+ * content with the page camera goes through this: the pins, the grapple's in-view test, riding's name tags and the loot
18
+ * chip (QA 2026-11-13 row 28).
19
+ */
20
+ export function framedPoint(point: Readonly<Vector3Like>, out: Vector3): Vector3 { return out.copy(point).add(pinFrameOffset); }
21
+ /** The camera's eye in the frame content stands in (its position less pinFrameOffset), into `out`: distances and sight lines to frame-local points. */
22
+ export function frameEye(camera: Readonly<{ position: Vector3 }>, out: Vector3): Vector3 { return out.copy(camera.position).sub(pinFrameOffset); }
23
+
8
24
  /** Scope-owned projection and relabels; content supplies only world positions and elements. */
9
25
  export function hudAdapters(game: Game, scope: Scope, root: HTMLElement,
10
26
  relabel: (spot: DiscSpot, hint: TouchRelabel | null) => void): NonNullable<LevelAdapters['hud']> {
11
27
  hudSlots.configure(game.level.hud?.bands);
12
28
  const pins = new Set<{ at: Vector3 | (() => Vector3 | null); el: HTMLElement; x: number; y: number; w: number; h: number; shown: boolean }>();
13
- const point = new Vector3();
29
+ const point = new Vector3(), depth = new Vector3();
14
30
  const viewSize = new Vector2(), viewport = { width: 0, height: 0 };
15
31
  // pins step round the touch controls (pinKeepOut.ts): the controls' rects and the pins' sizes are read every 15th frame
16
32
  // (≈ 2–4 Hz), never per frame; the controls themselves never move
@@ -21,11 +37,21 @@ export function hudAdapters(game: Game, scope: Scope, root: HTMLElement,
21
37
  keepOut = hudSlots.touch ? controlRects(root) : [];
22
38
  for (const pin of pins) if (pin.shown) { pin.w = pin.el.offsetWidth; pin.h = pin.el.offsetHeight; }
23
39
  }
40
+ // the camera as posed this frame (the grid's frame offset lands in update; the render poses it only after this pass):
41
+ // its own matrix, not the viewmodel under it
42
+ game.camera.updateWorldMatrix(true, false);
24
43
  let viewportRead = false;
25
44
  for (const pin of pins) {
26
45
  const at = typeof pin.at === 'function' ? pin.at() : pin.at;
27
- if (at !== null) point.copy(at).project(game.camera);
28
- const visible = at !== null && point.z >= -1 && point.z <= 1;
46
+ // A point behind the eye never draws (its projection mirrors through the view): the camera-space depth decides
47
+ // ahead or behind, the projected depth only the far plane. No edge mode: the quest chip's arrow carries a target behind.
48
+ let ahead = false;
49
+ if (at !== null) {
50
+ framedPoint(at, point);
51
+ ahead = depth.copy(point).applyMatrix4(game.camera.matrixWorldInverse).z < 0;
52
+ point.project(game.camera);
53
+ }
54
+ const visible = ahead && point.z >= -1 && point.z <= 1;
29
55
  // Game.resize owns this same native viewport in logical CSS pixels.
30
56
  // Read its stored size before the first pin write, without synchronously
31
57
  // flushing HUD styles through window dimensions. Readers stay in order.
@@ -122,4 +122,21 @@
122
122
  .ws-load .ws-load-hold, .ws-load .ws-load-copy, .ws-load .ws-load-menu { width: 100%; }
123
123
  }
124
124
 
125
+ /* QA 2026-11-13 (Jake: "make it look the same as the one for Shard Select"): a grid cell's preparation is this same card,
126
+ inset over the live world (Loading's `inset` mode): no backdrop, wordmark or footer, no input (the move stick, the look pad
127
+ and the buttons under it keep working). It sits under the minimap and above the touch buttons on a 402 x 874 portrait,
128
+ centred near the top on desktop, where its footer line (the work now, or a refusal's reason) follows the card. */
129
+ .ws-load[data-inset] { z-index: calc(var(--ws-layer-hud) + 5); background: none; pointer-events: none; justify-content: flex-start; }
130
+ .ws-load[data-inset]::before, .ws-load[data-inset]::after, .ws-load[data-inset] .ws-load-head { display: none; }
131
+ .ws-load[data-inset] .ws-load-foot { box-sizing: border-box; width: min(560px, calc(100% - 32px)); margin: 8px auto 0; padding: 6px 10px; background: rgba(3, 8, 15, 0.55); text-shadow: 0 1px 2px #000; }
132
+ .ws-load[data-inset] .ws-load-foot:has([data-el="foot"]:empty) { display: none; }
133
+ .ws-load[data-inset] .ws-load-body { flex: none; padding: clamp(72px, 12vh, 140px) 16px 0; }
134
+ .ws-load[data-inset] .ws-load-copy, .ws-load[data-inset] .ws-load-retry { pointer-events: auto; }
135
+ /* a phone: the card starts under the minimap and ends above the hover chip; the footer line shows only a refusal */
136
+ @media (max-width: 700px) {
137
+ .ws-load[data-inset] .ws-load-body { padding: calc(136px + env(safe-area-inset-top, 0px)) 16px 0; }
138
+ .ws-load[data-inset]:not([data-failed='true']) .ws-load-foot { display: none; }
139
+ }
140
+ @media (max-height: 500px) { .ws-load[data-inset] .ws-load-body { padding-top: 12px; } }
141
+
125
142
  /* G846: everyone sees the detailed progress; only the hold control is Developer-only. */
@@ -7,6 +7,7 @@ import type { SaveStorage } from '../../../shared/engine/saves/store';
7
7
  import { engineString } from '../../../shared/engine/strings';
8
8
  import { jsonSlot } from '../saves/slots';
9
9
  import { followsTap, listenTap } from '../input/dom';
10
+ import { installViewport } from '../core/viewport';
10
11
  import './styles/namePrompt.css';
11
12
 
12
13
  /**
@@ -69,7 +70,9 @@ export interface NamePromptOptions {
69
70
 
70
71
  /**
71
72
  * Show the prompt. Resolves the Name typed (cleaned), null for Skip, or undefined when `scope` closed it first. The card sits in
72
- * the visible part of the page (`visualViewport`), so a phone's keyboard never covers the field or the buttons.
73
+ * the visible part of the page, so a phone's keyboard never covers the field or the buttons: MOBILE-KEYBOARD MK9 (meta, J297)
74
+ * reads the keyboard from viewport.ts's marks (`data-ws-keyboard`, `--ws-kb-top` / `--ws-kb-bottom`, namePrompt.css), the one
75
+ * module that owns it, instead of a second `visualViewport` fit of its own.
73
76
  */
74
77
  export function showNamePrompt(scope: Scope, options: NamePromptOptions): Promise<string | null | undefined> {
75
78
  const own = scope.child('name-prompt');
@@ -88,10 +91,8 @@ export function showNamePrompt(scope: Scope, options: NamePromptOptions): Promis
88
91
  card.append(check);
89
92
  }
90
93
  box.append(card);
91
- // the visible part of the page: a phone's keyboard shrinks it, and the card stays centred in what is left
92
- const view = globalThis.visualViewport;
93
- const fit = (): void => { if (view === null || view === undefined) return; box.style.top = `${String(view.offsetTop)}px`; box.style.height = `${String(view.height)}px`; };
94
- if (view !== null && view !== undefined) { own.listen(view, 'resize', fit); own.listen(view, 'scroll', fit); fit(); }
94
+ // the keyboard's marks: the title asks before any Game installed them (idempotent; Game's constructor calls it again)
95
+ installViewport();
95
96
  own.ownNode(box); options.parent.append(box);
96
97
  input.focus({ preventScroll: true });
97
98
  return new Promise(resolve => {
@@ -98,3 +98,15 @@
98
98
  }
99
99
  .ws-combat-death-rule { width: 56px; height: 1px; margin: 11px auto 10px; background: var(--ws-cyan-line); }
100
100
  .ws-combat-death-where { font-size: 10px; line-height: 1.5; letter-spacing: 0.26em; text-transform: uppercase; color: var(--ws-cyan); }
101
+ /* Respawn now (QA 11-13): a tap on a phone, Enter / Space on a keyboard; the overlay takes no touches, the button does */
102
+ .ws-combat-death-now {
103
+ display: block; width: 100%; min-height: 44px; margin: 14px 0 0; padding: 0 16px; box-sizing: border-box; cursor: pointer; pointer-events: auto;
104
+ font-family: var(--ws-mono); font-size: 11px; letter-spacing: 0.26em; text-transform: uppercase; color: var(--ws-text);
105
+ background: rgba(143, 227, 255, 0.08); border: 1px solid var(--ws-cyan-line); border-radius: 0;
106
+ -webkit-appearance: none; appearance: none; -webkit-tap-highlight-color: transparent; touch-action: manipulation;
107
+ }
108
+ .ws-combat-death-now:hover, .ws-combat-death-now:focus-visible { background: rgba(143, 227, 255, 0.16); border-color: var(--ws-cyan); outline: none; }
109
+ .ws-combat-death-now:active { background: rgba(143, 227, 255, 0.24); }
110
+ .ws-combat-death-now.waiting { color: var(--ws-cyan); animation: ws-death-now-wait 0.9s ease-in-out infinite; }
111
+ .ws-combat-death-now:disabled { cursor: default; }
112
+ @keyframes ws-death-now-wait { 50% { opacity: 0.55; } }
@@ -1,7 +1,9 @@
1
1
  /* ─── MMO-PLAN MP2.4: the Name prompt between PLAY and the world (src/client/engine/ui/namePrompt.ts) ─── prefix ws-name- ───
2
- The title's own glass card: square corners, the cyan line and its corner ticks, a Rajdhani head and mono data. namePrompt.ts
3
- sizes the overlay to the visible viewport, so a phone's keyboard shrinks the space and the card stays centred above it. */
2
+ The title's own glass card: square corners, the cyan line and its corner ticks, a Rajdhani head and mono data. The overlay
3
+ fills the visible band viewport.ts marks (MOBILE-KEYBOARD MK9), so a phone's keyboard shrinks the space and the card stays
4
+ centred above it. */
4
5
  .ws-name { position: fixed; left: 0; top: 0; z-index: calc(var(--ws-layer-modal) + 10); box-sizing: border-box; width: 100%; height: var(--ws-vh, 100%); margin: 0; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(5, 8, 16, 0.72); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); color: var(--ws-text); font-family: var(--ws-mono); pointer-events: auto; touch-action: manipulation; }
6
+ html[data-ws-keyboard] .ws-name { top: var(--ws-kb-top, 0px); height: calc(var(--ws-kb-bottom, 100%) - var(--ws-kb-top, 0px)); }
5
7
  .ws-name * { box-sizing: border-box; }
6
8
  .ws-name .ws-name-card { position: relative; width: min(100%, 360px); display: grid; gap: 12px; padding: 22px 18px 16px; background: rgba(9, 22, 36, 0.92); border: 1px solid rgba(143, 227, 255, 0.4); box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5); }
7
9
  .ws-name .ws-name-card::before, .ws-name .ws-name-card::after { content: ''; position: absolute; width: 14px; height: 14px; pointer-events: none; border: 2px solid var(--ws-cyan); }