Merge pull request 'Link every Home feature card, keep one heading, and call the emailed link a login link' (#109) from adilallo/fix/CR-227-home-and-nav into main

Reviewed-on: #109
This commit was merged in pull request #109.
This commit is contained in:
an.di committed 2026-11-13 00:37:37 +00:00
commit 3df3da7a91
12 files changed
+135 -53

No files matched your search

@@ -24,6 +24,7 @@ const FeatureGridContainer = memo<FeatureGridProps>(
), ),
descriptionClassName: "text-[var(--color-content-invert-brand-lavender)]", descriptionClassName: "text-[var(--color-content-invert-brand-lavender)]",
iconSrc: getAssetPath(featureIconPath("git-branch")), iconSrc: getAssetPath(featureIconPath("git-branch")),
href: t("featureGrid.features.decisionMaking.href") || undefined,
}, },
{ {
backgroundColor: "bg-[var(--color-surface-invert-brand-lime)]", backgroundColor: "bg-[var(--color-surface-invert-brand-lime)]",
@@ -33,26 +34,27 @@ const FeatureGridContainer = memo<FeatureGridProps>(
), ),
descriptionClassName: "text-[var(--color-content-invert-brand-lime)]", descriptionClassName: "text-[var(--color-content-invert-brand-lime)]",
iconSrc: getAssetPath(featureIconPath("arrow-left-right")), iconSrc: getAssetPath(featureIconPath("arrow-left-right")),
href: "/how-it-works", href: t("featureGrid.features.valuesAlignment.href") || undefined,
}, },
{ {
backgroundColor: "bg-[var(--color-surface-invert-brand-rust)]", backgroundColor: "bg-[var(--color-surface-invert-brand-teal)]",
title: t("pages.home.featureGrid.features.membershipGuidance.title"), title: t("pages.home.featureGrid.features.membershipGuidance.title"),
description: t( description: t(
"pages.home.featureGrid.features.membershipGuidance.description", "pages.home.featureGrid.features.membershipGuidance.description",
), ),
descriptionClassName: "text-[var(--color-content-invert-brand-rust)]", descriptionClassName: "text-[var(--color-content-invert-brand-teal)]",
iconSrc: getAssetPath(featureIconPath("door-open")), iconSrc: getAssetPath(featureIconPath("door-open")),
href: "/blog/integrating-new-members-without-dilution", href: t("featureGrid.features.membershipGuidance.href") || undefined,
}, },
{ {
backgroundColor: "bg-[var(--color-surface-invert-brand-teal)]", backgroundColor: "bg-[var(--color-surface-invert-brand-red)]",
title: t("pages.home.featureGrid.features.conflictResolution.title"), title: t("pages.home.featureGrid.features.conflictResolution.title"),
description: t( description: t(
"pages.home.featureGrid.features.conflictResolution.description", "pages.home.featureGrid.features.conflictResolution.description",
), ),
descriptionClassName: "text-[var(--color-content-invert-brand-teal)]", descriptionClassName: "text-[var(--color-content-invert-brand-red)]",
iconSrc: getAssetPath(featureIconPath("message-square-share")), iconSrc: getAssetPath(featureIconPath("message-square-share")),
href: t("featureGrid.features.conflictResolution.href") || undefined,
}, },
], ],
[t], [t],
@@ -51,7 +51,13 @@ function ContentLockupView({
</TitleTag> </TitleTag>
) : null} ) : null}
</div> </div>
{subtitle ? <h2 className={styles.subtitle}>{subtitle}</h2> : null} {subtitle ? (
variant === "ask" || variant === "ask-inverse" ? (
<p className={styles.subtitle}>{subtitle}</p>
) : (
<h2 className={styles.subtitle}>{subtitle}</h2>
)
) : null}
{(variant === "modal" || variant === "login") && description && ( {(variant === "modal" || variant === "login") && description && (
<p className={styles.description}>{description}</p> <p className={styles.description}>{description}</p>
)} )}
+9 -5
View File
@@ -1,20 +1,24 @@
{ {
"_comment": "FeatureGrid component defaults (shared across pages). Explore the patterns goes to /templates. Feature cards link only when a matching page exists.", "_comment": "FeatureGrid component defaults (shared across pages). Explore the patterns goes to /templates. Each feature card links to the page that covers it.",
"linkText": "Explore the patterns", "linkText": "Explore the patterns",
"linkHref": "/templates", "linkHref": "/templates",
"ariaLabel": "Feature tools and services", "ariaLabel": "Feature tools and services",
"features": { "features": {
"decisionMaking": { "decisionMaking": {
"ariaLabel": "Choose how you decide" "ariaLabel": "Choose how you decide",
"href": "/blog/making-decisions-without-hierarchy"
}, },
"valuesAlignment": { "valuesAlignment": {
"ariaLabel": "Name your values" "ariaLabel": "Name your values",
"href": "/how-it-works"
}, },
"membershipGuidance": { "membershipGuidance": {
"ariaLabel": "Define membership" "ariaLabel": "Define membership",
"href": "/blog/integrating-new-members-without-dilution"
}, },
"conflictResolution": { "conflictResolution": {
"ariaLabel": "Plan for conflict" "ariaLabel": "Plan for conflict",
"href": "/blog/resolving-active-conflicts"
} }
} }
} }
+1 -1
View File
@@ -51,7 +51,7 @@
}, },
"login": { "login": {
"title": "Log in", "title": "Log in",
"description": "Enter your email and we'll send you a magic link to sign in. No password needed!" "description": "Enter your email and we'll send you a login link. No password needed."
}, },
"invite": { "invite": {
"title": "Invitation", "title": "Invitation",
+3 -3
View File
@@ -2,11 +2,11 @@
"title": "Log in to CommunityRule", "title": "Log in to CommunityRule",
"subtitle": "Enter your email and we'll send you a login link. No password needed.", "subtitle": "Enter your email and we'll send you a login link. No password needed.",
"saveProgressTitle": "Save your progress?", "saveProgressTitle": "Save your progress?",
"saveProgressSubtitle": "We need your email to save, and we'll send you a magic link to log in. If you don't save now you could lose your progress.", "saveProgressSubtitle": "We need your email to save, and we'll send you a login link. If you don't save now you could lose your progress.",
"keepRuleTitle": "Log in to keep this rule on your profile", "keepRuleTitle": "Log in to keep this rule on your profile",
"keepRuleSubtitle": "Enter your email and we'll send a magic link. Open it on this same browser to attach the rule to your account. You can also continue without saving.", "keepRuleSubtitle": "Enter your email and we'll send a login link. Open it on this same browser to attach the rule to your account. You can also continue without saving.",
"inviteTitle": "Log in to invite your members", "inviteTitle": "Log in to invite your members",
"inviteSubtitle": "Only a logged-in person can invite. Enter your email and we’ll send you a magic link to log in.", "inviteSubtitle": "Only a logged-in person can invite. Enter your email and we’ll send you a login link.",
"backToYourRule": "← Back to your Rule", "backToYourRule": "← Back to your Rule",
"continueWithoutSaving": "Continue without saving", "continueWithoutSaving": "Continue without saving",
"emailLabel": "Email address", "emailLabel": "Email address",
+5 -2
View File
@@ -47,9 +47,12 @@ describe("AskOrganizer (behavioral tests)", () => {
it("renders subtitle when provided", () => { it("renders subtitle when provided", () => {
render(<AskOrganizer title="Test" subtitle="Subtitle" />); render(<AskOrganizer title="Test" subtitle="Subtitle" />);
const subtitle = screen.getByText("Subtitle");
expect(subtitle).toBeInTheDocument();
expect(subtitle.tagName).toBe("P");
expect( expect(
screen.getByRole("heading", { name: "Subtitle" }), screen.queryByRole("heading", { name: "Subtitle" }),
).toBeInTheDocument(); ).not.toBeInTheDocument();
}); });
it("renders CTA button with default label", () => { it("renders CTA button with default label", () => {
+14 -24
View File
@@ -47,16 +47,11 @@ describe("FeatureGrid (behavioral tests)", () => {
).not.toBeInTheDocument(); ).not.toBeInTheDocument();
}); });
it("links the two features that have pages and leaves the others as tiles", () => { it("links each feature card to the page that covers it", () => {
render(<FeatureGrid title="Test" subtitle="Test" />); render(<FeatureGrid title="Test" subtitle="Test" />);
expect(screen.getByText("Choose how you decide")).toBeInTheDocument();
expect(screen.getByText("Plan for conflict")).toBeInTheDocument();
expect( expect(
screen.queryByRole("link", { name: /Choose how you decide/ }), screen.getByRole("link", { name: /Choose how you decide/ }),
).not.toBeInTheDocument(); ).toHaveAttribute("href", "/blog/making-decisions-without-hierarchy");
expect(
screen.queryByRole("link", { name: /Plan for conflict/ }),
).not.toBeInTheDocument();
expect( expect(
screen.getByRole("link", { name: /Name your values/ }), screen.getByRole("link", { name: /Name your values/ }),
).toHaveAttribute("href", "/how-it-works"); ).toHaveAttribute("href", "/how-it-works");
@@ -66,6 +61,9 @@ describe("FeatureGrid (behavioral tests)", () => {
"href", "href",
"/blog/integrating-new-members-without-dilution", "/blog/integrating-new-members-without-dilution",
); );
expect(
screen.getByRole("link", { name: /Plan for conflict/ }),
).toHaveAttribute("href", "/blog/resolving-active-conflicts");
}); });
it("sends Explore the patterns to the templates page", () => { it("sends Explore the patterns to the templates page", () => {
@@ -96,25 +94,17 @@ describe("FeatureGrid (behavioral tests)", () => {
it("uses Figma invert surface colors on feature cards", () => { it("uses Figma invert surface colors on feature cards", () => {
render(<FeatureGrid title="Test" subtitle="Test" />); render(<FeatureGrid title="Test" subtitle="Test" />);
expect( expect(
document.querySelector( screen.getByRole("link", { name: /Choose how you decide/ }).className,
'[class*="bg-[var(--color-surface-invert-brand-lavender)]"]', ).toContain("brand-lavender");
),
).toBeInTheDocument();
expect( expect(
document.querySelector( screen.getByRole("link", { name: /Name your values/ }).className,
'[class*="bg-[var(--color-surface-invert-brand-lime)]"]', ).toContain("brand-lime");
),
).toBeInTheDocument();
expect( expect(
document.querySelector( screen.getByRole("link", { name: /Define membership/ }).className,
'[class*="bg-[var(--color-surface-invert-brand-rust)]"]', ).toContain("brand-teal");
),
).toBeInTheDocument();
expect( expect(
document.querySelector( screen.getByRole("link", { name: /Plan for conflict/ }).className,
'[class*="bg-[var(--color-surface-invert-brand-teal)]"]', ).toContain("brand-red");
),
).toBeInTheDocument();
}); });
it("marks the content block with the Figma node id", () => { it("marks the content block with the Figma node id", () => {
+12
View File
@@ -173,6 +173,18 @@ describe("Top header chrome", () => {
).toHaveAttribute("href", "/workshops"); ).toHaveAttribute("href", "/workshops");
}); });
it("labels the signed-out control Log in, not Sign in", () => {
renderWithProviders(<Top folderTop={false} />);
const logInControls = screen.getAllByRole("menuitem", {
name: /log in to your account/i,
});
expect(logInControls.length).toBeGreaterThan(0);
logInControls.forEach((control) => {
expect(control).toHaveTextContent("Log in");
});
expect(screen.queryByText("Sign in")).not.toBeInTheDocument();
});
it("shows Profile instead of Log in when signed in", () => { it("shows Profile instead of Log in when signed in", () => {
renderWithProviders(<Top folderTop={false} loggedIn />); renderWithProviders(<Top folderTop={false} loggedIn />);
expect( expect(
@@ -84,6 +84,29 @@ describe("ContentLockup", () => {
expect(link.className).toMatch(/focus-visible:outline/); expect(link.className).toMatch(/focus-visible:outline/);
}); });
it("renders the ask subtitle as a paragraph, not a heading", () => {
renderWithProviders(
<ContentLockup
variant="ask"
headingLevel="h2"
title="Still have questions?"
subtitle="Get answers from an experienced organizer"
/>,
);
expect(
screen.getByRole("heading", { name: "Still have questions?" }).tagName,
).toBe("H2");
expect(
screen.queryByRole("heading", {
name: "Get answers from an experienced organizer",
}),
).not.toBeInTheDocument();
expect(
screen.getByText("Get answers from an experienced organizer").tagName,
).toBe("P");
});
it("renders the title as h2 when headingLevel is h2", () => { it("renders the title as h2 when headingLevel is h2", () => {
renderWithProviders( renderWithProviders(
<ContentLockup <ContentLockup
+5 -11
View File
@@ -59,13 +59,7 @@ test.describe("Critical User Journeys", () => {
]; ];
for (const feature of features) { for (const feature of features) {
const featureElement = page.locator(`text=${feature}`); await expect(page.getByText(feature).first()).toBeVisible();
if (
(await featureElement.count()) > 0 &&
(await featureElement.first().isVisible())
) {
await featureElement.first().click();
}
} }
// 8. User reads testimonial // 8. User reads testimonial
@@ -134,16 +128,16 @@ test.describe("Critical User Journeys", () => {
).toHaveCount(0); ).toHaveCount(0);
await expect( await expect(
featureSection.getByRole("link", { name: "Choose how you decide" }), featureSection.getByRole("link", { name: "Choose how you decide" }),
).toHaveCount(0); ).toHaveAttribute("href", "/blog/making-decisions-without-hierarchy");
await expect(
featureSection.getByRole("link", { name: "Plan for conflict" }),
).toHaveCount(0);
await expect( await expect(
featureSection.getByRole("link", { name: "Name your values" }), featureSection.getByRole("link", { name: "Name your values" }),
).toHaveAttribute("href", "/how-it-works"); ).toHaveAttribute("href", "/how-it-works");
await expect( await expect(
featureSection.getByRole("link", { name: "Define membership" }), featureSection.getByRole("link", { name: "Define membership" }),
).toHaveAttribute("href", "/blog/integrating-new-members-without-dilution"); ).toHaveAttribute("href", "/blog/integrating-new-members-without-dilution");
await expect(
featureSection.getByRole("link", { name: "Plan for conflict" }),
).toHaveAttribute("href", "/blog/resolving-active-conflicts");
await expect( await expect(
featureSection.getByRole("link", { name: "Explore the patterns" }), featureSection.getByRole("link", { name: "Explore the patterns" }),
).toHaveAttribute("href", "/templates"); ).toHaveAttribute("href", "/templates");
+47
View File
@@ -124,6 +124,53 @@ describe("Page", () => {
name: "Explore the patterns", name: "Explore the patterns",
}); });
expect(learnMore[0]).toHaveAttribute("href", "/templates"); expect(learnMore[0]).toHaveAttribute("href", "/templates");
expect(
screen.getByRole("link", { name: /Choose how you decide/ }),
).toHaveAttribute("href", "/blog/making-decisions-without-hierarchy");
expect(
screen.getByRole("link", { name: /Name your values/ }),
).toHaveAttribute("href", "/how-it-works");
expect(
screen.getByRole("link", { name: /Define membership/ }),
).toHaveAttribute(
"href",
"/blog/integrating-new-members-without-dilution",
);
expect(
screen.getByRole("link", { name: /Plan for conflict/ }),
).toHaveAttribute("href", "/blog/resolving-active-conflicts");
});
test("keeps a single page heading and leaves Card Steps unlinked", async () => {
render(<Page />);
expect(
screen.getByRole("heading", { level: 1, name: "Build structure" }),
).toBeInTheDocument();
await waitFor(() => {
expect(
screen.getByRole("heading", {
name: "Tools for the parts that get hard",
}),
).toBeInTheDocument();
});
expect(screen.getAllByRole("heading", { level: 1 })).toHaveLength(1);
expect(
screen.getByRole("heading", {
level: 2,
name: "Tools for the parts that get hard",
}).tagName,
).toBe("H2");
expect(
screen.getByRole("heading", { name: "Still have questions?" }).tagName,
).toBe("H2");
expect(
screen.queryByRole("link", {
name: /See what has worked for other communities/,
}),
).not.toBeInTheDocument();
}); });
test("renders ask organizer section with correct data", () => { test("renders ask organizer section with correct data", () => {
+1
View File
@@ -187,6 +187,7 @@ describe("Page Flow Integration", () => {
const headings = screen.getAllByRole("heading"); const headings = screen.getAllByRole("heading");
expect(headings.length).toBeGreaterThan(4); expect(headings.length).toBeGreaterThan(4);
expect(screen.getAllByRole("heading", { level: 1 })).toHaveLength(1);
const mainContent = screen.getByText( const mainContent = screen.getByText(
/Strong communities agree on four things early/, /Strong communities agree on four things early/,