Open source Loom alternative. Beautiful, shareable screen recordings.
Rust appcapcossloommacnextjsnextjs15open-sourceossreactrecordrustscreen-capturescreen-recorderscreenshotsolidjstauritauri-apptypescriptvite
feat(web): point to 0.6.0 as the last Tauri release
Cursor Agent5ba127e83367
diff --git a/apps/web/__tests__/unit/download-route.test.ts b/apps/web/__tests__/unit/download-route.test.tsindex d28882749..2a02d09b7 100644--- a/apps/web/__tests__/unit/download-route.test.ts+++ b/apps/web/__tests__/unit/download-route.test.ts@@ -94,44 +94,4 @@ describe("desktop download route", () => {);vi.unstubAllGlobals();});-- it.each([- ["classic-apple-silicon", "dmg-aarch64-classic"],- ["classic-apple-intel", "dmg-x86_64-classic"],- ["classic-windows", "nsis-x86_64-classic"],- ["classic-linux-appimage", "appimage-x86_64-classic"],- ])(- "serves Cap Classic for %s from its own platform",- async (platform, asset) => {- const fetch = vi.fn().mockResolvedValue({- status: 206,- url: `https://downloads.example/${asset}`,- body: { cancel: vi.fn().mockResolvedValue(undefined) },- });- vi.stubGlobal("fetch", fetch);- const response = await GET(request, {- params: Promise.resolve({ platform }),- });- expect(fetch.mock.calls[0]?.[0]).toBe(- `https://cdn.crabnebula.app/download/cap/cap/latest/platform/${asset}`,- );- expect(response.headers.get("location")).toBe(- `https://downloads.example/${asset}`,- );- vi.unstubAllGlobals();- },- );-- it("sends Cap Classic downloads back to the download page when unavailable", async () => {- vi.stubGlobal("fetch", vi.fn().mockRejectedValue(new Error("Unavailable")));- vi.mocked(getGitHubReleases).mockClear();- const response = await GET(request, {- params: Promise.resolve({ platform: "classic-windows" }),- });- expect(response.headers.get("location")).toBe(- "https://cap.so/download?version=classic",- );- expect(getGitHubReleases).not.toHaveBeenCalled();- vi.unstubAllGlobals();- });});diff --git a/apps/web/app/(site)/download/[platform]/route.ts b/apps/web/app/(site)/download/[platform]/route.tsindex 300d1885c..83e574ceb 100644--- a/apps/web/app/(site)/download/[platform]/route.ts+++ b/apps/web/app/(site)/download/[platform]/route.ts@@ -52,7 +52,7 @@ export async function GET(const downloadUrls: Record<string,- { url: string; fallback: ReleaseDownloadKey | null }+ { url: string; fallback: ReleaseDownloadKey }> = {"apple-intel": {url: "https://cdn.crabnebula.app/download/cap/cap/latest/platform/dmg-x86_64",@@ -142,22 +142,6 @@ export async function GET(url: "https://cdn.crabnebula.app/download/cap/cap/latest/platform/pacman-x86_64",fallback: "linux-pacman",},- "classic-apple-silicon": {- url: "https://cdn.crabnebula.app/download/cap/cap/latest/platform/dmg-aarch64-classic",- fallback: null,- },- "classic-apple-intel": {- url: "https://cdn.crabnebula.app/download/cap/cap/latest/platform/dmg-x86_64-classic",- fallback: null,- },- "classic-windows": {- url: "https://cdn.crabnebula.app/download/cap/cap/latest/platform/nsis-x86_64-classic",- fallback: null,- },- "classic-linux-appimage": {- url: "https://cdn.crabnebula.app/download/cap/cap/latest/platform/appimage-x86_64-classic",- fallback: null,- },};const download = downloadUrls[platform];@@ -172,12 +156,6 @@ export async function GET(return NextResponse.redirect(primary.finalUrl);}- if (!download.fallback) {- return NextResponse.redirect(- new URL("/download?version=classic", request.url),- );- }-const fallback = await getGitHubFallbackDownloadUrl(download.fallback);if (fallback) {return NextResponse.redirect(fallback);diff --git a/apps/web/app/(site)/download/versions/page.tsx b/apps/web/app/(site)/download/versions/page.tsxindex 0e08ba515..cbcf7ea52 100644--- a/apps/web/app/(site)/download/versions/page.tsx+++ b/apps/web/app/(site)/download/versions/page.tsx@@ -20,6 +20,8 @@ export const metadata: Metadata = buildMarketingMetadata({export const revalidate = 60;+const LAST_TAURI_VERSION = "0.6.0";+function DownloadLinks({downloads,isLatest,@@ -203,8 +205,11 @@ function ReleaseRow({isLatest: boolean;}) {return (- <div className="flex flex-col gap-3 p-4 rounded-lg border border-gray-5 bg-gray-1 md:flex-row md:items-center md:justify-between">- <div className="flex flex-col gap-1">+ <div+ id={`v${release.version}`}+ className="flex flex-col gap-3 p-4 rounded-lg border scroll-mt-28 border-gray-5 bg-gray-1 md:flex-row md:items-center md:justify-between"+ >+ <div className="flex flex-col gap-1 md:shrink-0"><div className="flex items-center gap-2"><span className="text-lg font-semibold text-gray-12">v{release.version}@@ -214,6 +219,11 @@ function ReleaseRow({Latest</span>)}+ {release.version === LAST_TAURI_VERSION && (+ <span className="px-2 py-0.5 text-xs font-medium whitespace-nowrap rounded-full border border-gray-5 bg-gray-2 text-gray-11">+ Last Tauri version+ </span>+ )}</div><div className="flex items-center gap-3 text-sm text-gray-10"><span>{format(parseISO(release.publishedAt), "MMMM d, yyyy")}</span>@@ -270,6 +280,18 @@ export default async function VersionsPage() {</p></div>+ <div className="p-4 rounded-lg border border-gray-5 bg-gray-2">+ <h2 className="text-sm font-medium text-gray-12">+ Cap is now a fully native app+ </h2>+ <p className="mt-1 text-sm leading-6 text-gray-11">+ From 0.6.1, Cap is built natively for macOS, Windows, and Linux.+ Version {LAST_TAURI_VERSION} is the last release of the original+ app, which was built with Tauri. It stays available below, along+ with every earlier version.+ </p>+ </div>+{error ? (<div className="p-4 rounded-lg border border-red-5 bg-red-2 text-red-11">{error}diff --git a/apps/web/app/globals.css b/apps/web/app/globals.cssindex e26c2b576..446382dd7 100644--- a/apps/web/app/globals.css+++ b/apps/web/app/globals.css@@ -596,29 +596,12 @@ label {animation: dl-ink-draw 0.7s cubic-bezier(0.55, 0.1, 0.25, 1) 1.35s forwards;}-.dl-swap {- animation: dl-swap 0.32s cubic-bezier(0.2, 0.8, 0.2, 1) both;-}-@keyframes dl-ink-draw {to {stroke-dashoffset: 0;}}-@keyframes dl-swap {- from {- opacity: 0;- transform: translateY(4px);- filter: blur(2px);- }- to {- opacity: 1;- transform: none;- filter: none;- }-}-@media (prefers-reduced-motion: reduce) {.dl-ink path {animation: none;@@ -628,10 +611,6 @@ label {.dl-ink {filter: none;}-- .dl-swap {- animation: none;- }}.animate-delay-2 {diff --git a/apps/web/components/pages/DownloadPage.tsx b/apps/web/components/pages/DownloadPage.tsxindex 058e9e570..157de734b 100644--- a/apps/web/components/pages/DownloadPage.tsx+++ b/apps/web/components/pages/DownloadPage.tsx@@ -1,16 +1,9 @@"use client";import { Button } from "@cap/ui";-import clsx from "clsx";import { useDetectPlatform } from "hooks/useDetectPlatform";import Link from "next/link";-import {- type CSSProperties,- type ReactNode,- useEffect,- useId,- useState,-} from "react";+import { type CSSProperties, type ReactNode, useId, useState } from "react";import { trackEvent } from "@/app/utils/analytics";import { ChromeExtensionButton } from "@/components/ChromeExtensionButton";import {@@ -18,8 +11,6 @@ import {CHROME_EXTENSION_BUTTON_CLASS,} from "@/lib/chrome-extension";import {- getClassicDownloadUrl,- getClassicVersionText,getDownloadButtonText,getDownloadUrl,getPlatformIcon,@@ -27,28 +18,7 @@ import {PlatformIcons,} from "@/utils/platform";-type Edition = "native" | "classic";--const CLASSIC_QUERY = "classic";--const classicDownloads = [- {- href: "/download/classic-apple-silicon",- label: "Apple Silicon",- target: "apple_silicon",- },- {- href: "/download/classic-apple-intel",- label: "Apple Intel",- target: "apple_intel",- },- { href: "/download/classic-windows", label: "Windows", target: "windows" },- {- href: "/download/classic-linux-appimage",- label: "Linux AppImage",- target: "linux_appimage",- },-];+const LAST_TAURI_VERSION = "0.6.0";const BADGE_LOOP ="M 22 33 C 19 15, 84 7, 150 7.5 C 222 8, 289 14, 287 31 C 285 49, 214 55, 146 54 C 78 53, 12 47, 14 29 C 15.5 18, 44 10.5, 76 9";@@ -132,17 +102,6 @@ function NativeAnnouncement({ boil }: { boil: string }) {);}-function ClassicAnnouncement() {- return (- <div className="inline-flex items-center gap-3 text-[13px]">- <span className="rounded-full border border-gray-5 bg-gray-1 px-2.5 py-0.5 font-medium text-gray-11">- Classic- </span>- <span className="text-gray-11">The original Cap app</span>- </div>- );-}-function InkUnderline({children,boil,@@ -166,69 +125,17 @@ function InkUnderline({);}-function EditionToggle({- classic,- onChange,-}: {- classic: boolean;- onChange: (classic: boolean) => void;-}) {- const label = useId();- return (- <label- htmlFor={label}- className="group inline-flex cursor-pointer select-none items-center gap-3 rounded-full py-1.5 pr-3 pl-1.5 text-left transition-colors hover:bg-gray-3"- >- <button- id={label}- type="button"- role="switch"- aria-checked={classic}- onClick={() => onChange(!classic)}- className={clsx(- "relative h-5 w-9 shrink-0 rounded-full transition-colors duration-200 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-8 focus-visible:ring-offset-2",- classic ? "bg-blue-9" : "bg-gray-6",- )}- >- <span- className={clsx(- "absolute top-0.5 left-0.5 size-4 rounded-full bg-white shadow-sm transition-transform duration-200 ease-out",- classic && "translate-x-4",- )}- />- </button>- <span className="flex flex-col">- <span className="text-sm text-gray-12">- Download the original version- </span>- <span className="text-xs text-gray-10">- Cap Classic, the original Tauri app- </span>- </span>- </label>- );-}-export const DownloadPage = () => {const { platform, isIntel } = useDetectPlatform();const [copiedCliCommand, setCopiedCliCommand] = useState(false);- const [edition, setEdition] = useState<Edition>("native");const boil = useId().replace(/[^a-zA-Z0-9_-]/g, "");- const classic = edition === "classic";const loading = platform === null;- const primaryDownloadUrl = classic- ? getClassicDownloadUrl(platform, isIntel)- : getDownloadUrl(platform, isIntel);+ const primaryDownloadUrl = getDownloadUrl(platform, isIntel);const cliInstallCommand =platform === "windows"? "irm https://cap.so/install-cli.ps1 | iex": "curl -fsSL https://cap.so/install-cli.sh | sh";- useEffect(() => {- const version = new URLSearchParams(window.location.search).get("version");- if (version === CLASSIC_QUERY) setEdition("classic");- }, []);-const trackDownloadClick = (ctaLocation: string,targetUrl: string,@@ -241,21 +148,6 @@ export const DownloadPage = () => {target_url: targetUrl,detected_platform: platform ?? "unknown",is_intel: Boolean(isIntel),- edition,- });- };-- const selectEdition = (nextClassic: boolean) => {- const next: Edition = nextClassic ? "classic" : "native";- setEdition(next);- const url = new URL(window.location.href);- if (nextClassic) url.searchParams.set("version", CLASSIC_QUERY);- else url.searchParams.delete("version");- window.history.replaceState(window.history.state, "", url);- trackEvent("download_edition_selected", {- source_page: "download_page",- edition: next,- detected_platform: platform ?? "unknown",});};@@ -273,52 +165,31 @@ export const DownloadPage = () => {<div className="py-32 md:py-40 wrapper wrapper-sm"><BoilFilter id={boil} /><div className="space-y-4 text-center">- <div className="flex justify-center h-8 items-center fade-in-down">- <div key={edition} className="dl-swap">- {classic ? (- <ClassicAnnouncement />- ) : (- <NativeAnnouncement boil={boil} />- )}- </div>+ <div className="flex justify-center items-center h-8 fade-in-down">+ <NativeAnnouncement boil={boil} /></div><h1 className="text-2xl fade-in-down animate-delay-1 md:text-4xl">- {classic ? "Download Cap Classic" : "Download Cap"}+ Download Cap</h1>- <p- key={`intro-${edition}`}- className="dl-swap mx-auto max-w-xl px-4 text-sm text-gray-11 md:text-base md:px-0"- >- {classic ? (- "The original Cap app. It installs next to Cap and shares your recordings and settings, so you can switch between them any time."- ) : (- <>- The quickest way to share your screen, now a{" "}- <InkUnderline boil={boil}>fully native app</InkUnderline>. It- opens faster and stays light on your computer while you record.- </>- )}+ <p className="px-4 mx-auto max-w-xl text-sm fade-in-down text-gray-11 animate-delay-2 md:text-base md:px-0">+ The quickest way to share your screen, now a{" "}+ <InkUnderline boil={boil}>fully native app</InkUnderline>. It opens+ faster and stays light on your computer while you record.</p><div className="flex flex-col justify-center items-center space-y-4 fade-in-up animate-delay-2"><div className="flex flex-col items-center space-y-4"><div className="flex flex-col gap-3 justify-center items-center w-full sm:flex-row sm:gap-4"><Button- variant={classic ? "dark" : "blue"}+ variant="blue"size="lg"href={primaryDownloadUrl}onClick={() =>- trackDownloadClick(- "primary",- primaryDownloadUrl,- classic ? "cap_classic" : undefined,- )+ trackDownloadClick("primary", primaryDownloadUrl)}className="flex justify-center items-center w-full font-medium text-white sm:w-auto">{!loading && getPlatformIcon(platform)}- {classic- ? "Download Cap Classic"- : getDownloadButtonText(platform, loading, isIntel)}+ {getDownloadButtonText(platform, loading, isIntel)}</Button><span className="text-sm font-medium text-gray-500">or</span><ChromeExtensionButton@@ -336,13 +207,28 @@ export const DownloadPage = () => {</div><div className="text-sm text-gray-10">- {classic- ? getClassicVersionText(platform)- : getVersionText(platform)}+ {getVersionText(platform)}</div>- <EditionToggle classic={classic} onChange={selectEdition} />+ <p className="text-xs text-gray-10">+ Looking for the original app?{" "}+ <Link+ href={`/download/versions#v${LAST_TAURI_VERSION}`}+ onClick={() =>+ trackDownloadClick(+ "last_tauri_version",+ "/download/versions",+ "tauri_app",+ )+ }+ className="underline underline-offset-2 hover:text-gray-12"+ >+ Cap {LAST_TAURI_VERSION}+ </Link>{" "}+ is still available.+ </p>+ {/* Windows SmartScreen video and instructions */}{platform === "windows" && (<div className="mt-4 max-w-md"><video@@ -398,107 +284,103 @@ export const DownloadPage = () => {<div className="pb-4 mt-6 fade-in-up animate-delay-2"><h3 className="mb-2 text-base font-medium text-gray-10">- {classic- ? "Cap Classic for other platforms:"- : "Other download options:"}+ Other download options:</h3>- {classic ? (- <div className="flex flex-col gap-3 justify-center items-center md:flex-row md:flex-wrap">- {classicDownloads- .filter((download) => download.href !== primaryDownloadUrl)- .map((download) => (- <a- key={download.href}- href={download.href}- onClick={() =>- trackDownloadClick(- `classic_${download.target}`,- download.href,- "cap_classic",- )- }- className="text-sm transition-all text-gray-10 hover:underline"- >- {download.label}- </a>- ))}- <Link- href="/download/versions"+ <div className="flex flex-col gap-3 justify-center items-center md:flex-row md:flex-wrap">+ {platform !== "windows" && (+ <a+ href="/download/windows"onClick={() =>- trackDownloadClick("all_versions", "/download/versions")+ trackDownloadClick(+ "other_option_windows",+ "/download/windows",+ )}className="text-sm transition-all text-gray-10 hover:underline">- All versions- </Link>- </div>- ) : (- <div className="flex flex-col gap-3 justify-center items-center md:flex-row md:flex-wrap">- {platform !== "windows" && (- <a- href="/download/windows"- onClick={() =>- trackDownloadClick(- "other_option_windows",- "/download/windows",- )- }- className="text-sm transition-all text-gray-10 hover:underline"- >- Windows (Beta)- </a>- )}- {platform !== "linux" && (- <a- href="/download/linux-deb"- onClick={() =>- trackDownloadClick(- "other_option_linux_deb",- "/download/linux-deb",- )- }- className="text-sm transition-all text-gray-10 hover:underline"- >- Debian / Ubuntu (.deb)- </a>- )}+ Windows (Beta)+ </a>+ )}+ {platform !== "linux" && (<a- href="/download/linux-appimage"+ href="/download/linux-deb"onClick={() =>trackDownloadClick(- "other_option_linux_appimage",- "/download/linux-appimage",+ "other_option_linux_deb",+ "/download/linux-deb",)}className="text-sm transition-all text-gray-10 hover:underline">- AppImage+ Debian / Ubuntu (.deb)</a>+ )}+ <a+ href="/download/linux-appimage"+ onClick={() =>+ trackDownloadClick(+ "other_option_linux_appimage",+ "/download/linux-appimage",+ )+ }+ className="text-sm transition-all text-gray-10 hover:underline"+ >+ AppImage+ </a>+ <a+ href="/download/linux-rpm"+ onClick={() =>+ trackDownloadClick(+ "other_option_linux_rpm",+ "/download/linux-rpm",+ )+ }+ className="text-sm transition-all text-gray-10 hover:underline"+ >+ Fedora / RPM+ </a>+ <a+ href="/download/linux-pacman"+ onClick={() =>+ trackDownloadClick(+ "other_option_linux_pacman",+ "/download/linux-pacman",+ )+ }+ className="text-sm transition-all text-gray-10 hover:underline"+ >+ Arch / Pacman+ </a>+ {platform === "macos" && isIntel && (<a- href="/download/linux-rpm"+ href="/download/apple-silicon"onClick={() =>trackDownloadClick(- "other_option_linux_rpm",- "/download/linux-rpm",+ "other_option_apple_silicon",+ "/download/apple-silicon",)}className="text-sm transition-all text-gray-10 hover:underline">- Fedora / RPM+ Apple Silicon</a>+ )}+ {platform === "macos" && !isIntel && (<a- href="/download/linux-pacman"+ href="/download/apple-intel"onClick={() =>trackDownloadClick(- "other_option_linux_pacman",- "/download/linux-pacman",+ "other_option_apple_intel",+ "/download/apple-intel",)}className="text-sm transition-all text-gray-10 hover:underline">- Arch / Pacman+ Apple Intel</a>- {platform === "macos" && isIntel && (+ )}+ {platform !== "macos" && (+ <><ahref="/download/apple-silicon"onClick={() =>@@ -507,12 +389,10 @@ export const DownloadPage = () => {"/download/apple-silicon",)}- className="text-sm transition-all text-gray-10 hover:underline"+ className="text-sm transition-all text-gray-8 hover:underline">Apple Silicon</a>- )}- {platform === "macos" && !isIntel && (<ahref="/download/apple-intel"onClick={() =>@@ -521,52 +401,25 @@ export const DownloadPage = () => {"/download/apple-intel",)}- className="text-sm transition-all text-gray-10 hover:underline"+ className="text-sm transition-all text-gray-8 hover:underline">Apple Intel</a>- )}- {platform !== "macos" && (- <>- <a- href="/download/apple-silicon"- onClick={() =>- trackDownloadClick(- "other_option_apple_silicon",- "/download/apple-silicon",- )- }- className="text-sm transition-all text-gray-8 hover:underline"- >- Apple Silicon- </a>- <a- href="/download/apple-intel"- onClick={() =>- trackDownloadClick(- "other_option_apple_intel",- "/download/apple-intel",- )- }- className="text-sm transition-all text-gray-8 hover:underline"- >- Apple Intel- </a>- </>- )}- <Link- href="/download/versions"- onClick={() =>- trackDownloadClick("all_versions", "/download/versions")- }- className="text-sm transition-all text-gray-10 hover:underline"- >- All versions- </Link>- </div>- )}+ </>+ )}+ <Link+ href="/download/versions"+ onClick={() =>+ trackDownloadClick("all_versions", "/download/versions")+ }+ className="text-sm transition-all text-gray-10 hover:underline"+ >+ All versions+ </Link>+ </div></div>+ {/* Discreet SEO Links */}<div className="pt-8 mt-32 text-xs border-t border-gray-5 text-gray-12"><div className="flex flex-wrap gap-y-2 gap-x-4 justify-center items-center mx-auto max-w-lg"><Linkdiff --git a/apps/web/utils/platform.tsx b/apps/web/utils/platform.tsxindex 7caae9a89..6e1543b71 100644--- a/apps/web/utils/platform.tsx+++ b/apps/web/utils/platform.tsx@@ -17,22 +17,6 @@ export const getDownloadUrl = (}};-export const getClassicDownloadUrl = (- platform: string | null,- isIntel: boolean,-): string => {- if (platform === "windows") return "/download/classic-windows";- if (platform === "linux") return "/download/classic-linux-appimage";- if (platform === "macos" && isIntel) return "/download/classic-apple-intel";- return "/download/classic-apple-silicon";-};--export const getClassicVersionText = (platform: string | null): string => {- if (platform === "windows") return "Windows 10+ • installs alongside Cap";- if (platform === "linux") return "Linux x86_64 • AppImage";- return "macOS 12.3+ • installs alongside Cap";-};-export const getDownloadButtonText = (platform: string | null,loading: boolean,