feat(web): copyable on-page banner for renderer errors (#414)

wgpu/naga report pipeline and shader failures through the log facade,
then leave the canvas empty - with no logger installed on wasm the
message was lost, so a broken GPU path looked like "draws nothing" with
a clean console. Install a web logger that mirrors Error-level records
to the browser console and into a fixed DOM overlay with selectable
text, a Copy button and repeat-collapsing; panics land in the same
banner via a chained hook. Windows Chrome/Edge reporters can now paste
the exact ANGLE/D3D11 error instead of a screenshot of a blank canvas.

Co-Authored-By: Claude Fable 5 <[email protected]>
This commit is contained in:
Hakan SevenandClaude Fable 5 committed 2026-07-21 16:43:35 +03:00
1 parent 77535f7c68
commit 427db6cd17
4 files changed
+131

No files matched your search

+5
View File
@@ -28,6 +28,11 @@ fn main() -> iced::Result {
#[cfg(target_arch = "wasm32")]
{
console_error_panic_hook::set_once();
// After the console hook so the chained panic mirror keeps it; also
// installs the log-facade listener that surfaces wgpu/naga errors as
// a copyable on-page banner (#414 — an empty canvas otherwise gives
// reporters nothing to paste).
sys::web_diag::init();
return app::run_web();
}
#[cfg(not(target_arch = "wasm32"))]