From a6ac8ceba7f5593dc72ae791a178d6a17a1eba26 Mon Sep 17 00:00:00 2001 From: James Pine Date: Sat, 18 Apr 2026 23:31:34 -0700 Subject: [PATCH] fix(landing): address PR #487 review feedback MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Preserve canonical camelCase platform aliases (macArm, macIntel) in the /download/[platform] redirect so those URLs don't lose their platform param. - Add accessible title + role="img" to the inline Windows SVG so it passes Biome's a11y rule and announces to screen readers. - On /api/releases fetch failure, show an explicit error state with a single intentional link to GitHub releases — no more silent GitHub fallback or disabled-button UX lie. Keeps normies off GitHub unless they opt in. Co-Authored-By: Claude Opus 4.7 (1M context) --- landing/src/app/download/[platform]/route.ts | 2 + landing/src/app/download/page.tsx | 93 ++++++++++++-------- landing/src/components/PlatformIcons.tsx | 3 + 3 files changed, 60 insertions(+), 38 deletions(-) diff --git a/landing/src/app/download/[platform]/route.ts b/landing/src/app/download/[platform]/route.ts index 46140ce8..b3b0b9b8 100644 --- a/landing/src/app/download/[platform]/route.ts +++ b/landing/src/app/download/[platform]/route.ts @@ -9,7 +9,9 @@ export const dynamic = 'force-dynamic'; // to GitHub or direct asset URLs. const PLATFORM_ALIAS: Record = { 'mac-arm': 'macArm', + macArm: 'macArm', 'mac-intel': 'macIntel', + macIntel: 'macIntel', windows: 'windows', }; diff --git a/landing/src/app/download/page.tsx b/landing/src/app/download/page.tsx index d7f0a8f7..b1852ae8 100644 --- a/landing/src/app/download/page.tsx +++ b/landing/src/app/download/page.tsx @@ -13,7 +13,7 @@ import Link from 'next/link'; import { useEffect, useMemo, useState } from 'react'; import { AppleIcon, LinuxIcon, WindowsIcon } from '@/components/PlatformIcons'; import { Button } from '@/components/ui/button'; -import { DONATE_URL, GITHUB_REPO } from '@/lib/constants'; +import { DONATE_URL, GITHUB_RELEASES_PAGE, GITHUB_REPO } from '@/lib/constants'; import type { DownloadLinks } from '@/lib/releases'; type Platform = keyof DownloadLinks; @@ -168,11 +168,11 @@ export default function DownloadPage() { ) : ( <>

- Download Voicebox + {linksError ? "We couldn't load the latest release." : 'Download Voicebox'}

{linksError - ? "We couldn't reach the release server. Pick your platform manually below." + ? 'Our release server is temporarily unreachable. Please try again in a moment.' : 'Pick your platform to get started.'}

@@ -181,42 +181,59 @@ export default function DownloadPage() { {/* Platform buttons — always visible as a fallback */} -
-

- {triggered ? 'Download not working?' : 'Choose your platform'} -

-
- {PLATFORMS.map((meta) => { - const isLinux = meta.key === 'linux'; - const url = isLinux ? '/linux-install' : links?.[meta.key]; - const isActive = meta.key === platform; - const disabled = !isLinux && !url; - return ( - { - if (disabled) e.preventDefault(); - }} - className={`flex items-center rounded-xl border px-5 py-4 transition-all group ${ - isActive - ? 'border-accent/40 bg-accent/5 hover:border-accent/60' - : 'border-border bg-card/40 hover:border-accent/30 hover:bg-card' - } ${disabled ? 'opacity-50 cursor-not-allowed' : ''}`} - > - -
-
{meta.label}
-
{meta.description}
-
- -
- ); - })} + {linksError ? ( +
+

+ If this keeps happening, you can{' '} + + browse releases on GitHub + + {' '}and grab the build for your platform manually. +

-
+ ) : ( +
+

+ {triggered ? 'Download not working?' : 'Choose your platform'} +

+ +
+ )} {/* Donate — prominent, heartfelt, post-click context */}
diff --git a/landing/src/components/PlatformIcons.tsx b/landing/src/components/PlatformIcons.tsx index 572cdf6f..51b321a7 100644 --- a/landing/src/components/PlatformIcons.tsx +++ b/landing/src/components/PlatformIcons.tsx @@ -19,7 +19,10 @@ export function WindowsIcon({ className }: { className?: string }) { viewBox="0 0 24 24" fill="currentColor" xmlns="http://www.w3.org/2000/svg" + role="img" + aria-label="Windows" > + Windows );