Skip to content

armgit / alook

Public Imported from GitHub
0

Multi-Agent Collaboration for Team and Friends

fix(web): align homepage containers and footer (#824)

Gener52b60de13fe0
diff --git a/src/web/src/components/home/landing-content.test.ts b/src/web/src/components/home/landing-content.test.ts
index 98abb802d..be173a663 100644
--- a/src/web/src/components/home/landing-content.test.ts
+++ b/src/web/src/components/home/landing-content.test.ts
@@ -210,6 +210,7 @@ describe("landing content contract", () => {
const swarmSource = readFileSync(path.join(root, "src/components/home/hero-avatar-swarm.tsx"), "utf8")
const swarmStyles = readFileSync(path.join(root, "src/components/home/hero-avatar-swarm.module.css"), "utf8")
const navSource = readFileSync(path.join(root, "src/components/home/marketing-nav.tsx"), "utf8")
+ const marketingLinksSource = readFileSync(path.join(root, "src/components/home/marketing-site-links.ts"), "utf8")
const legacyHome = readFileSync(path.join(root, "src/components/home/home-page.tsx"), "utf8")
const normalizedLandingPageSource = landingPageSource.replace(/\s+/g, " ")
const brandCopySource = readFileSync(path.join(root, "src/lib/brand-copy.ts"), "utf8")
@@ -354,7 +355,19 @@ describe("landing content contract", () => {
expect(navSource).toContain("showTemplates = true")
expect(navSource).toContain("highlightActions = false")
expect(navSource).toContain('highlightActions ? "var(--landing-accent)" : "var(--landing-text)"')
- expect(landingStyles).toContain("max-width: 1320px")
+ expect(marketingLinksSource).toContain('{ href: "/pricing", label: "Pricing"')
+ expect(marketingLinksSource).toContain('{ href: "/blog", label: "Blog"')
+ expect(marketingLinksSource).toContain("MARKETING_SITE_LINK_CLASS_NAME")
+ expect(marketingLinksSource).toContain("MARKETING_SITE_LINK_STYLE")
+ expect(navSource).toContain("MARKETING_SITE_LINKS.map")
+ expect(navSource).toContain("MARKETING_SITE_LINK_CLASS_NAME")
+ expect(navSource).toContain("MARKETING_SITE_LINK_STYLE")
+ expect(landingPageSource).toContain("MARKETING_SITE_LINKS.map")
+ expect(landingPageSource).toContain("MARKETING_SITE_LINK_CLASS_NAME")
+ expect(landingPageSource).toContain("MARKETING_SITE_LINK_STYLE")
+ expect(landingStyles).toContain("--landing-content-max: 1320px")
+ expect(landingStyles).toContain("--landing-page-gutter: clamp(24px, 5vw, 72px)")
+ expect(landingStyles).toContain("max-width: var(--landing-content-max)")
expect(motionStyles).toContain("--motion-frame-radius: var(--gallery-frame-radius, var(--radius-lg))")
expect(motionStyles).toContain("clip-path: inset(0 round var(--motion-frame-radius))")
expect(landingPageSource).toContain("papers={LANDING_TYPEWRITER_CASES.map")
diff --git a/src/web/src/components/home/landing-page.module.css b/src/web/src/components/home/landing-page.module.css
index 50ce7f5bf..9f8017313 100644
--- a/src/web/src/components/home/landing-page.module.css
+++ b/src/web/src/components/home/landing-page.module.css
@@ -1,4 +1,6 @@
.page {
+ --landing-content-max: 1320px;
+ --landing-page-gutter: clamp(24px, 5vw, 72px);
--landing-bg: #f4f9e9;
--landing-bg-translucent: rgb(244 249 233 / 90%);
--landing-section-bg: #ddedb7;
@@ -19,6 +21,12 @@
font-family: var(--font-sans);
}
+.siteContainer {
+ width: calc(100% - var(--landing-page-gutter) - var(--landing-page-gutter));
+ max-width: var(--landing-content-max);
+ margin-inline: auto;
+}
+
.landingHeroHeadline {
max-width: 900px;
font-size: 72px !important;
@@ -129,14 +137,14 @@
width: 100%;
min-height: calc(100svh - 72px);
place-items: center;
- padding: clamp(88px, 9vh, 128px) clamp(24px, 5vw, 72px);
+ padding: clamp(88px, 9vh, 128px) var(--landing-page-gutter);
isolation: isolate;
}
.heroGrid {
display: grid;
width: 100%;
- max-width: 1320px;
+ max-width: var(--landing-content-max);
margin: 0 auto;
grid-template-columns: minmax(0, 1fr) minmax(440px, 1fr);
align-items: start;
@@ -304,7 +312,7 @@
.reachSection,
.faqSection,
.closingSection {
- padding: clamp(96px, 12vw, 168px) clamp(24px, 6vw, 88px);
+ padding: clamp(96px, 12vw, 168px) var(--landing-page-gutter);
}
.closingSection {
@@ -351,7 +359,7 @@
.productLayout {
display: grid;
width: 100%;
- max-width: 1320px;
+ max-width: var(--landing-content-max);
margin: 0 auto;
grid-template-columns: minmax(300px, 0.72fr) minmax(0, 1.28fr);
align-items: center;
@@ -387,7 +395,7 @@
.identityLayout {
width: 100%;
- max-width: 1320px;
+ max-width: var(--landing-content-max);
margin: 0 auto;
}
@@ -884,7 +892,7 @@
}
.ownershipSection {
- padding: clamp(88px, 9vw, 128px) clamp(24px, 5vw, 72px);
+ padding: clamp(88px, 9vw, 128px) var(--landing-page-gutter);
background: var(--landing-crt-bg);
color: var(--landing-phosphor);
}
@@ -892,7 +900,7 @@
.ownershipInner {
display: grid;
width: 100%;
- max-width: 1320px;
+ max-width: var(--landing-content-max);
margin: 0 auto;
grid-template-columns: minmax(0, 1fr) minmax(340px, 1fr);
align-items: center;
@@ -965,7 +973,7 @@
.faqLayout {
display: grid;
width: 100%;
- max-width: 1320px;
+ max-width: var(--landing-content-max);
margin: 0 auto;
grid-template-columns: minmax(280px, 0.72fr) minmax(0, 1.28fr);
align-items: start;
@@ -1214,20 +1222,51 @@
}
.footer {
+ padding-block: 32px;
+ background: var(--landing-section-bg);
+}
+
+.footerLayout {
+ display: grid;
+ gap: 12px;
+}
+
+.footerPrimary {
display: grid;
grid-template-columns: 1fr auto 1fr;
align-items: center;
gap: 32px;
- padding: 32px clamp(24px, 5vw, 72px);
- background: var(--landing-section-bg);
}
-.footer p,
-.footer > span {
+.footerBrand {
+ display: flex;
+ min-width: 0;
+ align-items: center;
+}
+
+.footerSlogan {
color: var(--landing-text-muted);
font-family: var(--font-mono);
font-size: 0.62rem;
letter-spacing: 0.08em;
+ text-align: center;
+}
+
+.footerNavigation {
+ display: flex;
+ align-items: center;
+ justify-self: center;
+ gap: 24px;
+}
+
+.footerNavigation a {
+ display: inline-flex;
+ min-height: 44px;
+ align-items: center;
+}
+
+.footerSocialGroup {
+ justify-self: end;
}
.footerSocials {
@@ -1260,6 +1299,15 @@
}
@media (min-width: 640px) and (max-width: 1099px) {
+ .footerPrimary {
+ grid-template-columns: auto minmax(0, 1fr) auto;
+ gap: 24px;
+ }
+
+ .footerSlogan {
+ min-width: 0;
+ }
+
.hero {
min-height: auto;
padding: 88px clamp(32px, 7vw, 64px) 72px;
@@ -1605,13 +1653,23 @@
}
.footer {
+ padding-block: 32px;
+ }
+
+ .footerPrimary {
grid-template-columns: 1fr;
- gap: 16px;
- padding: 32px 24px;
+ gap: 12px;
+ }
+
+ .footerSlogan {
+ min-width: 0;
+ justify-self: center;
+ white-space: nowrap;
}
- .footerSocials {
- justify-self: start;
+ .footerBrand,
+ .footerSocialGroup {
+ justify-self: center;
}
}
diff --git a/src/web/src/components/home/landing-page.render.test.ts b/src/web/src/components/home/landing-page.render.test.ts
index 00304b7ee..9477dbaac 100644
--- a/src/web/src/components/home/landing-page.render.test.ts
+++ b/src/web/src/components/home/landing-page.render.test.ts
@@ -31,6 +31,28 @@ describe("landing identity profile preview", () => {
expect(identityCard).toContain(LANDING_PROFILE_ABOUT)
expect(identityCard).not.toContain("Unknown")
})
+
+ it("renders logo, slogan, and social links before second-row navigation", () => {
+ const markup = renderToStaticMarkup(createElement(LandingPage, { isLoggedIn: false }))
+ const footer = markup.match(/<footer[\s\S]*?<\/footer>/)?.[0]
+
+ expect(footer).toBeDefined()
+ expect(footer?.match(/data-testid="landing-footer-(?:brand|slogan|navigation|social)"/g)).toEqual([
+ 'data-testid="landing-footer-brand"',
+ 'data-testid="landing-footer-slogan"',
+ 'data-testid="landing-footer-social"',
+ 'data-testid="landing-footer-navigation"',
+ ])
+ expect(footer).toContain('aria-label="Footer navigation"')
+ expect(footer?.match(/href="\/(?:pricing|blog)"/g)).toEqual([
+ 'href="/pricing"',
+ 'href="/blog"',
+ ])
+ expect(footer).toContain('href="https://github.com/alookai/alook"')
+ expect(footer).toContain('href="https://discord.alook.ai"')
+ expect(footer).toContain('href="https://x.com/alook_ai"')
+ expect(footer).toContain("Share your agents with people you trust.")
+ })
})
const LANDING_PROFILE_ABOUT =
diff --git a/src/web/src/components/home/landing-page.tsx b/src/web/src/components/home/landing-page.tsx
index 1270dd450..f232f503a 100644
--- a/src/web/src/components/home/landing-page.tsx
+++ b/src/web/src/components/home/landing-page.tsx
@@ -14,6 +14,11 @@ import { HomepageFaq } from "./homepage-faq"
import { LandingReachMotion } from "./landing-reach-motion"
import { LandingShellMotion } from "./landing-shell-motion"
import { MarketingNav } from "./marketing-nav"
+import {
+ MARKETING_SITE_LINK_CLASS_NAME,
+ MARKETING_SITE_LINK_STYLE,
+ MARKETING_SITE_LINKS,
+} from "./marketing-site-links"
import { BRAND_SLOGAN } from "@/lib/brand-copy"
import {
LANDING_CONTINUITY,
@@ -25,6 +30,7 @@ import {
} from "./landing-content"
import styles from "./landing-page.module.css"
import { GithubOutboundLink } from "@/components/github-outbound-link"
+import { tid } from "@/lib/community/testids"
function Brand() {
return (
@@ -277,6 +283,8 @@ export function LandingPage({ isLoggedIn }: { isLoggedIn: boolean }) {
revealAfterHero
collapseLinksOnMobile
highlightActions
+ containerClassName={styles.siteContainer}
+ containerTestId={tid.landingHeaderContainer}
/>
<HeroSection
isLoggedIn={isLoggedIn}
@@ -309,7 +317,7 @@ export function LandingPage({ isLoggedIn }: { isLoggedIn: boolean }) {
/>
<section id="product" className={styles.productSection} data-testid="landing-product-proof">
- <div className={styles.productLayout}>
+ <div className={styles.productLayout} data-testid={tid.landingMainContainer}>
<div className={styles.sectionIntro}>
<div className={styles.sectionLead}>
<p className={styles.sectionMuted}>Share what already works</p>
@@ -415,10 +423,24 @@ export function LandingPage({ isLoggedIn }: { isLoggedIn: boolean }) {
</section>
<footer className={styles.footer}>
- <Brand />
- <p>{BRAND_SLOGAN}</p>
- <Link href="/pricing">Pricing</Link>
- <FooterSocialLinks />
+ <div className={`${styles.siteContainer} ${styles.footerLayout}`} data-testid={tid.landingFooterContainer}>
+ <div className={styles.footerPrimary}>
+ <div className={styles.footerBrand} data-testid={tid.landingFooterBrand}>
+ <Brand />
+ </div>
+ <p className={styles.footerSlogan} data-testid={tid.landingFooterSlogan}>{BRAND_SLOGAN}</p>
+ <div className={styles.footerSocialGroup} data-testid={tid.landingFooterSocial}>
+ <FooterSocialLinks />
+ </div>
+ </div>
+ <nav className={styles.footerNavigation} aria-label="Footer navigation" data-testid={tid.landingFooterNavigation}>
+ {MARKETING_SITE_LINKS.map((link) => link.usesDocumentNavigation ? (
+ <a key={link.href} href={link.href} className={MARKETING_SITE_LINK_CLASS_NAME} style={MARKETING_SITE_LINK_STYLE}>{link.label}</a>
+ ) : (
+ <Link key={link.href} href={link.href} className={MARKETING_SITE_LINK_CLASS_NAME} style={MARKETING_SITE_LINK_STYLE}>{link.label}</Link>
+ ))}
+ </nav>
+ </div>
</footer>
</main>
)
diff --git a/src/web/src/components/home/marketing-nav.tsx b/src/web/src/components/home/marketing-nav.tsx
index 49b56096c..f0e428310 100644
--- a/src/web/src/components/home/marketing-nav.tsx
+++ b/src/web/src/components/home/marketing-nav.tsx
@@ -4,6 +4,11 @@ import Image from "next/image";
import Link from "next/link";
import { useEffect, useState } from "react";
import { GithubOutboundLink } from "@/components/github-outbound-link";
+import {
+ MARKETING_SITE_LINK_CLASS_NAME,
+ MARKETING_SITE_LINK_STYLE,
+ MARKETING_SITE_LINKS,
+} from "./marketing-site-links";
export function MarketingNav({
isLoggedIn,
@@ -13,6 +18,8 @@ export function MarketingNav({
revealAfterHero = false,
collapseLinksOnMobile = false,
highlightActions = false,
+ containerClassName,
+ containerTestId,
}: {
isLoggedIn: boolean;
showTemplates?: boolean;
@@ -21,6 +28,8 @@ export function MarketingNav({
revealAfterHero?: boolean;
collapseLinksOnMobile?: boolean;
highlightActions?: boolean;
+ containerClassName?: string;
+ containerTestId?: string;
}) {
const [revealed, setRevealed] = useState(false);
@@ -46,7 +55,10 @@ export function MarketingNav({
borderBottom: "1px solid var(--landing-border)",
}}
>
- <div className="mx-auto flex max-w-5xl items-center justify-between px-6 py-2">
+ <div
+ className={`${containerClassName ?? "mx-auto w-full max-w-5xl px-6"} flex items-center justify-between py-2`}
+ data-testid={containerTestId}
+ >
<Link href={homeHref} className="flex items-center gap-1">
<Image src="/alook.svg" alt="Alook" width={22} height={22} />
<span
@@ -62,7 +74,15 @@ export function MarketingNav({
</Link>
<div className="relative flex items-center gap-3">
- <Link href="/pricing" className="px-3 py-2 text-xs uppercase tracking-widest transition-opacity duration-150 hover:opacity-70" style={{ fontFamily: "var(--font-mono)", color: "var(--landing-text)" }}>Pricing</Link>
+ {MARKETING_SITE_LINKS.map((link) => {
+ const className = `${collapseLinksOnMobile || link.usesDocumentNavigation ? "hidden sm:block" : "block"} marketing-site-link ${MARKETING_SITE_LINK_CLASS_NAME}`;
+
+ return link.usesDocumentNavigation ? (
+ <a key={link.href} href={link.href} className={className} style={MARKETING_SITE_LINK_STYLE}>{link.label}</a>
+ ) : (
+ <Link key={link.href} href={link.href} className={className} style={MARKETING_SITE_LINK_STYLE}>{link.label}</Link>
+ );
+ })}
{showTemplates && (
<Link
href="/templates"
@@ -75,16 +95,6 @@ export function MarketingNav({
Templates
</Link>
)}
- <a
- href="/blog"
- className="hidden sm:block px-3 py-2 text-xs uppercase tracking-widest transition-opacity duration-150 hover:opacity-70"
- style={{
- fontFamily: "var(--font-mono)",
- color: "var(--landing-text)",
- }}
- >
- Blog
- </a>
<GithubOutboundLink
surface="public_nav"
target="_blank"
@@ -141,8 +151,12 @@ export function MarketingNav({
borderColor: "var(--landing-border)",
}}
>
+ {MARKETING_SITE_LINKS.map((link) => link.usesDocumentNavigation ? (
+ <a key={link.href} href={link.href} className={`marketing-mobile-site-link block ${MARKETING_SITE_LINK_CLASS_NAME}`} style={MARKETING_SITE_LINK_STYLE}>{link.label}</a>
+ ) : (
+ <Link key={link.href} href={link.href} className={`marketing-mobile-site-link block ${MARKETING_SITE_LINK_CLASS_NAME}`} style={MARKETING_SITE_LINK_STYLE}>{link.label}</Link>
+ ))}
{showTemplates && <Link href="/templates" className="block px-3 py-2 text-xs uppercase tracking-widest">Templates</Link>}
- <a href="/blog" className="block px-3 py-2 text-xs uppercase tracking-widest">Blog</a>
<GithubOutboundLink surface="public_nav" target="_blank" rel="noopener noreferrer" className="block px-3 py-2 text-xs uppercase tracking-widest">GitHub</GithubOutboundLink>
<a href="https://discord.alook.ai" target="_blank" rel="noopener noreferrer" className="block px-3 py-2 text-xs uppercase tracking-widest">Discord</a>
<a href="https://x.com/alook_ai" target="_blank" rel="noopener noreferrer" className="block px-3 py-2 text-xs uppercase tracking-widest">X</a>
diff --git a/src/web/src/components/home/marketing-site-links.ts b/src/web/src/components/home/marketing-site-links.ts
new file mode 100644
index 000000000..f22495441
--- /dev/null
+++ b/src/web/src/components/home/marketing-site-links.ts
@@ -0,0 +1,11 @@
+export const MARKETING_SITE_LINKS = [
+ { href: "/pricing", label: "Pricing", usesDocumentNavigation: false },
+ { href: "/blog", label: "Blog", usesDocumentNavigation: true },
+] as const
+
+export const MARKETING_SITE_LINK_CLASS_NAME = "px-3 py-2 text-xs uppercase tracking-widest transition-opacity duration-150 hover:opacity-70"
+
+export const MARKETING_SITE_LINK_STYLE = {
+ color: "var(--landing-text)",
+ fontFamily: "var(--font-mono)",
+} as const
diff --git a/src/web/src/lib/community/testids.test.ts b/src/web/src/lib/community/testids.test.ts
index 5282872c4..f2fa385d8 100644
--- a/src/web/src/lib/community/testids.test.ts
+++ b/src/web/src/lib/community/testids.test.ts
@@ -25,7 +25,14 @@ describe("community QA selectors", () => {
expect(tid.onboardingIdentityOption("founder")).toBe("community-onboarding-identity-founder")
})
- it("exposes the landing mobile motion stage from the canonical registry", () => {
+ it("exposes landing geometry surfaces from the canonical registry", () => {
+ expect(tid.landingHeaderContainer).toBe("landing-header-container")
+ expect(tid.landingMainContainer).toBe("landing-main-container")
+ expect(tid.landingFooterContainer).toBe("landing-footer-container")
+ expect(tid.landingFooterBrand).toBe("landing-footer-brand")
+ expect(tid.landingFooterSlogan).toBe("landing-footer-slogan")
+ expect(tid.landingFooterNavigation).toBe("landing-footer-navigation")
+ expect(tid.landingFooterSocial).toBe("landing-footer-social")
expect(tid.landingMobileMotionStage).toBe("landing-mobile-motion-stage")
})
diff --git a/src/web/src/lib/community/testids.ts b/src/web/src/lib/community/testids.ts
index d7b605be0..18bf63e98 100644
--- a/src/web/src/lib/community/testids.ts
+++ b/src/web/src/lib/community/testids.ts
@@ -103,6 +103,13 @@ export const tid = {
daemonUpdateNotice: "daemon-update-notice",
daemonUpdateAction: "daemon-update-action",
daemonUpdateBadge: "daemon-update-badge",
+ landingHeaderContainer: "landing-header-container",
+ landingMainContainer: "landing-main-container",
+ landingFooterContainer: "landing-footer-container",
+ landingFooterBrand: "landing-footer-brand",
+ landingFooterSlogan: "landing-footer-slogan",
+ landingFooterNavigation: "landing-footer-navigation",
+ landingFooterSocial: "landing-footer-social",
landingMobileMotionStage: "landing-mobile-motion-stage",
homeButton: "community-home-button",
alookLogo: "community-alook-logo",
diff --git a/src/web/src/test/e2e-ui/19-marketing-seo.spec.ts b/src/web/src/test/e2e-ui/19-marketing-seo.spec.ts
index f4d3b0fce..2aa0c8caa 100644
--- a/src/web/src/test/e2e-ui/19-marketing-seo.spec.ts
+++ b/src/web/src/test/e2e-ui/19-marketing-seo.spec.ts
@@ -16,6 +16,133 @@ test("homepage SSR keeps product demos out of the heading tree", async ({ page,
expect(counts).toEqual({ h1: 1, demoHeadings: 0 })
})
+test("homepage header, body, and footer share responsive content edges", async ({ page }) => {
+ await page.emulateMedia({ reducedMotion: "reduce" })
+ await page.goto("/")
+
+ for (const viewport of [
+ { width: 1440, height: 900, stacked: false },
+ { width: 768, height: 900, stacked: false },
+ { width: 390, height: 844, stacked: true },
+ ]) {
+ await page.setViewportSize(viewport)
+ await page.evaluate(() => new Promise<void>((resolveValue) => {
+ requestAnimationFrame(() => requestAnimationFrame(() => resolveValue()))
+ }))
+
+ const rect = async (testId: string) => page.getByTestId(testId).evaluate((element) => {
+ const box = element.getBoundingClientRect()
+ return {
+ left: box.left,
+ right: box.right,
+ top: box.top,
+ bottom: box.bottom,
+ width: box.width,
+ height: box.height,
+ }
+ })
+ const socialTargets = await page
+ .getByTestId(tid.landingFooterSocial)
+ .locator("a")
+ .evaluateAll((elements) => elements.map((element) => {
+ const box = element.getBoundingClientRect()
+ return { width: box.width, height: box.height }
+ }))
+ const geometry = {
+ header: await rect(tid.landingHeaderContainer),
+ main: await rect(tid.landingMainContainer),
+ footer: await rect(tid.landingFooterContainer),
+ brand: await rect(tid.landingFooterBrand),
+ slogan: await rect(tid.landingFooterSlogan),
+ navigation: await rect(tid.landingFooterNavigation),
+ social: await rect(tid.landingFooterSocial),
+ socialTargets,
+ documentWidth: await page.evaluate(() => document.documentElement.scrollWidth),
+ sloganWhiteSpace: await page
+ .getByTestId(tid.landingFooterSlogan)
+ .evaluate((element) => getComputedStyle(element).whiteSpace),
+ }
+
+ for (const surface of [geometry.main, geometry.footer]) {
+ expect(Math.abs(surface.left - geometry.header.left)).toBeLessThanOrEqual(1)
+ expect(Math.abs(surface.right - geometry.header.right)).toBeLessThanOrEqual(1)
+ }
+ expect(geometry.documentWidth).toBeLessThanOrEqual(viewport.width)
+ expect(geometry.socialTargets).toHaveLength(3)
+ expect(geometry.socialTargets.every((target) => target.width >= 44 && target.height >= 44)).toBe(true)
+
+ const footerCenter = (geometry.footer.left + geometry.footer.right) / 2
+ const navigationCenter = (geometry.navigation.left + geometry.navigation.right) / 2
+ expect(Math.abs(navigationCenter - footerCenter)).toBeLessThanOrEqual(1)
+
+ if (viewport.stacked) {
+ expect(geometry.brand.bottom).toBeLessThanOrEqual(geometry.slogan.top)
+ expect(geometry.slogan.bottom).toBeLessThanOrEqual(geometry.social.top)
+ expect(geometry.social.bottom).toBeLessThanOrEqual(geometry.navigation.top)
+ expect(geometry.sloganWhiteSpace).toBe("nowrap")
+ for (const group of [geometry.brand, geometry.slogan, geometry.social]) {
+ expect(Math.abs((group.left + group.right) / 2 - footerCenter)).toBeLessThanOrEqual(1)
+ }
+ } else {
+ expect(geometry.brand.right).toBeLessThanOrEqual(geometry.slogan.left)
+ expect(geometry.slogan.right).toBeLessThanOrEqual(geometry.social.left)
+ expect(Math.max(geometry.brand.bottom, geometry.slogan.bottom, geometry.social.bottom))
+ .toBeLessThanOrEqual(geometry.navigation.top)
+ }
+ }
+})
+
+test("homepage shares header and footer site links and collapses mobile header links", async ({ page }) => {
+ await page.setViewportSize({ width: 390, height: 844 })
+ await page.goto("/")
+ await page.evaluate(() => window.scrollTo(0, document.documentElement.scrollHeight))
+
+ const header = page.locator("nav.marketing-nav")
+ await expect.poll(() => header.evaluate((element) => getComputedStyle(element).visibility)).toBe("visible")
+
+ const inlineLinks = header.locator(".marketing-site-link")
+ await expect(inlineLinks).toHaveCount(2)
+ for (const link of await inlineLinks.all()) await expect(link).toBeHidden()
+
+ const mobileMenu = header.locator("details")
+ await mobileMenu.locator("summary").click()
+ const mobileLinks = mobileMenu.locator(".marketing-mobile-site-link")
+ await expect(mobileLinks).toHaveCount(2)
+ const expectedLinks = [
+ { href: "/pricing", label: "Pricing" },
+ { href: "/blog", label: "Blog" },
+ ]
+ const linkContract = (elements: Element[]) => elements.map((element) => ({
+ href: element.getAttribute("href"),
+ label: element.textContent?.trim(),
+ }))
+ expect(await mobileLinks.evaluateAll(linkContract)).toEqual(expectedLinks)
+ const footerLinks = page.getByTestId(tid.landingFooterNavigation).locator("a")
+ expect(await footerLinks.evaluateAll(linkContract)).toEqual(expectedLinks)
+
+ const styleContract = (element: Element) => {
+ const style = getComputedStyle(element)
+ return {
+ color: style.color,
+ fontFamily: style.fontFamily,
+ fontSize: style.fontSize,
+ letterSpacing: style.letterSpacing,
+ paddingInlineEnd: style.paddingInlineEnd,
+ paddingInlineStart: style.paddingInlineStart,
+ textTransform: style.textTransform,
+ transitionDuration: style.transitionDuration,
+ transitionProperty: style.transitionProperty,
+ }
+ }
+ expect(await mobileLinks.first().evaluate(styleContract))
+ .toEqual(await footerLinks.first().evaluate(styleContract))
+
+ await page.setViewportSize({ width: 768, height: 900 })
+ for (const link of await inlineLinks.all()) await expect(link).toBeVisible()
+ expect(await inlineLinks.first().evaluate(styleContract))
+ .toEqual(await footerLinks.first().evaluate(styleContract))
+})
+
test("desktop landing keeps the embedded phone Back control on true mobile geometry", async ({ page }) => {
await page.setViewportSize({ width: 1280, height: 900 })
await page.emulateMedia({ reducedMotion: "reduce" })