Skip to content

[desktop][downloads] Hero "Download for macOS" CTA serves arm64 to Intel users — route by client-detected arch #954

Description

@softmarshmallow

Summary

On grida.co/downloads, the primary hero button ("Download for macOS", also triggered by the D shortcut) serves an arm64 DMG to all Mac users — including Intel Macs, where an arm64 binary cannot launch (Rosetta 2 translates x64→arm64, not the reverse). Intel users must instead scroll to the secondary list and click the explicit "Download for macOS (Intel-based Macs)" button.

Surfaced by a Codex review on #953 (the PR that restored x64 builds). Restoring x64 (#947) fixed the availability but not the primary download path for the exact users it set out to unblock.

Root cause

The default is chosen server-side by pickDefault() in downloads.ts, which hard-codes macmac_dmg_arm64. It can't do better: the macOS user-agent cannot distinguish Intel from Apple Silicon — Apple reports Intel Mac OS X in the UA on both architectures. So no server-side default is universally correct:

  • default arm64 (current) → wrong for Intel (won't launch),
  • default x64 → wrong for the Apple Silicon majority (runs, but under Rosetta — slower, non-native).

Proposed fix (client-side arch detection)

PrimaryDownloadButton in download-button.tsx is already a client component with an effect. Detect Apple Silicon on the client and pick the arch accordingly:

  • Read the WebGL unmasked renderer string (WEBGL_debug_renderer_infoUNMASKED_RENDERER_WEBGL). Apple Silicon reports Apple GPU / Apple M…; Intel Macs report Intel … / AMD …. (Works on Safari, which navigator.userAgentData does not.)
  • Thread mac_dmg_x64 into the component as a prop; when os === "mac" and the GPU is not Apple, swap the hero href to the x64 DMG.
  • Fallback: if WebGL is blocked / renderer unavailable, keep the arm64 default (safe — matches today's behavior).

Alternative (the "real" fix)

A universal binary (single fat DMG native on both arches) removes the choice entirely. It was explicitly scoped out of #947 (Option C) for the extra moving parts (ASAR merge, signing/notarizing a universal bundle, GRIDA-SEC-004 sidecar + unpacked native-dep validation). If we adopt universal later, this issue and the per-arch download buttons collapse into one.

Acceptance

  • Intel Mac: hero button + D shortcut download the x64 DMG.
  • Apple Silicon Mac: hero button + D shortcut download the arm64 DMG.
  • WebGL-unavailable / detection-inconclusive: falls back to arm64 (no regression).

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    desktopthis is a Grida Desktop App related issueenhancementNew feature or request

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions