From d8da7acb7db19a4b4f0018d5b2fd0c897480e046 Mon Sep 17 00:00:00 2001 From: oliver Date: Wed, 14 Oct 2026 19:37:31 +0800 Subject: [PATCH] Login starfield: skip painting on a zero-size viewport. A hidden pane reports 0x0, which made the band direction NaN and createRadialGradient throw, replacing the login page with the error boundary. Wait for a resize with a real size instead. Co-Authored-By: Claude Opus 5.5 --- web/src/features/auth/LoginStarfield.tsx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/web/src/features/auth/LoginStarfield.tsx b/web/src/features/auth/LoginStarfield.tsx index a5b7b2e..ce06070 100644 --- a/web/src/features/auth/LoginStarfield.tsx +++ b/web/src/features/auth/LoginStarfield.tsx @@ -175,6 +175,8 @@ export function LoginStarfield() { const dpr = Math.min(window.devicePixelRatio || 1, 2); const w = window.innerWidth; const h = window.innerHeight; + // Hidden/zero-size viewport: gradients would get NaN coords and throw. Wait for a resize. + if (!(w >= 1 && h >= 1 && Number.isFinite(w) && Number.isFinite(h))) return; sky.width = Math.round(w * dpr); sky.height = Math.round(h * dpr); ctx.setTransform(dpr, 0, 0, dpr, 0, 0);