Skip to content

armgit / macro

Public Imported from GitHub
0

Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.

fix(marketing): download desktop installers for the detected platform (#7638)

Eric Hayesfc4ae95b31a1
diff --git a/apps/marketing/README.md b/apps/marketing/README.md
index 22d3ff7d5a..1f36176475 100644
--- a/apps/marketing/README.md
+++ b/apps/marketing/README.md
@@ -104,9 +104,15 @@ public feature and blog routes, `/download`, and `/start`;
`/onboarding-preview.html` remains a development review entry. It does not host
the authenticated `/app/*` routes.
-`/download` has a single “Download for macOS” button for Apple silicon Macs.
-It resolves the current DMG from the latest GitHub release in the browser,
-with the latest release page as a fallback, and shows the current release tag.
+`/download` says “Available for macOS and Linux” and has one download button.
+Desktop Linux browsers receive the x86_64 AppImage; other browsers default to
+the Apple silicon DMG, with the selected platform named in the button.
+It searches recent stable GitHub releases for each installer, skipping CLI-only
+releases and unfinished platform uploads.
+Verified direct installer URLs remain usable while loading and if the API fails;
+update these fallbacks in `desktopDownloads.ts` when retiring older installers.
+The separate “All releases” link opens GitHub, with the selected installer's
+release version displayed beneath it.
The page hides the header's Open app action, has no web-app download option,
and has no header/footer navigation entry.
Check the installer link, keyboard navigation, and desktop/mobile layouts.
diff --git a/apps/marketing/src/app/routes/RouteDownload.css b/apps/marketing/src/app/routes/RouteDownload.css
index 70342a9a60..cfe1ce2743 100644
--- a/apps/marketing/src/app/routes/RouteDownload.css
+++ b/apps/marketing/src/app/routes/RouteDownload.css
@@ -33,10 +33,11 @@
.downloads-header h1 {
margin: 0 0 14px;
font:
- 500 clamp(30px, 4vw, 40px) / 1.2 "Inter Variable",
- Inter,
- sans-serif;
- letter-spacing: -0.045em;
+ 315 clamp(30px, 4vw, 40px) / 1.12 "Roboto Slab Variable",
+ display,
+ serif;
+ letter-spacing: -0.035em;
+ text-wrap: balance;
}
.downloads-header p {
@@ -52,12 +53,6 @@
gap: 12px;
}
-.downloads-action p {
- color: #777;
- font-size: 12px;
- line-height: 1.5;
-}
-
/* Preserve the shared primary button's ink over the legacy anchor reset. */
.downloads-action .site-nav-start {
color: #000;
@@ -83,6 +78,13 @@
height: 13px;
}
+.downloads-page .downloads-version {
+ margin-top: 8px;
+ color: #777;
+ font-size: 12px;
+ text-align: center;
+}
+
@media (max-width: 600px) {
.downloads-page {
padding: 112px 12px 76px;
diff --git a/apps/marketing/src/app/routes/RouteDownload.tsx b/apps/marketing/src/app/routes/RouteDownload.tsx
index 15987aa67e..64fb14c24e 100644
--- a/apps/marketing/src/app/routes/RouteDownload.tsx
+++ b/apps/marketing/src/app/routes/RouteDownload.tsx
@@ -1,11 +1,14 @@
import MacroLogo from '@icon/macro-logo.svg';
import ArrowUpRight from '@phosphor/arrow-up-right.svg';
-import { createSignal, onCleanup, onMount } from 'solid-js';
+import { createSignal, onCleanup, onMount, Show } from 'solid-js';
import { FeaturePage } from '../../features/marketing/components/FeaturePage';
import {
DESKTOP_RELEASE_API_URL,
DESKTOP_RELEASE_URL,
type DesktopDownloadUrls,
+ type DesktopPlatform,
+ desktopReleaseVersion,
+ detectDesktopPlatform,
FALLBACK_DOWNLOAD_URLS,
releaseDownloadUrls,
} from '../../features/marketing/core/desktopDownloads';
@@ -15,18 +18,20 @@ import './RouteDownload.css';
export function RouteDownload() {
setPageSeo({
- title: 'Download Macro for macOS',
- description:
- 'Download the latest release of Macro for macOS. Available for Apple silicon Macs.',
+ title: 'Download Macro for macOS and Linux',
+ description: 'Download the latest release of Macro for macOS and Linux.',
path: '/download',
});
const [downloads, setDownloads] = createSignal<DesktopDownloadUrls>(
FALLBACK_DOWNLOAD_URLS
);
- const [releaseTag, setReleaseTag] = createSignal<string>();
+ const [platform, setPlatform] = createSignal<DesktopPlatform>('macos');
+ const downloadUrl = () => downloads()[platform()];
+ const releaseVersion = () => desktopReleaseVersion(downloadUrl());
onMount(() => {
+ setPlatform(detectDesktopPlatform(navigator.userAgent));
const controller = new AbortController();
const loadLatestRelease = async () => {
try {
@@ -35,12 +40,10 @@ export function RouteDownload() {
signal: controller.signal,
});
if (!response.ok) throw new Error('Unable to load desktop release');
- const release = await response.json();
- setDownloads(releaseDownloadUrls(release));
- if (typeof release.tag_name === 'string')
- setReleaseTag(release.tag_name);
+ const releases = await response.json();
+ setDownloads(releaseDownloadUrls(releases));
} catch {
- // The release page remains a usable fallback if the API is unavailable.
+ // Keep direct installer links usable if GitHub is unavailable or rate-limited.
}
};
void loadLatestRelease();
@@ -55,22 +58,24 @@ export function RouteDownload() {
<MacroLogo />
</div>
<h1>Download Macro</h1>
- <p>Available for macOS.</p>
+ <p>Available for macOS and Linux</p>
</header>
<div class="downloads-action">
- <a class="site-nav-start" href={downloads().macos}>
- Download for macOS
+ <a class="site-nav-start" href={downloadUrl()}>
+ Download for {platform() === 'linux' ? 'Linux' : 'macOS'}
</a>
- <p>Apple silicon · DMG</p>
</div>
<p class="downloads-release">
<a href={DESKTOP_RELEASE_URL} target="_blank" rel="noreferrer">
- {releaseTag() ? `Release ${releaseTag()}` : 'Latest release'}
+ All releases
<ArrowUpRight aria-hidden="true" />
</a>
</p>
+ <Show when={releaseVersion()}>
+ {(version) => <p class="downloads-version">{version()}</p>}
+ </Show>
</div>
<SectionMoreFeatures currentPath="/download" footerOnly />
</FeaturePage>
diff --git a/apps/marketing/src/features/marketing/core/desktopDownloads.test.ts b/apps/marketing/src/features/marketing/core/desktopDownloads.test.ts
new file mode 100644
index 0000000000..f861ec896a
--- /dev/null
+++ b/apps/marketing/src/features/marketing/core/desktopDownloads.test.ts
@@ -0,0 +1,104 @@
+import { describe, expect, it } from 'vitest';
+import {
+ desktopReleaseVersion,
+ detectDesktopPlatform,
+ FALLBACK_DOWNLOAD_URLS,
+ releaseDownloadUrls,
+} from './desktopDownloads';
+
+const macos = {
+ name: 'Macro-2.5.0-aarch64-darwin.dmg',
+ browser_download_url: 'https://example.com/mac.dmg',
+};
+const linux = {
+ name: 'Macro-2.5.0-x86_64-linux.AppImage',
+ browser_download_url: 'https://example.com/linux.AppImage',
+};
+
+describe('detectDesktopPlatform', () => {
+ it.each([
+ ['Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7)', 'macos'],
+ ['Mozilla/5.0 (X11; Linux x86_64)', 'linux'],
+ ['Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:131.0)', 'linux'],
+ ['Mozilla/5.0 (Linux; Android 14; Pixel 8)', 'macos'],
+ ['Mozilla/5.0 (X11; CrOS x86_64)', 'macos'],
+ ['Mozilla/5.0 (Windows NT 10.0; Win64; x64)', 'macos'],
+ ['Mozilla/5.0 (iPhone; CPU iPhone OS 18_0 like Mac OS X)', 'macos'],
+ ['', 'macos'],
+ ])('selects an installer for %s', (userAgent, platform) => {
+ expect(detectDesktopPlatform(userAgent)).toBe(platform);
+ });
+});
+
+describe('desktopReleaseVersion', () => {
+ it('uses the selected installer release, including fallback installers', () => {
+ expect(desktopReleaseVersion(FALLBACK_DOWNLOAD_URLS.macos)).toBe(
+ 'v2026.10.6.0'
+ );
+ expect(
+ desktopReleaseVersion(
+ 'https://github.com/macro-inc/macro/releases/download/v2026.10.7.0/Macro-2.5.0-x86_64-linux.AppImage'
+ )
+ ).toBe('v2026.10.7.0');
+ expect(
+ desktopReleaseVersion('https://example.com/mac.dmg')
+ ).toBeUndefined();
+ });
+});
+
+describe('releaseDownloadUrls', () => {
+ it('finds desktop installers behind a newer CLI-only release', () => {
+ expect(
+ releaseDownloadUrls([
+ {
+ assets: [
+ {
+ name: 'macrod-v2026.10.6.1-macos-aarch64.tar.gz',
+ browser_download_url: 'https://example.com/cli.tar.gz',
+ },
+ ],
+ },
+ { assets: [macos, linux] },
+ ])
+ ).toEqual({
+ macos: macos.browser_download_url,
+ linux: linux.browser_download_url,
+ });
+ });
+
+ it('selects each platform independently during partial uploads', () => {
+ expect(
+ releaseDownloadUrls([
+ { assets: [macos] },
+ {
+ assets: [
+ { ...macos, browser_download_url: 'https://example.com/old.dmg' },
+ linux,
+ ],
+ },
+ ])
+ ).toEqual({
+ macos: macos.browser_download_url,
+ linux: linux.browser_download_url,
+ });
+ });
+
+ it('excludes draft and prerelease installers', () => {
+ expect(
+ releaseDownloadUrls([
+ { draft: true, assets: [macos, linux] },
+ { prerelease: true, assets: [macos, linux] },
+ ])
+ ).toEqual(FALLBACK_DOWNLOAD_URLS);
+ });
+
+ it('keeps direct installer fallbacks when assets are missing', () => {
+ expect(releaseDownloadUrls([])).toEqual(FALLBACK_DOWNLOAD_URLS);
+ expect(releaseDownloadUrls([{}, { assets: [linux] }])).toEqual({
+ macos: FALLBACK_DOWNLOAD_URLS.macos,
+ linux: linux.browser_download_url,
+ });
+ expect(FALLBACK_DOWNLOAD_URLS.macos).toMatch(/\/download\/.*\.dmg$/);
+ expect(FALLBACK_DOWNLOAD_URLS.linux).toMatch(/\/download\/.*\.AppImage$/);
+ });
+});
diff --git a/apps/marketing/src/features/marketing/core/desktopDownloads.ts b/apps/marketing/src/features/marketing/core/desktopDownloads.ts
index 3762103259..1d8825b5d9 100644
--- a/apps/marketing/src/features/marketing/core/desktopDownloads.ts
+++ b/apps/marketing/src/features/marketing/core/desktopDownloads.ts
@@ -1,15 +1,27 @@
export const DESKTOP_RELEASE_URL =
- 'https://github.com/macro-inc/macro/releases/latest';
+ 'https://github.com/macro-inc/macro/releases';
export const DESKTOP_RELEASE_API_URL =
- 'https://api.github.com/repos/macro-inc/macro/releases/latest';
+ 'https://api.github.com/repos/macro-inc/macro/releases?per_page=100';
export type DesktopPlatform = 'macos' | 'linux';
export type DesktopDownloadUrls = Record<DesktopPlatform, string>;
+export function detectDesktopPlatform(userAgent: string): DesktopPlatform {
+ return /linux/i.test(userAgent) && !/android|cros/i.test(userAgent)
+ ? 'linux'
+ : 'macos';
+}
+
+export function desktopReleaseVersion(downloadUrl: string): string | undefined {
+ return downloadUrl.match(/\/releases\/download\/([^/]+)\//)?.[1];
+}
+
export const FALLBACK_DOWNLOAD_URLS: DesktopDownloadUrls = {
- macos: DESKTOP_RELEASE_URL,
- linux: DESKTOP_RELEASE_URL,
+ macos:
+ 'https://github.com/macro-inc/macro/releases/download/v2026.10.6.0/Macro-2.5.0-aarch64-darwin.dmg',
+ linux:
+ 'https://github.com/macro-inc/macro/releases/download/v2026.10.6.0/Macro-2.5.0-x86_64-linux.AppImage',
};
interface ReleaseAsset {
@@ -18,20 +30,26 @@ interface ReleaseAsset {
}
interface GithubRelease {
+ draft?: boolean;
+ prerelease?: boolean;
assets?: ReleaseAsset[];
}
export function releaseDownloadUrls(
- release: GithubRelease
+ releases: GithubRelease[]
): DesktopDownloadUrls {
- const assets = release.assets ?? [];
+ // CLI releases and desktop uploads can arrive separately. Find each installer
+ // in the newest stable release that actually contains it.
+ const assets = releases
+ .filter((release) => !release.draft && !release.prerelease)
+ .flatMap((release) => release.assets ?? []);
const findAsset = (suffix: string) =>
assets.find(
(asset) => asset.name.startsWith('Macro-') && asset.name.endsWith(suffix)
)?.browser_download_url;
return {
- macos: findAsset('-aarch64-darwin.dmg') ?? DESKTOP_RELEASE_URL,
- linux: findAsset('-x86_64-linux.AppImage') ?? DESKTOP_RELEASE_URL,
+ macos: findAsset('-aarch64-darwin.dmg') ?? FALLBACK_DOWNLOAD_URLS.macos,
+ linux: findAsset('-x86_64-linux.AppImage') ?? FALLBACK_DOWNLOAD_URLS.linux,
};
}