A one-of-a-kind resume builder that keeps your privacy in mind. Completely secure, customizable, portable, open-source and free forever. Try it out today!
TypeScript agent-skillsaidsh-pluginhacktoberfestjavascriptmcp-serverreactresume-builderself-hostedtypescript
fix: share homepage chrome across public marketing pages
Amruth Pillai68b8e5f43169
diff --git a/apps/web/src/features/homepage/footer.tsx b/apps/web/src/features/homepage/footer.tsxindex 8e9b67497..42697b735 100644--- a/apps/web/src/features/homepage/footer.tsx+++ b/apps/web/src/features/homepage/footer.tsx@@ -20,13 +20,13 @@ type FooterLink =| { label: string; href: string }| { label: string; to: "/ats-checker" | "/auth/login" | "/auth/register" | "/resume-templates" };-const getColumns = (): { id: string; title: string; links: FooterLink[] }[] => [+const getColumns = (story: boolean): { id: string; title: string; links: FooterLink[] }[] => [{id: "product",title: t`Product`,links: [{ label: t`Templates`, to: "/resume-templates" },- { label: t`Features`, href: "#write" },+ { label: t`Features`, href: story ? "#write" : "/#write" },{ label: t`ATS checker`, to: "/ats-checker" },{ label: t`Get started`, to: "/auth/register" },{ label: t`Sign in`, to: "/auth/login" },@@ -86,11 +86,16 @@ function FooterLinkItem({ link }: { link: FooterLink }): ReactNode {* the page (the resume to Write, the glasses to Check, the letters to Share, the calendar to Prepare, the window to* Remember), and its lamp switches the theme.*/-export function LandingFooter() {+type LandingFooterProps = { story?: boolean };++export function LandingFooter({ story = true }: LandingFooterProps) {const headline = getHeadline();return (- <footer data-scene={SCENE.footer} className="relative overflow-hidden border-t border-line">+ <footer+ data-scene={SCENE.footer}+ className={cn("relative overflow-hidden border-t border-line", !story && "pb-12")}+ ><div className="relative z-1 mx-auto grid max-w-[1440px] gap-x-12 gap-y-14 px-(--gutter) pt-20 min-[1000px]:grid-cols-[minmax(0,5fr)_minmax(0,7fr)]"><div className="flex min-w-0 flex-col items-start gap-5"><img@@ -119,7 +124,7 @@ export function LandingFooter() {</div><div className="grid grid-cols-2 gap-x-8 gap-y-10 min-[640px]:grid-cols-4">- {getColumns().map((column) => (+ {getColumns(story).map((column) => (<navkey={column.id}aria-labelledby={`footer-${column.id}`}@@ -144,7 +149,7 @@ export function LandingFooter() {{/* Narrow enough to wrap into two balanced lines in any language, without splitting the translation. */}<p className="max-w-[20ch] text-balance">{t`By the community, for the community.`}</p><p className="flex flex-wrap items-center gap-x-4 gap-y-1">- <LanguageDoorway className={cn("gap-1.5", linkClass)} />+ <LanguageDoorway story={story} className={cn("gap-1.5", linkClass)} /><span><Trans>Licensed under{" "}@@ -160,7 +165,7 @@ export function LandingFooter() {</p></div>- <FooterDesk />+ {story && <FooterDesk />}</footer>);}diff --git a/apps/web/src/features/homepage/header.tsx b/apps/web/src/features/homepage/header.tsxindex 7def6fc2d..1966a8f6d 100644--- a/apps/web/src/features/homepage/header.tsx+++ b/apps/web/src/features/homepage/header.tsx@@ -22,9 +22,11 @@ const getStoryScenes = () => [{ scene: SCENE.remember, label: t`Remember` },];-export function LandingHeader() {+type LandingHeaderProps = { story?: boolean };++export function LandingHeader({ story = true }: LandingHeaderProps) {const scrolled = useLanding((state) => state.scrolled);- const night = useLanding((state) => state.night);+ const night = useLanding((state) => story && state.night);const activeScene = useLanding((state) => state.activeScene);return (@@ -32,17 +34,18 @@ export function LandingHeader() {className={cn(// The ink fades to light with Share's sky (--nt), so it never jumps against a half-dark background."night-ink fixed inset-x-0 top-0 z-70 flex h-16 items-center gap-2 ps-(--gutter) pe-[calc(var(--gutter)+30px)] whitespace-nowrap sm:gap-7",+ !story && "blur-ok:backdrop-blur-lg border-b border-line bg-bg/95",)}><divaria-hidden="true"className={cn("header-taper pointer-events-none absolute inset-x-0 top-0 -z-1 h-28 transition-opacity duration-[.4s]",- scrolled ? "opacity-[calc(1-var(--nt,0))]" : "opacity-0",+ story && scrolled ? "opacity-[calc(1-var(--nt,0))]" : "opacity-0",)}/>- <a href="#top" className="flex items-center gap-2.5 rounded-md">+ <a href={story ? "#top" : "/"} className="flex items-center gap-2.5 rounded-md"><imgsrc="/icon/light.svg"alt=""@@ -61,40 +64,43 @@ export function LandingHeader() {<span className="sr-only">Reactive Resume</span></a>- <nav aria-label={t`Story`} className="mx-auto hidden items-center gap-0.5 min-[1240px]:flex">- {getStoryScenes().map(({ scene, label }) => {- const active = activeScene === scene;- return (- <button- key={scene}- type="button"- aria-current={active ? "step" : undefined}- onClick={() => goToScene(scene, 0.04)}- className={cn(- "font-martian relative flex h-[34px] items-center gap-[7px] rounded-sm px-[11px] text-xs leading-none font-medium font-stretch-[87.5%] transition-opacity duration-300",- !active && "opacity-65 hover:opacity-100",- )}- >- <span- aria-hidden="true"- className={cn("size-1.5 rounded-sm transition-colors duration-300", active && "bg-accent")}- />- {label}- {/* How much of the current scene is left: a line that fills with its scroll progress (--sp). */}- {active && (+ {story && (+ <nav aria-label={t`Story`} className="mx-auto hidden items-center gap-0.5 min-[1240px]:flex">+ {getStoryScenes().map(({ scene, label }) => {+ const active = activeScene === scene;+ return (+ <button+ key={scene}+ type="button"+ aria-current={active ? "step" : undefined}+ onClick={() => goToScene(scene, 0.04)}+ className={cn(+ "font-martian relative flex h-[34px] items-center gap-[7px] rounded-sm px-[11px] text-xs leading-none font-medium font-stretch-[87.5%] transition-opacity duration-300",+ !active && "opacity-65 hover:opacity-100",+ )}+ ><spanaria-hidden="true"- className="absolute inset-x-[11px] bottom-[3px] h-0.5 origin-left rounded-full bg-accent rtl:origin-right"- style={{ transform: "scaleX(var(--sp, 0))" }}+ className={cn("size-1.5 rounded-sm transition-colors duration-300", active && "bg-accent")}/>- )}- </button>- );- })}- </nav>+ {label}+ {/* How much of the current scene is left: a line that fills with its scroll progress (--sp). */}+ {active && (+ <span+ aria-hidden="true"+ className="absolute inset-x-[11px] bottom-[3px] h-0.5 origin-left rounded-full bg-accent rtl:origin-right"+ style={{ transform: "scaleX(var(--sp, 0))" }}+ />+ )}+ </button>+ );+ })}+ </nav>+ )}<div className="ms-auto flex items-center gap-2"><LanguageDoorway+ story={story}className="font-martian h-[34px] gap-[7px] rounded-sm px-[11px] text-xs leading-none font-medium font-stretch-[87.5%] opacity-65 transition-opacity duration-300 hover:opacity-100"nameClassName="max-[639px]:sr-only"/>diff --git a/apps/web/src/features/homepage/marketing-layout.tsx b/apps/web/src/features/homepage/marketing-layout.tsxnew file mode 100644index 000000000..e9e4d5839--- /dev/null+++ b/apps/web/src/features/homepage/marketing-layout.tsx@@ -0,0 +1,24 @@+import type { ReactNode } from "react";+import { Trans } from "@lingui/react/macro";+import { LandingFooter } from "./footer";+import { LandingHeader, ThemeCord } from "./header";++type MarketingLayoutProps = { children: ReactNode };++/** Public marketing chrome, shared by live routes and their anonymous build-time HTML. */+export function MarketingLayout({ children }: MarketingLayoutProps) {+ return (+ <div className="landing relative isolate bg-bg font-ui text-ink">+ <a+ href="#main-content"+ className="sr-only focus:not-sr-only focus:fixed focus:inset-s-4 focus:top-4 focus:z-100 focus:rounded-md focus:bg-bg focus:px-4 focus:py-2 focus:text-ink focus:shadow-lg focus:ring-2 focus:ring-accent"+ >+ <Trans>Skip to main content</Trans>+ </a>+ <LandingHeader story={false} />+ <ThemeCord />+ {children}+ <LandingFooter story={false} />+ </div>+ );+}diff --git a/apps/web/src/features/homepage/prerender.tsx b/apps/web/src/features/homepage/prerender.tsxindex a13bb5c09..a79571b0d 100644--- a/apps/web/src/features/homepage/prerender.tsx+++ b/apps/web/src/features/homepage/prerender.tsx@@ -15,13 +15,13 @@ import { QueryClient, QueryClientProvider } from "@tanstack/react-query";import { createMemoryHistory, createRootRoute, createRouter, RouterContextProvider } from "@tanstack/react-router";import { renderToString } from "react-dom/server";import { isRTL, supportedLocales } from "@reactive-resume/utils/locale";+import { MarketingLayout } from "./marketing-layout";import { Homepage } from "./page";import { AtsCheckerPage } from "@/features/ats-checker/page";import { TemplateGallery } from "@/features/templates/gallery";import { ThemeProvider } from "@/features/theme/provider";import { getLocaleMessages } from "@/libs/locale";import { getAtsCheckerMeta, getHomepageMeta, getTemplatesMeta } from "@/libs/seo";-import { Header } from "@/routes/_home/-sections/header";export const locales = supportedLocales;@@ -34,10 +34,9 @@ const pages = {path: "/resume-templates",meta: getTemplatesMeta,render: () => (- <>- <Header />+ <MarketingLayout><TemplateGallery />- </>+ </MarketingLayout>),},// What the /_home layout renders around the checker for a signed-out visitor (routes/_home/route.tsx).@@ -45,10 +44,9 @@ const pages = {path: "/ats-checker",meta: getAtsCheckerMeta,render: () => (- <>- <Header />+ <MarketingLayout><AtsCheckerPage signedIn={false} importPending={false} />- </>+ </MarketingLayout>),},} satisfies Record<diff --git a/apps/web/src/features/homepage/sections.tsx b/apps/web/src/features/homepage/sections.tsxindex 4cc396d09..0c8569e47 100644--- a/apps/web/src/features/homepage/sections.tsx+++ b/apps/web/src/features/homepage/sections.tsx@@ -195,14 +195,18 @@ function languageHref(locale: string) {return `/?${url.searchParams}#languages`;}-type LanguageDoorwayProps = { className?: string; nameClassName?: string };+type LanguageDoorwayProps = { className?: string; nameClassName?: string; story?: boolean };/** The current language, in its own name, leading to the Languages scene: the header's and the footer's way there. */-export function LanguageDoorway({ className, nameClassName }: LanguageDoorwayProps) {+export function LanguageDoorway({ className, nameClassName, story = true }: LanguageDoorwayProps) {const { i18n } = useLingui();const name = getLanguageName(i18n.locale, i18n.locale, false);return (- <a href="#languages" title={t`Change language`} className={cn("flex items-center", className)}>+ <a+ href={story ? "#languages" : `/?locale=${i18n.locale}#languages`}+ title={t`Change language`}+ className={cn("flex items-center", className)}+ ><Icon name="translate" size={16} /><span lang={i18n.locale} className={nameClassName}>{name}diff --git a/apps/web/src/routes/_home/-sections/header.tsx b/apps/web/src/routes/_home/-sections/header.tsxdeleted file mode 100644index 56c9749e6..000000000--- a/apps/web/src/routes/_home/-sections/header.tsx+++ /dev/null@@ -1,59 +0,0 @@-import { t } from "@lingui/core/macro";-import { ArrowRightIcon, TranslateIcon } from "@phosphor-icons/react";-import { Link } from "@tanstack/react-router";-import { useMotionValueEvent, useScroll } from "motion/react";-import { useState } from "react";-import { BrandIcon } from "@reactive-resume/ui/components/brand-icon";-import { Button } from "@reactive-resume/ui/components/button";-import { GithubStarsButton } from "@/components/input/github-stars-button";-import { LocaleCombobox } from "@/features/locale/combobox";-import { ThemeToggleButton } from "@/features/theme/toggle-button";--export function Header() {- const [hidden, setHidden] = useState(false);- const { scrollY } = useScroll();-- useMotionValueEvent(scrollY, "change", (current) => {- setHidden(current > 32 && current > (scrollY.getPrevious() ?? 0));- });-- return (- <header- data-hidden={hidden}- className="fixed inset-x-0 top-0 z-50 animate-in border-b border-transparent bg-bg/80 backdrop-blur-lg ease-out-strong animation-duration-300 [transition:translate_250ms_var(--ease-out-strong)] fade-in data-[hidden=true]:-translate-y-full"- >- <nav aria-label={t`Main navigation`} className="container mx-auto flex items-center gap-x-4 p-3 lg:px-12">- <Link to="/" className="transition-opacity hover:opacity-80" aria-label={t`Reactive Resume - Go to homepage`}>- <BrandIcon variant="icon" className="size-10" />- </Link>-- <div className="ms-auto flex items-center gap-x-2">- <LocaleCombobox- render={- <Button size="icon" variant="ghost" aria-label={t`Change language`}>- <TranslateIcon />- </Button>- }- />-- <ThemeToggleButton />-- <div className="hidden items-center gap-x-4 sm:flex">- <GithubStarsButton />-- <Button- size="icon"- nativeButton={false}- aria-label={t`Go to dashboard`}- render={- <Link to="/dashboard">- <ArrowRightIcon aria-hidden="true" className="rtl:-scale-x-100" />- </Link>- }- />- </div>- </div>- </nav>- </header>- );-}diff --git a/apps/web/src/routes/_home/route.tsx b/apps/web/src/routes/_home/route.tsxindex d9a4aacc3..d1570aaa2 100644--- a/apps/web/src/routes/_home/route.tsx+++ b/apps/web/src/routes/_home/route.tsx@@ -1,6 +1,6 @@import { Trans } from "@lingui/react/macro";import { createFileRoute, Outlet, useMatch } from "@tanstack/react-router";-import { Header } from "./-sections/header";+import { MarketingLayout } from "@/features/homepage/marketing-layout";export const Route = createFileRoute("/_home")({component: RouteComponent,@@ -11,6 +11,12 @@ function RouteComponent() {const rootMode = rootMatch?.loaderData?.root.status;// The homepage ships its own header and skip link; the shared ones are for the other marketing pages.const isHomepage = rootMatch !== undefined && (!rootMode || rootMode === "disabled");+ if (!rootMatch)+ return (+ <MarketingLayout>+ <Outlet />+ </MarketingLayout>+ );return (<>{!isHomepage && (@@ -21,7 +27,6 @@ function RouteComponent() {<Trans>Skip to main content</Trans></a>)}- {!rootMatch && <Header />}<Outlet /></>);diff --git a/docs/guides/choosing-a-template.mdx b/docs/guides/choosing-a-template.mdxindex a37ecc279..02c87720e 100644--- a/docs/guides/choosing-a-template.mdx+++ b/docs/guides/choosing-a-template.mdx@@ -5,6 +5,15 @@ description: "Browse the 18 Reactive Resume templates drawn with your own conten[Browse the free resume template gallery](https://rxresu.me/resume-templates) to compare all 18 layouts and download sample PDFs before creating an account. Select **Use this template** on one to sign up (or sign in) and start a blank resume in it.+The public gallery keeps **Sign in** and **Build your resume** in the header, including on phones. When you're signed in, the header offers **Go to dashboard**. The hanging bulb changes the theme, and the language link opens the homepage's language list. Footer links lead to features, guides and the community.++<Frame caption="Compare sample layouts in the public gallery before creating an account">+ <img+ src="/images/guides/choosing-a-template/public-gallery.png"+ alt="Public template gallery with Sign in, Build your resume, the theme cord, layout advice and fictional sample resumes"+ />+</Frame>+A template decides the layout of your resume: where the header sits, whether there is a sidebar, and how headings and entries look. You can switch templates at any time. Your content, fonts and colors stay the same.## Open the template gallerydiff --git a/docs/guides/using-the-ats-checker.mdx b/docs/guides/using-the-ats-checker.mdxindex 584313402..ca5c7d5ad 100644--- a/docs/guides/using-the-ats-checker.mdx+++ b/docs/guides/using-the-ats-checker.mdx@@ -9,6 +9,8 @@ The ATS checker answers one question: can software read your resume? It opens aThe check runs entirely in your browser. The file isn't uploaded or stored, and you don't need an account.+The header keeps **Sign in** and **Build your resume** available on phones too; signed-in visitors get **Go to dashboard**. Use the hanging bulb to change the theme, or the language link to open the homepage's language list. The footer shares the homepage's feature, documentation and community links.+## Before you start- Have your resume as a PDF, up to 25 MB. Password-protected PDFs can't be checked; save an unprotected copy first.@@ -27,7 +29,7 @@ The check runs entirely in your browser. The file isn't uploaded or stored, andDrag the file onto the box, or select **Choose a PDF** to pick it. To see how the checker works first, select **Try a sample file**.<Frame caption="Check a PDF locally in your browser">- <img src="/images/guides/using-the-ats-checker/drop-zone-and-posting.webp" alt="Public ATS checker with Choose a PDF, Try a sample file and optional Job posting" />+ <img src="/images/guides/using-the-ats-checker/drop-zone-and-posting.png" alt="Public ATS checker with Sign in, Build your resume, the theme cord, Choose a PDF, Try a sample file and optional Job posting" /></Frame></Step>diff --git a/docs/images/guides/choosing-a-template/public-gallery.png b/docs/images/guides/choosing-a-template/public-gallery.pngnew file mode 100644index 000000000..d6f06bcb3Binary files /dev/null and b/docs/images/guides/choosing-a-template/public-gallery.png differdiff --git a/docs/images/guides/using-the-ats-checker/drop-zone-and-posting.png b/docs/images/guides/using-the-ats-checker/drop-zone-and-posting.pngnew file mode 100644index 000000000..00bd7e32fBinary files /dev/null and b/docs/images/guides/using-the-ats-checker/drop-zone-and-posting.png differdiff --git a/docs/images/guides/using-the-ats-checker/drop-zone-and-posting.webp b/docs/images/guides/using-the-ats-checker/drop-zone-and-posting.webpdeleted file mode 100644index c020ad8d0..000000000Binary files a/docs/images/guides/using-the-ats-checker/drop-zone-and-posting.webp and /dev/null differdiff --git a/tests/e2e/specs/marketing-navigation.spec.ts b/tests/e2e/specs/marketing-navigation.spec.tsnew file mode 100644index 000000000..35b4c9697--- /dev/null+++ b/tests/e2e/specs/marketing-navigation.spec.ts@@ -0,0 +1,199 @@+import { expect, test } from "../fixtures/test";++test.use({ reducedMotion: "reduce" });++for (const path of ["/resume-templates", "/ats-checker"]) {+ for (const { width, locale, theme } of [+ { width: 320, locale: "en-US", theme: "light" },+ { width: 390, locale: "ar-SA", theme: "dark" },+ { width: 390, locale: "de-DE", theme: "light" },+ { width: 1440, locale: "en-US", theme: "light" },+ ] as const) {+ test(`${path} keeps marketing navigation at ${width}px in ${locale} ${theme}`, async ({ page }, info) => {+ await page.setViewportSize({ width, height: 900 });+ await page.emulateMedia({ colorScheme: theme });+ await page.goto(`${path}?locale=${locale}`);+ await expect(page.getByRole("heading", { level: 1 })).toBeFocused();+ const header = page.getByRole("banner");+ const signIn = header.locator('a[href="/auth/login"]');+ const start = header.locator('a[href="/auth/register"]');+ await expect(signIn).toBeVisible();+ await expect(start).toBeVisible();+ await expect(header.locator("nav")).toHaveCount(0);+ await expect(header.locator('a[href="/"]')).toHaveAccessibleName("Reactive Resume");+ const boxes = await header.locator("a").evaluateAll((links) =>+ links+ .filter((link) => link.getBoundingClientRect().width > 0)+ .map((link) => {+ const { x, right, top, bottom } = link.getBoundingClientRect();+ return { x, right, top, bottom, text: link.textContent };+ }),+ );+ for (const box of boxes) {+ expect(box.x, box.text ?? "header link").toBeGreaterThanOrEqual(0);+ expect(box.right, box.text ?? "header link").toBeLessThanOrEqual(width);+ expect(box.top).toBeGreaterThanOrEqual(0);+ expect(box.bottom).toBeLessThanOrEqual(64);+ }+ for (const [index, box] of boxes.entries()) {+ const previous = boxes[index - 1];+ if (previous) expect(Math.min(previous.right, box.right) - Math.max(previous.x, box.x)).toBeLessThanOrEqual(0);+ }+ for (const link of [signIn, start]) {+ expect((await link.innerText()).trim()).not.toBe("");+ const box = await link.boundingBox();+ expect(box?.width).toBeGreaterThanOrEqual(44);+ expect(box?.height).toBeGreaterThanOrEqual(44);+ }+ await page.screenshot({ path: info.outputPath("marketing-header.png"), animations: "disabled" });+ const footer = page.getByRole("contentinfo");+ await footer.scrollIntoViewIfNeeded();+ await expect(footer.getByRole("navigation")).toHaveCount(4);+ await expect(footer.locator('a[href="/#write"]')).toBeVisible();+ await expect(footer.locator(`a[href="/?locale=${locale}#languages"]`)).toBeVisible();+ await expect(footer.locator('img[src*="footer-desk"]')).toHaveCount(0);+ await expect(header).toBeInViewport();+ await expect(signIn).toBeInViewport();+ expect(await page.evaluate(() => document.documentElement.scrollWidth)).toBeLessThanOrEqual(width);+ await footer.screenshot({ path: info.outputPath("marketing-footer.png"), animations: "disabled" });+ });+ }++ test(`${path} uses the signed-in account while first-response HTML stays anonymous`, async ({ authPage: page }) => {+ const response = await page.request.get(path);+ await expect(response).toBeOK();+ const html = await response.text();+ expect(html).toContain('href="/auth/login"');+ expect(html).toContain('href="/auth/register"');+ expect(html).toContain("<footer");+ expect(html).toContain('href="/#write"');+ expect(html).not.toContain('href="/dashboard"');+ await page.goto(path);+ await expect(page.getByRole("heading", { level: 1 })).toBeFocused();+ const header = page.getByRole("banner");+ await expect(header.locator('a[href="/auth/login"]')).toHaveCount(0);+ await header.getByRole("link", { name: "Go to dashboard", exact: true }).click();+ await expect(page).toHaveURL(/\/dashboard(?:\/|$)/);+ });+}++test("marketing theme, language and footer links reach their existing destinations", async ({ page }) => {+ await page.goto("/ats-checker");+ await expect(page.getByRole("heading", { level: 1 })).toBeFocused();+ await page.getByRole("button", { name: "Switch to dark mode", exact: true }).click();+ await expect(page.locator("html")).toHaveClass(/dark/);+ await page.reload();+ await expect(page.locator("html")).toHaveClass(/dark/);+ await page.getByRole("contentinfo").getByRole("link", { name: "Features", exact: true }).click();+ await expect(page).toHaveURL(/\/#write$/);+ await expect(page.locator("#write")).toBeInViewport();+ await page.goto("/resume-templates?locale=de-DE");+ await expect(page.getByRole("heading", { level: 1 })).toBeFocused();+ await page.getByRole("banner").locator('a[href="/?locale=de-DE#languages"]').click();+ await expect(page).toHaveURL(/\/\?locale=de-DE#languages$/);+ await expect(page.locator("html")).toHaveAttribute("lang", "de-DE");+ await expect(page.locator("#languages")).toBeInViewport();+});++test("marketing account actions remain keyboard destinations on phones", async ({ page }) => {+ await page.setViewportSize({ width: 320, height: 900 });+ await page.goto("/resume-templates");+ await expect(page.getByRole("heading", { level: 1 })).toBeFocused();+ const signIn = page.getByRole("banner").getByRole("link", { name: "Sign in", exact: true });+ await signIn.focus();+ await page.keyboard.press("Enter");+ await expect(page).toHaveURL(/\/auth\/login/);+ await page.goto("/ats-checker");+ await expect(page.getByRole("heading", { level: 1 })).toBeFocused();+ const start = page.getByRole("banner").getByRole("link", { name: "Build your resume", exact: true });+ await start.focus();+ await page.keyboard.press("Enter");+ await expect(page).toHaveURL(/\/auth\/register/);+});++test("shared chrome keeps the gallery's paper, type, samples and template choice", async ({ page }) => {+ await page.goto("/resume-templates");+ await expect(page.getByRole("heading", { level: 1 })).toBeFocused();+ const cards = page.locator("article");+ await expect(cards).toHaveCount(18);+ const first = cards.first();+ await expect(first.locator("h2")).toHaveCSS("font-weight", "300");+ // The existing font-anybody token now uses the shared display family on every marketing page.+ expect(await first.locator("h2").evaluate((element) => getComputedStyle(element).fontFamily)).toContain(+ "Instrument Serif",+ );+ const paper = first.getByRole("img");+ await expect(paper).toHaveJSProperty("complete", true);+ expect(await paper.evaluate((element: HTMLImageElement) => element.naturalWidth)).toBeGreaterThan(0);+ expect(await paper.evaluate((element) => getComputedStyle(element).boxShadow)).not.toBe("none");+ const sample = first.getByRole("link", { name: /Download .* sample PDF/ });+ const href = await sample.getAttribute("href");+ if (!href) throw new Error("Template sample has no destination.");+ const response = await page.request.get(href);+ await expect(response).toBeOK();+ expect((await response.body()).subarray(0, 5).toString()).toBe("%PDF-");+ await first.getByRole("link", { name: /Use the .* template/ }).click();+ await expect(page).toHaveURL(/\/auth\/register\?callbackURL=/);+});++test("shared chrome keeps the ATS sample check local and its result usable", async ({ page }) => {+ await page.goto("/ats-checker");+ await expect(page.getByRole("heading", { level: 1 })).toBeFocused();+ const writes: string[] = [];+ page.on("request", (request) => {+ if (["POST", "PUT", "PATCH"].includes(request.method())) writes.push(new URL(request.url()).pathname);+ });+ await page.getByRole("button", { name: "Try a sample file", exact: true }).click();+ await expect(page.getByRole("button", { name: "Check another file", exact: true })).toBeVisible();+ await page.getByRole("tab", { name: "What a parser reads", exact: true }).click();+ await expect(page.getByRole("contentinfo")).toBeAttached();+ await page.getByRole("button", { name: "Check another file", exact: true }).click();+ await expect(page.getByRole("button", { name: "Choose a PDF", exact: true })).toBeVisible();+ expect(writes).toEqual([]);+});++test("marketing navigation leaves the homepage's night scene behind", async ({ page }) => {+ await page.setViewportSize({ width: 1440, height: 900 });+ await page.goto("/");+ await expect(page.getByRole("heading", { level: 1 })).toBeFocused();+ await page+ .getByRole("navigation", { name: "Story", exact: true })+ .getByRole("button", { name: "Share", exact: true })+ .click();+ const mark = page+ .getByRole("banner")+ .getByRole("link", { name: "Reactive Resume", exact: true })+ .locator("img:visible");+ await expect(mark).toHaveAttribute("src", "/icon/dark.svg");+ // Activate the real router link while Share still owns the homepage's night state.+ await page+ .locator('a[href="/ats-checker"]')+ .first()+ .evaluate((link: HTMLAnchorElement) => link.click());+ await expect(page).toHaveURL(/\/ats-checker$/);+ await expect(page.getByRole("heading", { level: 1 })).toBeFocused();+ await expect(mark).toHaveAttribute("src", "/icon/light.svg");+});++test("a public resume keeps its own page without marketing chrome", async ({ authPage: owner, browser, account }) => {+ const created = await owner.request.post("/api/openapi/resumes", {+ data: { name: "Fictional marketing boundary", tags: [], withSampleData: true },+ });+ await expect(created).toBeOK();+ const id = (await created.json()) as string;+ await expect(+ await owner.request.put(`/api/openapi/resumes/${id}`, {+ data: { slug: "fictional-marketing-boundary", isPublic: true },+ }),+ ).toBeOK();+ const visitor = await browser.newPage();+ try {+ const origin = new URL(process.env.APP_URL ?? "http://localhost:3000").origin;+ await visitor.goto(`${origin}/${account.username}/fictional-marketing-boundary`);+ await expect(visitor.locator(".rr-page").first()).toBeVisible();+ await expect(visitor.locator(".landing")).toHaveCount(0);+ await expect(visitor.locator('a[href="/auth/register"]')).toHaveCount(0);+ } finally {+ await visitor.close();+ }+});