Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR updates the application to disable thread usage when running in a WASM environment and makes ancillary adjustments in configuration defaults, wasm bindings, and the documentation assets.
- In src/ui.rs, the globe generation code now runs synchronously for wasm using conditional compilation.
- In src/state.rs, default configuration values for grid size and perlin seed have been updated.
- In docs/terrain3d.js and docs/index.html, asset paths and wasm binding adapter names are updated and a new overlay is implemented for build failure notifications.
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/ui.rs | Introduces conditional compilation to bypass thread spawn in wasm. |
| src/state.rs | Adjusts default config parameters (grid_size and perlin seed). |
| docs/terrain3d.js | Updates wasm binding adapter names for consistency. |
| docs/index.html | Revises asset paths and adds overlay UI code for build failure. |
docs/index.html
Outdated
| window.setInterval(() => { | ||
| this._inject(); | ||
| }, 250); |
There was a problem hiding this comment.
Using a setInterval every 250ms to repeatedly inject the overlay could impact performance; consider using more event-driven methods like a MutationObserver or specific event listeners to handle overlay reinjection.
| window.setInterval(() => { | |
| this._inject(); | |
| }, 250); | |
| // Use MutationObserver to monitor DOM changes | |
| const observer = new MutationObserver(() => { | |
| this._inject(); | |
| }); | |
| observer.observe(document.body, { childList: true }); |
docs/index.html
Outdated
| class Overlay { | ||
| constructor() { | ||
| // create an overlay | ||
| this._overlay = document.createElement("div"); |
There was a problem hiding this comment.
Consider adding an appropriate ARIA role attribute (e.g., role="dialog" or role="alert") to the overlay element to improve accessibility for users with assistive technologies.
| this._overlay = document.createElement("div"); | |
| this._overlay = document.createElement("div"); | |
| this._overlay.setAttribute("role", "alert"); |
No description provided.