Skip to content

Rallly is an open-source scheduling and collaboration tool designed to make organizing events and meetings easier.

📸 Recapture the press kit screenshots and add a dark mode set (#3412)

Luke Vella3e63239dbdec
diff --git a/apps/landing/public/locales/en/home.json b/apps/landing/public/locales/en/home.json
index a12b9d5ff..521f6628e 100644
--- a/apps/landing/public/locales/en/home.json
+++ b/apps/landing/public/locales/en/home.json
@@ -223,6 +223,8 @@
"pressKitScreenshotsDescription": "High-resolution product screenshots that you can use in your coverage.",
"pressKitScreenshotsTitle": "Screenshots",
"pressKitScreenshotVoting": "Voting on a poll",
+ "pressKitThemeDark": "Dark",
+ "pressKitThemeLight": "Light",
"socialProofDescription": "Ask anyone who's used it. The fastest way to schedule a group is also the simplest.",
"socialProofTitle": "Loved for its simplicity",
"sportsClubsDescription": "Find out which nights your squad can actually make. Share one link with players, parents and coaches, see the numbers for every session, and book the pitch once. Free, with no limit on how many people you ask.",
diff --git a/apps/landing/public/press/rallly-press-kit.zip b/apps/landing/public/press/rallly-press-kit.zip
index 67693dacf..41c0c9a9f 100644
Binary files a/apps/landing/public/press/rallly-press-kit.zip and b/apps/landing/public/press/rallly-press-kit.zip differ
diff --git a/apps/landing/public/press/screenshots/calendar-month-view-dark.png b/apps/landing/public/press/screenshots/calendar-month-view-dark.png
new file mode 100644
index 000000000..19e4d6a27
Binary files /dev/null and b/apps/landing/public/press/screenshots/calendar-month-view-dark.png differ
diff --git a/apps/landing/public/press/screenshots/calendar-month-view.png b/apps/landing/public/press/screenshots/calendar-month-view.png
index 8b0ae5213..6a7f2f635 100644
Binary files a/apps/landing/public/press/screenshots/calendar-month-view.png and b/apps/landing/public/press/screenshots/calendar-month-view.png differ
diff --git a/apps/landing/public/press/screenshots/calendar-week-view-dark.png b/apps/landing/public/press/screenshots/calendar-week-view-dark.png
new file mode 100644
index 000000000..876157e7c
Binary files /dev/null and b/apps/landing/public/press/screenshots/calendar-week-view-dark.png differ
diff --git a/apps/landing/public/press/screenshots/calendar-week-view.png b/apps/landing/public/press/screenshots/calendar-week-view.png
index e194e84eb..c35821be8 100644
Binary files a/apps/landing/public/press/screenshots/calendar-week-view.png and b/apps/landing/public/press/screenshots/calendar-week-view.png differ
diff --git a/apps/landing/public/press/screenshots/create-poll-dark.png b/apps/landing/public/press/screenshots/create-poll-dark.png
new file mode 100644
index 000000000..79cd30ae1
Binary files /dev/null and b/apps/landing/public/press/screenshots/create-poll-dark.png differ
diff --git a/apps/landing/public/press/screenshots/create-poll.png b/apps/landing/public/press/screenshots/create-poll.png
index 6e4f88e97..53086a742 100644
Binary files a/apps/landing/public/press/screenshots/create-poll.png and b/apps/landing/public/press/screenshots/create-poll.png differ
diff --git a/apps/landing/public/press/screenshots/finalize-dark.png b/apps/landing/public/press/screenshots/finalize-dark.png
new file mode 100644
index 000000000..7ba3d24ec
Binary files /dev/null and b/apps/landing/public/press/screenshots/finalize-dark.png differ
diff --git a/apps/landing/public/press/screenshots/finalize.png b/apps/landing/public/press/screenshots/finalize.png
index 4ce6810a8..a99bd2287 100644
Binary files a/apps/landing/public/press/screenshots/finalize.png and b/apps/landing/public/press/screenshots/finalize.png differ
diff --git a/apps/landing/public/press/screenshots/review-results-dark.png b/apps/landing/public/press/screenshots/review-results-dark.png
new file mode 100644
index 000000000..ec7aa5e48
Binary files /dev/null and b/apps/landing/public/press/screenshots/review-results-dark.png differ
diff --git a/apps/landing/public/press/screenshots/review-results.png b/apps/landing/public/press/screenshots/review-results.png
index ee0966c7a..1e2920b73 100644
Binary files a/apps/landing/public/press/screenshots/review-results.png and b/apps/landing/public/press/screenshots/review-results.png differ
diff --git a/apps/landing/public/press/screenshots/voting-dark.png b/apps/landing/public/press/screenshots/voting-dark.png
new file mode 100644
index 000000000..ffb6692b4
Binary files /dev/null and b/apps/landing/public/press/screenshots/voting-dark.png differ
diff --git a/apps/landing/public/press/screenshots/voting.png b/apps/landing/public/press/screenshots/voting.png
index 327a2293a..c64acab06 100644
Binary files a/apps/landing/public/press/screenshots/voting.png and b/apps/landing/public/press/screenshots/voting.png differ
diff --git a/apps/landing/src/app/[locale]/(main)/press-kit/asset-card.tsx b/apps/landing/src/app/[locale]/(main)/press-kit/asset-card.tsx
new file mode 100644
index 000000000..46f51945c
--- /dev/null
+++ b/apps/landing/src/app/[locale]/(main)/press-kit/asset-card.tsx
@@ -0,0 +1,46 @@
+import { cn } from "@rallly/ui";
+import type * as React from "react";
+
+export function AssetCard({
+ name,
+ preview,
+ previewClassName,
+ links,
+ dark,
+}: {
+ name: string;
+ preview: React.ReactNode;
+ previewClassName?: string;
+ links: { label: string; href: string }[];
+ dark?: boolean;
+}) {
+ return (
+ <div className="overflow-hidden rounded-lg border">
+ <div
+ className={cn(
+ "flex items-center justify-center",
+ dark ? "bg-gray-900" : "bg-white",
+ previewClassName ?? "h-32",
+ )}
+ >
+ {preview}
+ </div>
+ <div className="flex items-center justify-between gap-2 border-t bg-gray-50 px-4 py-3">
+ <div className="text-gray-800 text-sm">{name}</div>
+ <div className="flex gap-3">
+ {links.map((link) => (
+ <a
+ key={link.href}
+ href={link.href}
+ download
+ aria-label={`${name} (${link.label})`}
+ className="font-medium text-primary text-sm hover:underline"
+ >
+ {link.label}
+ </a>
+ ))}
+ </div>
+ </div>
+ </div>
+ );
+}
diff --git a/apps/landing/src/app/[locale]/(main)/press-kit/page.tsx b/apps/landing/src/app/[locale]/(main)/press-kit/page.tsx
index f320a98e2..12a924d04 100644
--- a/apps/landing/src/app/[locale]/(main)/press-kit/page.tsx
+++ b/apps/landing/src/app/[locale]/(main)/press-kit/page.tsx
@@ -1,6 +1,6 @@
"use cache";
-import { buttonVariants, cn } from "@rallly/ui";
+import { buttonVariants } from "@rallly/ui";
import { DownloadIcon } from "lucide-react";
import type { Metadata } from "next";
import { cacheLife } from "next/cache";
@@ -17,6 +17,8 @@ import {
import { getTranslation } from "@/i18n/server";
import { getAlternates } from "@/lib/alternates";
import { getMonthlyPollCount, getMonthlyVoterCount } from "@/lib/data";
+import { AssetCard } from "./asset-card";
+import { ScreenshotGallery } from "./screenshot-gallery";
function Fact({
label,
@@ -33,50 +35,6 @@ function Fact({
);
}
-function AssetCard({
- name,
- preview,
- previewClassName,
- links,
- dark,
-}: {
- name: string;
- preview: React.ReactNode;
- previewClassName?: string;
- links: { label: string; href: string }[];
- dark?: boolean;
-}) {
- return (
- <div className="overflow-hidden rounded-lg border">
- <div
- className={cn(
- "flex items-center justify-center",
- dark ? "bg-gray-900" : "bg-white",
- previewClassName ?? "h-32",
- )}
- >
- {preview}
- </div>
- <div className="flex items-center justify-between gap-2 border-t bg-gray-50 px-4 py-3">
- <div className="text-gray-800 text-sm">{name}</div>
- <div className="flex gap-3">
- {links.map((link) => (
- <a
- key={link.href}
- href={link.href}
- download
- aria-label={`${name} (${link.label})`}
- className="font-medium text-primary text-sm hover:underline"
- >
- {link.label}
- </a>
- ))}
- </div>
- </div>
- </div>
- );
-}
-
export default async function Page(props: {
params: Promise<{ locale: string }>;
}) {
@@ -457,31 +415,19 @@ export default async function Page(props: {
</SectionDescription>
</SectionHeading>
<SectionContent>
- <div className="grid grid-cols-1 gap-6 sm:grid-cols-2">
- {screenshots.map((screenshot) => (
- <AssetCard
- key={screenshot.file}
- name={screenshot.name}
- previewClassName="aspect-[4/3]"
- preview={
- <Image
- src={`/press/screenshots/${screenshot.file}.png`}
- width={2560}
- height={1920}
- alt={screenshot.name}
- className="size-full object-cover"
- sizes="(min-width: 640px) 50vw, 100vw"
- />
- }
- links={[
- {
- label: "PNG",
- href: `/press/screenshots/${screenshot.file}.png`,
- },
- ]}
- />
- ))}
- </div>
+ <ScreenshotGallery
+ screenshots={screenshots}
+ labels={{
+ light: t("pressKitThemeLight", {
+ ns: "home",
+ defaultValue: "Light",
+ }),
+ dark: t("pressKitThemeDark", {
+ ns: "home",
+ defaultValue: "Dark",
+ }),
+ }}
+ />
</SectionContent>
</Section>
<Section>
diff --git a/apps/landing/src/app/[locale]/(main)/press-kit/screenshot-gallery.tsx b/apps/landing/src/app/[locale]/(main)/press-kit/screenshot-gallery.tsx
new file mode 100644
index 000000000..4f50849e4
--- /dev/null
+++ b/apps/landing/src/app/[locale]/(main)/press-kit/screenshot-gallery.tsx
@@ -0,0 +1,59 @@
+"use client";
+
+import { Tabs, TabsContent, TabsList, TabsTrigger } from "@rallly/ui/tabs";
+import Image from "next/image";
+import { AssetCard } from "./asset-card";
+
+const themes = ["light", "dark"] as const;
+
+export function ScreenshotGallery({
+ screenshots,
+ labels,
+}: {
+ screenshots: { name: string; file: string }[];
+ labels: Record<(typeof themes)[number], string>;
+}) {
+ return (
+ <Tabs defaultValue="light">
+ <TabsList>
+ {themes.map((theme) => (
+ <TabsTrigger key={theme} value={theme}>
+ {labels[theme]}
+ </TabsTrigger>
+ ))}
+ </TabsList>
+ {themes.map((theme) => (
+ <TabsContent
+ key={theme}
+ value={theme}
+ className="mt-6 grid grid-cols-1 gap-6 sm:grid-cols-2"
+ >
+ {screenshots.map((screenshot) => {
+ const src = `/press/screenshots/${screenshot.file}${
+ theme === "dark" ? "-dark" : ""
+ }.png`;
+ return (
+ <AssetCard
+ key={screenshot.file}
+ name={screenshot.name}
+ dark={theme === "dark"}
+ previewClassName="aspect-[4/3]"
+ preview={
+ <Image
+ src={src}
+ width={2560}
+ height={1920}
+ alt={screenshot.name}
+ className="size-full object-cover"
+ sizes="(min-width: 640px) 50vw, 100vw"
+ />
+ }
+ links={[{ label: "PNG", href: src }]}
+ />
+ );
+ })}
+ </TabsContent>
+ ))}
+ </Tabs>
+ );
+}
diff --git a/apps/web/tests/vote-page.spec.ts b/apps/web/tests/vote-page.spec.ts
index 2fcb9d594..f31f000a6 100644
--- a/apps/web/tests/vote-page.spec.ts
+++ b/apps/web/tests/vote-page.spec.ts
@@ -189,15 +189,24 @@ test.describe("vote page", () => {
const columns = main.locator("section section");
await expect(columns).toHaveCount(7);
- // The first week is the earliest, so there is nothing before it
- await expect(
- main.getByRole("button", { name: "Previous week" }),
- ).toBeDisabled();
- await main.getByRole("button", { name: "Next week" }).click();
- await expect(
- main.getByRole("button", { name: "Next week" }),
- ).toBeDisabled();
- await main.getByRole("button", { name: "Previous week" }).click();
+ // The first week is the earliest, so there is nothing before it. How
+ // many weeks the options span depends on the month they fall in, so
+ // walk to the last one and back rather than assuming a count.
+ const previous = main.getByRole("button", { name: "Previous week" });
+ const next = main.getByRole("button", { name: "Next week" });
+ await expect(previous).toBeDisabled();
+ let weeks = 1;
+ while (await next.isEnabled()) {
+ await next.click();
+ weeks++;
+ expect(weeks).toBeLessThan(6);
+ }
+ await expect(next).toBeDisabled();
+ expect(weeks).toBeGreaterThan(1);
+ for (let i = 1; i < weeks; i++) {
+ await previous.click();
+ }
+ await expect(previous).toBeDisabled();
// Hiding empty days leaves only the days that hold options
await main.getByRole("button", { name: "Hide empty days" }).click();
diff --git a/packages/screenshots/capture/press-kit.spec.ts b/packages/screenshots/capture/press-kit.spec.ts
new file mode 100644
index 000000000..b0b1d479b
--- /dev/null
+++ b/packages/screenshots/capture/press-kit.spec.ts
@@ -0,0 +1,274 @@
+import path from "node:path";
+import { expect, test } from "@playwright/test";
+import { prisma } from "@rallly/database";
+import { deleteAllMessages, loginWithEmail } from "@rallly/test-helpers";
+import dayjs from "dayjs";
+import timezone from "dayjs/plugin/timezone";
+import utc from "dayjs/plugin/utc";
+import { customAlphabet } from "nanoid";
+
+dayjs.extend(utc);
+dayjs.extend(timezone);
+
+/**
+ * The six screenshots on the landing site's press kit page, written straight
+ * into apps/landing/public/press/screenshots. Re-run after a UI change, then
+ * rebuild rallly-press-kit.zip (see the README).
+ */
+
+const timeZone = "America/New_York";
+const pollId = "screenshot-press-kit";
+const organizer = {
+ id: "screenshot-press-kit-user",
+ email: "[email protected]",
+ name: "Jessie Smith",
+};
+const spaceId = "screenshot-press-kit-space";
+
+// Next month's Wednesday and Thursday in the second week, two times each,
+// so the grid reads as one month and the week view holds both days.
+const base = (() => {
+ let date = dayjs()
+ .tz(timeZone)
+ .add(1, "month")
+ .startOf("month")
+ .add(7, "day");
+ while (date.day() !== 3) {
+ date = date.add(1, "day");
+ }
+ return date;
+})();
+
+const pressImage = (name: string) =>
+ path.join(
+ __dirname,
+ "../../../apps/landing/public/press/screenshots",
+ `${name}.png`,
+ );
+
+// Mirrors generateAccessToken in apps/web/src/features/poll/utils.ts, which
+// this package cannot import. Participant.token has no DB default.
+const generateAccessToken = customAlphabet(
+ "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",
+ 32,
+);
+
+test.use({
+ viewport: { width: 1280, height: 960 },
+ deviceScaleFactor: 2,
+ timezoneId: timeZone,
+});
+
+// Dev routes compile on first hit.
+test.describe.configure({ mode: "serial", timeout: 180_000 });
+
+test.beforeAll(async () => {
+ await deleteAllMessages();
+ await prisma.user.delete({ where: { id: organizer.id } }).catch(() => {});
+
+ await prisma.user.create({
+ data: {
+ ...organizer,
+ emailVerified: true,
+ timeZone,
+ weekStart: 1,
+ spaces: { create: { id: spaceId, name: "Personal", tier: "pro" } },
+ memberOf: {
+ create: { id: `${spaceId}-member`, spaceId, role: "ADMIN" },
+ },
+ },
+ });
+
+ // Build each instant from a wall-clock string: dayjs keeps the offset of
+ // the original instant across date arithmetic, which is wrong once the
+ // target month sits on the other side of a DST change.
+ const slot = (day: number, hour: number) => ({
+ startTime: dayjs
+ .tz(`${base.add(day, "day").format("YYYY-MM-DD")} ${hour}:00`, timeZone)
+ .toDate(),
+ duration: 60,
+ });
+
+ const poll = await prisma.poll.create({
+ data: {
+ id: pollId,
+ title: "Monthly Meetup",
+ description: "Hey everyone, please choose the dates that work for you!",
+ location: "Joe's Coffee Shop",
+ userId: organizer.id,
+ spaceId,
+ status: "open",
+ timeZone,
+ options: {
+ create: [slot(0, 17), slot(0, 18), slot(1, 17), slot(1, 18)],
+ },
+ participants: {
+ create: [
+ { name: "Emma Davis", email: "[email protected]" },
+ { name: "Liam Nguyen", email: "[email protected]" },
+ { name: "Olivia Brown", email: "[email protected]" },
+ ].map((participant) => ({
+ ...participant,
+ token: generateAccessToken(),
+ })),
+ },
+ },
+ include: {
+ options: { orderBy: { startTime: "asc" } },
+ participants: true,
+ },
+ });
+
+ const votes: Record<string, ("yes" | "no" | "ifNeedBe")[]> = {
+ "Emma Davis": ["yes", "no", "yes", "yes"],
+ "Liam Nguyen": ["ifNeedBe", "yes", "no", "yes"],
+ "Olivia Brown": ["yes", "yes", "ifNeedBe", "yes"],
+ };
+
+ await prisma.vote.createMany({
+ data: poll.participants.flatMap((participant) =>
+ poll.options.map((option, i) => ({
+ optionId: option.id,
+ participantId: participant.id,
+ pollId: poll.id,
+ type: votes[participant.name]?.[i] ?? "yes",
+ })),
+ ),
+ });
+});
+
+test.afterAll(async () => {
+ // Cascades through the space and the poll.
+ await prisma.user.delete({ where: { id: organizer.id } }).catch(() => {});
+});
+
+for (const theme of ["light", "dark"] as const) {
+ test.describe(theme, () => {
+ test.use({ colorScheme: theme });
+ const image = (name: string) =>
+ pressImage(theme === "dark" ? `${name}-dark` : name);
+
+ test("voting", async ({ page }) => {
+ await page.goto(`/invite/${pollId}`);
+ await page.getByRole("heading", { name: "Monthly Meetup" }).waitFor();
+
+ const selectors = page.getByTestId("vote-selector");
+ await selectors.first().waitFor();
+ // Clicks cycle yes, if need be, no.
+ await selectors.nth(0).click();
+ await selectors.nth(1).click();
+ await selectors.nth(1).click();
+ await selectors.nth(1).click();
+ await selectors.nth(2).click();
+ await selectors.nth(3).click();
+ await page.waitForLoadState("networkidle");
+ await page.screenshot({ path: image("voting") });
+ });
+
+ test("results and schedule", async ({ page }) => {
+ await loginWithEmail(page, { email: organizer.email });
+ await page.goto(`/poll/${pollId}`);
+ await page.getByRole("heading", { name: "Monthly Meetup" }).waitFor();
+ await page.getByText("Olivia Brown").waitFor();
+ await page.waitForLoadState("networkidle");
+ await page.screenshot({ path: image("review-results") });
+
+ await page.getByRole("button", { name: "Manage" }).click();
+ await page.getByRole("menuitem", { name: "Schedule" }).click();
+ const dialog = page.getByRole("dialog", { name: "Schedule" });
+ await expect(dialog).toBeVisible();
+ await page.waitForTimeout(1500);
+ await page.screenshot({ path: image("finalize") });
+ });
+
+ test("calendar views", async ({ page }) => {
+ await loginWithEmail(page, { email: organizer.email });
+ await page.goto(`/poll/${pollId}/edit-options`);
+
+ // The smallest div holding both the header and the footer is the card.
+ const card = page
+ .locator("div")
+ .filter({ has: page.getByRole("heading", { name: "Calendar" }) })
+ .filter({ has: page.getByText("Lock time zone") })
+ .last();
+ await card.waitFor();
+ await page.getByText("Add time option").first().waitFor();
+
+ const captureCard = async (name: string) => {
+ await page.waitForLoadState("networkidle");
+ const box = await card.boundingBox();
+ if (!box) {
+ throw new Error("Calendar card not visible");
+ }
+ // Pad the card out to 4:3 so it matches the page shots.
+ const margin = 24;
+ let width = box.width + margin * 2;
+ let height = box.height + margin * 2;
+ if (width / height > 4 / 3) {
+ height = (width * 3) / 4;
+ } else {
+ width = (height * 4) / 3;
+ }
+ await page.screenshot({
+ path: image(name),
+ fullPage: true,
+ clip: {
+ x: box.x + box.width / 2 - width / 2,
+ y: Math.max(0, box.y + box.height / 2 - height / 2),
+ width,
+ height,
+ },
+ });
+ };
+
+ await captureCard("calendar-month-view");
+
+ await page.getByRole("tab", { name: "Week view" }).click();
+ await expect(page.getByText("Add time option").first()).toBeHidden();
+ await captureCard("calendar-week-view");
+ });
+
+ test("create poll", async ({ page }) => {
+ await loginWithEmail(page, { email: organizer.email });
+ await page.goto("/new");
+
+ await page.getByLabel("Title").fill("Monthly Meetup");
+
+ // "Add location" is a menu when the organizer can add a video call and a
+ // plain button otherwise; either way the address field appears after.
+ const locationField = page.getByLabel("Location", { exact: true });
+ await expect(async () => {
+ await page
+ .getByRole("button", { name: "Add location" })
+ .click({ timeout: 2000 });
+ const addressItem = page.getByRole("menuitem", { name: "Address" });
+ await addressItem.or(locationField).first().waitFor({ timeout: 2000 });
+ if (await addressItem.isVisible()) {
+ await addressItem.click();
+ }
+ await expect(locationField).toBeVisible({ timeout: 2000 });
+ }).toPass();
+ await locationField.fill("Joe's Coffee Shop");
+
+ // The description stays collapsed: with it open the sticky create bar
+ // lands on the time slot list.
+ await page.getByLabel("Title").click();
+
+ // Pick the same two days so the time slot list has content.
+ await page.getByRole("button", { name: "Next month" }).click();
+ await page
+ .getByRole("button", { name: String(base.date()), exact: true })
+ .click();
+ await page
+ .getByRole("button", {
+ name: String(base.add(1, "day").date()),
+ exact: true,
+ })
+ .click();
+ await page.getByText("Add time option").first().waitFor();
+
+ await page.waitForLoadState("networkidle");
+ await page.screenshot({ path: image("create-poll") });
+ });
+ });
+}
diff --git a/packages/screenshots/playwright.config.ts b/packages/screenshots/playwright.config.ts
index c83ac7b5b..e91842680 100644
--- a/packages/screenshots/playwright.config.ts
+++ b/packages/screenshots/playwright.config.ts
@@ -15,7 +15,7 @@ export default defineConfig({
baseURL,
},
webServer: {
- command: `NEXT_PUBLIC_BASE_URL=${baseURL} HIDE_DEV_INDICATOR=true pnpm --filter @rallly/web exec next dev --port ${PORT}`,
+ command: `NEXT_PUBLIC_BASE_URL=${baseURL} NEXT_PUBLIC_COOKIE_DOMAIN= RATE_LIMIT_ENABLED=false HIDE_DEV_INDICATOR=true pnpm --filter @rallly/web exec next dev --port ${PORT}`,
url: baseURL,
reuseExistingServer: true,
timeout: 120000,