Skip to content

Commit 756c588

Browse files
t3dotggclaude
andcommitted
fix(marketing): Macs always get the arm64 build
Browser arch sniffing kept handing Apple Silicon users the Intel dmg. Detection is deleted, not patched: the site now always serves arm64 to Macs, and Intel users pick their build explicitly on /download. Co-Authored-By: Claude Fable 5 <[email protected]>
1 parent 3b8e7bb commit 756c588

4 files changed

Lines changed: 30 additions & 69 deletions

File tree

‎apps/marketing/src/lib/macArch.test.ts‎

Lines changed: 0 additions & 23 deletions
This file was deleted.

‎apps/marketing/src/lib/macArch.ts‎

Lines changed: 0 additions & 14 deletions
This file was deleted.

‎apps/marketing/src/pages/download.astro‎

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,10 @@ import { ANDROID_PLAY_STORE_URL, IOS_APP_STORE_URL } from "../lib/site";
2424
<span class="card-arch">Apple Silicon (arm64)</span>
2525
<span class="card-format">.dmg</span>
2626
</a>
27-
<a class="download-card" data-asset="x64.dmg" href={RELEASES_URL}>
28-
<span class="card-arch">Intel (x64)</span>
29-
<span class="card-format">.dmg</span>
30-
</a>
3127
</div>
28+
<p class="intel-note">
29+
On an Intel Mac? <a data-asset="x64.dmg" href={RELEASES_URL}>Download the x64 build</a>.
30+
</p>
3231
</section>
3332

3433
<!-- Windows -->
@@ -92,8 +91,8 @@ import { ANDROID_PLAY_STORE_URL, IOS_APP_STORE_URL } from "../lib/site";
9291

9392
async function init() {
9493
const versionLabel = document.getElementById("version-label");
95-
// Only release-asset cards; mobile store cards have no data-asset and keep their href.
96-
const cards = document.querySelectorAll<HTMLAnchorElement>(".download-card[data-asset]");
94+
// Only release-asset links; mobile store cards have no data-asset and keep their href.
95+
const cards = document.querySelectorAll<HTMLAnchorElement>("a[data-asset]");
9796

9897
try {
9998
const release = await fetchLatestRelease();
@@ -257,6 +256,24 @@ import { ANDROID_PLAY_STORE_URL, IOS_APP_STORE_URL } from "../lib/site";
257256
color: var(--fg-dim);
258257
}
259258

259+
.intel-note {
260+
font-size: 0.8rem;
261+
color: var(--fg-dim);
262+
}
263+
264+
.intel-note a {
265+
color: var(--fg-muted);
266+
text-decoration: underline;
267+
text-decoration-color: rgba(161, 161, 170, 0.4);
268+
text-underline-offset: 3px;
269+
transition: color 0.3s ease, text-decoration-color 0.3s ease;
270+
}
271+
272+
.intel-note a:hover {
273+
color: var(--fg);
274+
text-decoration-color: var(--fg);
275+
}
276+
260277
/* ── Releases link ── */
261278

262279
.releases-link {

‎apps/marketing/src/pages/index.astro‎

Lines changed: 7 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -391,46 +391,27 @@ const mobileEndorsementRows = [
391391

392392
<script>
393393
import { fetchLatestRelease, RELEASES_URL, type ReleaseAsset } from "../lib/releases";
394-
import { macArchFromGpuRenderer } from "../lib/macArch";
395394

396-
type Platform = { os: "mac" | "win" | "linux"; label: string; arch?: string };
397-
398-
// navigator.userAgent reports "Intel Mac OS X" on both Intel and Apple Silicon
399-
// Macs, so probe the GPU renderer instead: Apple Silicon exposes an "Apple" GPU.
400-
function detectMacArch(): "arm64" | "x64" {
401-
try {
402-
const canvas = document.createElement("canvas");
403-
const gl = (canvas.getContext("webgl") ||
404-
canvas.getContext("experimental-webgl")) as WebGLRenderingContext | null;
405-
const debugInfo = gl?.getExtension("WEBGL_debug_renderer_info");
406-
if (gl && debugInfo) {
407-
const renderer = String(gl.getParameter(debugInfo.UNMASKED_RENDERER_WEBGL) ?? "");
408-
return macArchFromGpuRenderer(renderer);
409-
}
410-
} catch {
411-
// fall through to the default below
412-
}
413-
return macArchFromGpuRenderer("");
414-
}
395+
type Platform = { os: "mac" | "win" | "linux"; label: string };
415396

416397
function detectPlatform(): Platform | null {
417398
const ua = navigator.userAgent;
418399
if (/Win/i.test(ua)) return { os: "win", label: "Download for Windows" };
419-
if (/Mac/i.test(ua)) {
420-
return { os: "mac", label: "Download for macOS", arch: detectMacArch() };
421-
}
400+
if (/Mac/i.test(ua)) return { os: "mac", label: "Download for macOS" };
422401
if (/Linux/i.test(ua)) return { os: "linux", label: "Download for Linux" };
423402
return null;
424403
}
425404

405+
// Macs always get the arm64 build. Browsers cannot reliably tell Apple Silicon
406+
// from Intel (the UA lies, GPU strings lie), and a wrong guess hands an Apple
407+
// Silicon user a broken app. Intel users pick their build on /download.
408+
// Do NOT add arch detection back here.
426409
function pickAsset(assets: ReleaseAsset[], platform: Platform): string | null {
427410
if (platform.os === "win") {
428411
return assets.find((a) => a.name.endsWith("-x64.exe"))?.browser_download_url ?? null;
429412
}
430413
if (platform.os === "mac") {
431-
const preferred = assets.find((a) => a.name.endsWith(`-${platform.arch}.dmg`));
432-
const fallback = assets.find((a) => a.name.endsWith(".dmg"));
433-
return (preferred ?? fallback)?.browser_download_url ?? null;
414+
return assets.find((a) => a.name.endsWith("-arm64.dmg"))?.browser_download_url ?? null;
434415
}
435416
if (platform.os === "linux") {
436417
return assets.find((a) => a.name.endsWith(".AppImage"))?.browser_download_url ?? null;

0 commit comments

Comments
 (0)