From 35e75afaea06ee7fd5dd58513a622e286f8a0bb5 Mon Sep 17 00:00:00 2001 From: Shalin-Shah-2002 <2002shalin@gmail.com> Date: Sat, 25 Jul 2026 22:45:00 +0530 Subject: [PATCH 1/2] fix(marketing): detect CPU arch for macOS download button instead of hardcoding arm64 --- apps/marketing/src/pages/index.astro | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/apps/marketing/src/pages/index.astro b/apps/marketing/src/pages/index.astro index 9d1cfbdd125d..88473449fae9 100644 --- a/apps/marketing/src/pages/index.astro +++ b/apps/marketing/src/pages/index.astro @@ -383,11 +383,23 @@ const mobileEndorsementRows = [ type Platform = { os: "mac" | "win" | "linux"; label: string; arch?: string }; - function detectPlatform(): Platform | null { + async function detectPlatform(): Promise { const ua = navigator.userAgent; if (/Win/i.test(ua)) return { os: "win", label: "Download for Windows" }; if (/Mac/i.test(ua)) { - return { os: "mac", label: "Download for macOS", arch: "arm64" }; + let arch = "arm64"; + try { + const uad = (navigator as { userAgentData?: { getHighEntropyValues: (hints: string[]) => Promise<{ architecture?: string }> } }).userAgentData; + if (uad?.getHighEntropyValues) { + const values = await uad.getHighEntropyValues(["architecture"]); + if (values.architecture === "x86") arch = "x64"; + } else if (/Intel|i\d86/i.test(ua)) { + arch = "x64"; + } + } catch { + if (/Intel|i\d86/i.test(ua)) arch = "x64"; + } + return { os: "mac", label: "Download for macOS", arch }; } if (/Linux/i.test(ua)) return { os: "linux", label: "Download for Linux" }; return null; @@ -415,7 +427,7 @@ const mobileEndorsementRows = [ const ctaLabel = document.getElementById("cta-download-label"); const kbd = document.getElementById("pr-button-kbd"); - const platform = detectPlatform(); + const platform = await detectPlatform(); if (!platform) return; document.documentElement.dataset.platform = platform.os; if (label) label.textContent = platform.label; From 1f346d7711d6bfdd4db7242d6c0b06979898dcb6 Mon Sep 17 00:00:00 2001 From: Shalin-Shah-2002 <2002shalin@gmail.com> Date: Sat, 25 Jul 2026 22:48:37 +0530 Subject: [PATCH 2/2] =?UTF-8?q?fix(marketing):=20remove=20unreliable=20UA-?= =?UTF-8?q?based=20Intel=20fallback=20=E2=80=94=20all=20macOS=20UAs=20repo?= =?UTF-8?q?rt=20Intel=20even=20on=20Apple=20Silicon?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/marketing/src/pages/index.astro | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/apps/marketing/src/pages/index.astro b/apps/marketing/src/pages/index.astro index 88473449fae9..fe91c43eea26 100644 --- a/apps/marketing/src/pages/index.astro +++ b/apps/marketing/src/pages/index.astro @@ -393,11 +393,10 @@ const mobileEndorsementRows = [ if (uad?.getHighEntropyValues) { const values = await uad.getHighEntropyValues(["architecture"]); if (values.architecture === "x86") arch = "x64"; - } else if (/Intel|i\d86/i.test(ua)) { - arch = "x64"; } } catch { - if (/Intel|i\d86/i.test(ua)) arch = "x64"; + // UA-based fallback is unreliable — all macOS UAs report "Intel Mac OS X", + // even on Apple Silicon. Default to arm64 (majority of modern Macs). } return { os: "mac", label: "Download for macOS", arch }; }