From 99bc462315c304ad19e8c3672cfbab66385f9b2c Mon Sep 17 00:00:00 2001 From: Jakob Wennberg <149234542+jakobwennberg@users.noreply.github.com> Date: Fri, 20 Mar 2026 15:11:44 +0100 Subject: [PATCH] fix: prevent Chrome auto-translate from crashing onboarding (#65) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix: prevent Chrome auto-translate from crashing React during onboarding Chrome auto-translate modifies DOM text nodes when it detects a Swedish page (lang="sv") in a browser set to English. React does not expect external DOM mutations and throws, crashing the entire component tree into global-error.tsx on every step transition. Add translate="no" and to suppress browser translation. Also fix timezone-unsafe date parsing in fiscal period validation (new Date("YYYY-MM-DD") + getDate() returns local-timezone values, shifting dates by -1 day in Western timezones). Co-Authored-By: Claude Opus 4.6 (1M context) * fix: add notranslate meta tag to global-error.tsx for consistency Per review feedback — global-error.tsx renders its own document, so it needs the same tag as layout.tsx to fully suppress Chrome translation on error pages. Co-Authored-By: Claude Opus 4.6 (1M context) --------- Co-authored-by: Claude Opus 4.6 (1M context) --- app/global-error.tsx | 5 ++- app/layout.tsx | 3 +- .../onboarding/Step3TaxRegistration.tsx | 24 ++++++-------- lib/bookkeeping/validate-period-duration.ts | 32 +++++++++++++------ 4 files changed, 38 insertions(+), 26 deletions(-) diff --git a/app/global-error.tsx b/app/global-error.tsx index b76eaa64..444a85cc 100644 --- a/app/global-error.tsx +++ b/app/global-error.tsx @@ -15,7 +15,10 @@ export default function GlobalError({ }, [error]); return ( - + + + +
diff --git a/app/layout.tsx b/app/layout.tsx index 478b4638..73551a47 100644 --- a/app/layout.tsx +++ b/app/layout.tsx @@ -46,8 +46,9 @@ export default function RootLayout({ children: React.ReactNode; }>) { return ( - + +