Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion apps/marketing/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@
"next-mdx-remote": "6.0.0",
"next-themes": "0.4.6",
"posthog-js": "1.310.1",
"posthog-node": "5.28.8",
"react": "19.2.3",
"react-day-picker": "9.14.0",
"react-dom": "19.2.3",
Expand Down
24 changes: 5 additions & 19 deletions apps/marketing/src/app/[lang]/components/Footer/Footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import { usePathname } from "next/navigation";
import type { ReactNode } from "react";
import { FaApple } from "react-icons/fa";
import { track } from "@/lib/analytics";
import { useIsMobileLaunched } from "../../providers/MobileLaunchProvider";
import { Soc2Badge } from "../Soc2Badge";
import { SocialLinks } from "../SocialLinks";

Expand Down Expand Up @@ -51,16 +50,15 @@ interface FooterLink {
external?: boolean;
}

const MOBILE_LINK: FooterLink = {
href: "/mobile",
label: <Trans>Mobile</Trans>,
};

const PRODUCT_LINKS: FooterLink[] = [
{
href: "/download",
label: <Trans>Download</Trans>,
},
{
href: "/mobile",
label: <Trans>Mobile</Trans>,
},
{
href: "/#how-it-works",
label: <Trans>How it works</Trans>,
Expand Down Expand Up @@ -170,7 +168,6 @@ export function Footer({
locale?: SupportedLocale;
year: number;
}) {
const isMobileLaunched = useIsMobileLaunched();
const pathname = usePathname();
if (pathname === "/download") return null;

Expand Down Expand Up @@ -223,18 +220,7 @@ export function Footer({
<FooterLanguageSwitcher locale={locale} />
</div>

<FooterColumn
title={<Trans>Product</Trans>}
links={
isMobileLaunched
? [
...PRODUCT_LINKS.slice(0, 1),
MOBILE_LINK,
...PRODUCT_LINKS.slice(1),
]
: PRODUCT_LINKS
}
/>
<FooterColumn title={<Trans>Product</Trans>} links={PRODUCT_LINKS} />
<FooterColumn title={<Trans>Company</Trans>} links={COMPANY_LINKS} />
<FooterColumn
title={<Trans>Resources</Trans>}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,9 @@ import {
import { cn } from "@superset/ui/utils";
import Link from "next/link";
import { useState } from "react";
import { useIsMobileLaunched } from "../../../../providers/MobileLaunchProvider";
import {
type NavLink,
productLinks,
PRODUCT_LINKS,
RESOURCE_LINKS,
TOP_LEVEL_LINKS,
} from "../../constants";
Expand All @@ -27,7 +26,6 @@ const triggerClass = cn(
);

export function DesktopNav() {
const isMobileLaunched = useIsMobileLaunched();
// Radix's NavigationMenu is uncontrolled by default, so a hover-opened
// trigger and a click on that same trigger both race to set its shared
// internal `value`. A click toggles, so clicking a menu that hover just
Expand All @@ -52,7 +50,7 @@ export function DesktopNav() {
</NavigationMenuTrigger>
<NavigationMenuContent>
<ul className="flex w-[320px] flex-col gap-1 p-2">
{productLinks(isMobileLaunched).map((link) => (
{PRODUCT_LINKS.map((link) => (
<NavListItem key={link.href} link={link} />
))}
</ul>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,9 @@ import { Menu, X } from "lucide-react";
import Link from "next/link";
import type { ReactNode } from "react";
import { useState } from "react";
import { useIsMobileLaunched } from "../../../../providers/MobileLaunchProvider";
import {
type NavLink,
productLinks,
PRODUCT_LINKS,
RESOURCE_LINKS,
TOP_LEVEL_LINKS,
} from "../../constants";
Expand All @@ -21,7 +20,6 @@ interface MobileNavProps {

export function MobileNav({ ctaButtons, starCounter }: MobileNavProps) {
const { t } = useLingui();
const isMobileLaunched = useIsMobileLaunched();
const [isOpen, setIsOpen] = useState(false);
const close = () => setIsOpen(false);

Expand Down Expand Up @@ -54,7 +52,7 @@ export function MobileNav({ ctaButtons, starCounter }: MobileNavProps) {
<div className="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-4 flex flex-col gap-6">
<MobileSection
title={<Trans>Product</Trans>}
links={productLinks(isMobileLaunched)}
links={PRODUCT_LINKS}
onNavigate={close}
/>
<MobileSection
Expand Down
19 changes: 6 additions & 13 deletions apps/marketing/src/app/[lang]/components/Header/constants.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,24 +9,17 @@ export interface NavLink {
external?: boolean;
}

export const MOBILE_LINK: NavLink = {
href: "/mobile",
label: <Trans>Mobile</Trans>,
description: <Trans>Run your agents from your phone.</Trans>,
};

export function productLinks(isMobileLaunched: boolean): NavLink[] {
if (!isMobileLaunched) return PRODUCT_LINKS;
const [overview, ...rest] = PRODUCT_LINKS;
return overview ? [overview, MOBILE_LINK, ...rest] : [MOBILE_LINK];
}

const PRODUCT_LINKS: NavLink[] = [
export const PRODUCT_LINKS: NavLink[] = [
{
href: "/",
label: <Trans>Overview</Trans>,
description: <Trans>Orchestrate any coding agent.</Trans>,
},
{
href: "/mobile",
label: <Trans>Mobile</Trans>,
description: <Trans>Run your agents from your phone.</Trans>,
},
{
href: "/changelog",
label: <Trans>Changelog</Trans>,
Expand Down
29 changes: 12 additions & 17 deletions apps/marketing/src/app/[lang]/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,11 @@ import {
WebsiteJsonLd,
} from "@/components/JsonLd";
import { REDDIT_PIXEL_ID } from "@/lib/constants";
import { isMobileLaunched } from "@/lib/site-flags";

import { CTAButtons } from "./components/CTAButtons";
import { Footer } from "./components/Footer";
import { GitHubStarCounter } from "./components/GitHubStarCounter";
import { Header } from "./components/Header";
import { MobileLaunchProvider } from "./providers/MobileLaunchProvider";
import "../globals.css";
import { initServerI18n } from "../i18n-server";
import { Providers } from "../providers";
Expand Down Expand Up @@ -124,7 +122,6 @@ export default async function RootLayout({
}>) {
const locale = await initServerI18n();
const messages = await getLocaleMessages(locale);
const isLaunched = await isMobileLaunched();

return (
<html
Expand Down Expand Up @@ -160,20 +157,18 @@ export default async function RootLayout({
</head>
<body className="overscroll-none font-sans">
<Providers locale={locale} messages={messages}>
<MobileLaunchProvider isLaunched={isLaunched}>
<Header
ctaButtons={
<Suspense fallback={null}>
<CTAButtons />
</Suspense>
}
starCounter={<GitHubStarCounter />}
/>
{children}
<Suspense fallback={null}>
<Footer locale={locale} year={await currentYear()} />
</Suspense>
</MobileLaunchProvider>
<Header
ctaButtons={
<Suspense fallback={null}>
<CTAButtons />
</Suspense>
}
starCounter={<GitHubStarCounter />}
/>
{children}
<Suspense fallback={null}>
<Footer locale={locale} year={await currentYear()} />
</Suspense>
<CookieConsent />
</Providers>
</body>
Expand Down
18 changes: 6 additions & 12 deletions apps/marketing/src/app/[lang]/mobile/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,28 +7,22 @@ import { PhoneShowcase } from "@/app/[lang]/components/PhoneShowcase";
import { StoreBadges } from "@/app/[lang]/components/StoreBadges";
import { localizedAlternates } from "@/app/[lang]/metadata";
import { initServerI18n } from "@/app/i18n-server";
import { isMobileLaunched } from "@/lib/site-flags";
import { AppStoreQr } from "./components/AppStoreQr";
import { MobileTestimonials } from "./components/MobileTestimonials";
import { MobileWaitlist } from "./components/MobileWaitlist";

export async function generateMetadata(): Promise<Metadata> {
const lang = await initServerI18n();
const i18n = getI18nInstance(lang);
const isLaunched = await isMobileLaunched();
return {
title: i18n._(msg({ message: "Superset for iPhone" })),
description: i18n._(
msg({
message:
"Start coding agents, follow them live, and review the diff from your phone. Available on the App Store; Android is coming soon.",
}),
),
alternates: localizedAlternates(lang, "/mobile"),
...(isLaunched
? {
description: i18n._(
msg({
message:
"Start coding agents, follow them live, and review the diff from your phone. Available on the App Store; Android is coming soon.",
}),
),
}
: { robots: { index: false, follow: true } }),
};
}

Expand Down

This file was deleted.

This file was deleted.

20 changes: 4 additions & 16 deletions apps/marketing/src/app/sitemap.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,6 @@ mock.module("@/app/[lang]/utils/fetchLeaderboard", () => ({
],
}));

let isMobileLaunched = false;
mock.module("@/lib/site-flags", () => ({
isMobileLaunched: async () => isMobileLaunched,
}));

const { default: sitemap } = await import("./sitemap");

describe("marketing sitemap", () => {
Expand Down Expand Up @@ -107,16 +102,9 @@ describe("marketing sitemap", () => {
expect(new Set(urls).size).toBe(urls.length);
});

test("lists /mobile only once the launch flag is on", async () => {
const mobileUrl = `${COMPANY.MARKETING_URL}/mobile`;

isMobileLaunched = false;
const before = (await sitemap()).map((entry) => entry.url);
expect(before).not.toContain(mobileUrl);

isMobileLaunched = true;
const after = (await sitemap()).map((entry) => entry.url);
expect(after).toContain(mobileUrl);
expect(after).toContain(`${COMPANY.MARKETING_URL}/fr/mobile`);
test("lists /mobile in every locale", async () => {
const urls = (await sitemap()).map((entry) => entry.url);
expect(urls).toContain(`${COMPANY.MARKETING_URL}/mobile`);
expect(urls).toContain(`${COMPANY.MARKETING_URL}/fr/mobile`);
});
});
16 changes: 5 additions & 11 deletions apps/marketing/src/app/sitemap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import { getComparisonPages } from "@/lib/compare";
import { getAllLegalSlugs, getLegalPage } from "@/lib/legal";
import { themeListings } from "@/lib/marketplace";
import { getAllPeople } from "@/lib/people";
import { isMobileLaunched } from "@/lib/site-flags";

async function listProfileHandles() {
"use cache";
Expand All @@ -19,23 +18,18 @@ async function listProfileHandles() {

export default async function sitemap(): Promise<MetadataRoute.Sitemap> {
const baseUrl = COMPANY.MARKETING_URL;
const isLaunched = await isMobileLaunched();

const staticPages: MetadataRoute.Sitemap = [
{
url: `${baseUrl}/cloud`,
changeFrequency: "monthly",
priority: 0.8,
},
...(isLaunched
? [
{
url: `${baseUrl}/mobile`,
changeFrequency: "monthly" as const,
priority: 0.8,
},
]
: []),
{
url: `${baseUrl}/mobile`,
changeFrequency: "monthly",
priority: 0.8,
},
{
url: baseUrl,
changeFrequency: "weekly",
Expand Down
12 changes: 0 additions & 12 deletions apps/marketing/src/lib/posthog-server.ts

This file was deleted.

28 changes: 0 additions & 28 deletions apps/marketing/src/lib/site-flags.ts

This file was deleted.

1 change: 0 additions & 1 deletion bun.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading