From dc9625c3b2828d5a875124ea55d9d32d163e203d Mon Sep 17 00:00:00 2001 From: adilallo <39313955+adilallo@users.noreply.github.com> Date: Thu, 12 Nov 2026 17:09:48 -0700 Subject: [PATCH 1/2] Link every Home feature card to the page that covers it, and keep Ask an organizer from adding a second heading. --- .../FeatureGrid/FeatureGrid.container.tsx | 14 +++--- .../type/ContentLockup/ContentLockup.view.tsx | 8 +++- messages/en/components/featureGrid.json | 14 ++++-- tests/components/AskOrganizer.test.tsx | 7 ++- tests/components/FeatureGrid.test.tsx | 38 ++++++--------- tests/components/type/ContentLockup.test.tsx | 23 +++++++++ tests/e2e/critical-journeys.spec.ts | 16 ++----- tests/pages/home.test.jsx | 47 +++++++++++++++++++ tests/pages/page-flow.test.jsx | 1 + 9 files changed, 119 insertions(+), 49 deletions(-) diff --git a/app/components/sections/FeatureGrid/FeatureGrid.container.tsx b/app/components/sections/FeatureGrid/FeatureGrid.container.tsx index 24bce25..0d7cd23 100644 --- a/app/components/sections/FeatureGrid/FeatureGrid.container.tsx +++ b/app/components/sections/FeatureGrid/FeatureGrid.container.tsx @@ -24,6 +24,7 @@ const FeatureGridContainer = memo( ), descriptionClassName: "text-[var(--color-content-invert-brand-lavender)]", iconSrc: getAssetPath(featureIconPath("git-branch")), + href: t("featureGrid.features.decisionMaking.href") || undefined, }, { backgroundColor: "bg-[var(--color-surface-invert-brand-lime)]", @@ -33,26 +34,27 @@ const FeatureGridContainer = memo( ), descriptionClassName: "text-[var(--color-content-invert-brand-lime)]", 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"), description: t( "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")), - 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"), description: t( "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")), + href: t("featureGrid.features.conflictResolution.href") || undefined, }, ], [t], diff --git a/app/components/type/ContentLockup/ContentLockup.view.tsx b/app/components/type/ContentLockup/ContentLockup.view.tsx index be9c6f4..7bcafdd 100644 --- a/app/components/type/ContentLockup/ContentLockup.view.tsx +++ b/app/components/type/ContentLockup/ContentLockup.view.tsx @@ -51,7 +51,13 @@ function ContentLockupView({ ) : null} - {subtitle ?

{subtitle}

: null} + {subtitle ? ( + variant === "ask" || variant === "ask-inverse" ? ( +

{subtitle}

+ ) : ( +

{subtitle}

+ ) + ) : null} {(variant === "modal" || variant === "login") && description && (

{description}

)} diff --git a/messages/en/components/featureGrid.json b/messages/en/components/featureGrid.json index a9f7fec..3e3487e 100644 --- a/messages/en/components/featureGrid.json +++ b/messages/en/components/featureGrid.json @@ -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", "linkHref": "/templates", "ariaLabel": "Feature tools and services", "features": { "decisionMaking": { - "ariaLabel": "Choose how you decide" + "ariaLabel": "Choose how you decide", + "href": "/blog/making-decisions-without-hierarchy" }, "valuesAlignment": { - "ariaLabel": "Name your values" + "ariaLabel": "Name your values", + "href": "/how-it-works" }, "membershipGuidance": { - "ariaLabel": "Define membership" + "ariaLabel": "Define membership", + "href": "/blog/integrating-new-members-without-dilution" }, "conflictResolution": { - "ariaLabel": "Plan for conflict" + "ariaLabel": "Plan for conflict", + "href": "/blog/resolving-active-conflicts" } } } diff --git a/tests/components/AskOrganizer.test.tsx b/tests/components/AskOrganizer.test.tsx index 3312fb3..1887766 100644 --- a/tests/components/AskOrganizer.test.tsx +++ b/tests/components/AskOrganizer.test.tsx @@ -47,9 +47,12 @@ describe("AskOrganizer (behavioral tests)", () => { it("renders subtitle when provided", () => { render(); + const subtitle = screen.getByText("Subtitle"); + expect(subtitle).toBeInTheDocument(); + expect(subtitle.tagName).toBe("P"); expect( - screen.getByRole("heading", { name: "Subtitle" }), - ).toBeInTheDocument(); + screen.queryByRole("heading", { name: "Subtitle" }), + ).not.toBeInTheDocument(); }); it("renders CTA button with default label", () => { diff --git a/tests/components/FeatureGrid.test.tsx b/tests/components/FeatureGrid.test.tsx index 0a54284..1f8f6d6 100644 --- a/tests/components/FeatureGrid.test.tsx +++ b/tests/components/FeatureGrid.test.tsx @@ -47,16 +47,11 @@ describe("FeatureGrid (behavioral tests)", () => { ).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(); - expect(screen.getByText("Choose how you decide")).toBeInTheDocument(); - expect(screen.getByText("Plan for conflict")).toBeInTheDocument(); expect( - screen.queryByRole("link", { name: /Choose how you decide/ }), - ).not.toBeInTheDocument(); - expect( - screen.queryByRole("link", { name: /Plan for conflict/ }), - ).not.toBeInTheDocument(); + 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"); @@ -66,6 +61,9 @@ describe("FeatureGrid (behavioral tests)", () => { "href", "/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", () => { @@ -96,25 +94,17 @@ describe("FeatureGrid (behavioral tests)", () => { it("uses Figma invert surface colors on feature cards", () => { render(); expect( - document.querySelector( - '[class*="bg-[var(--color-surface-invert-brand-lavender)]"]', - ), - ).toBeInTheDocument(); + screen.getByRole("link", { name: /Choose how you decide/ }).className, + ).toContain("brand-lavender"); expect( - document.querySelector( - '[class*="bg-[var(--color-surface-invert-brand-lime)]"]', - ), - ).toBeInTheDocument(); + screen.getByRole("link", { name: /Name your values/ }).className, + ).toContain("brand-lime"); expect( - document.querySelector( - '[class*="bg-[var(--color-surface-invert-brand-rust)]"]', - ), - ).toBeInTheDocument(); + screen.getByRole("link", { name: /Define membership/ }).className, + ).toContain("brand-teal"); expect( - document.querySelector( - '[class*="bg-[var(--color-surface-invert-brand-teal)]"]', - ), - ).toBeInTheDocument(); + screen.getByRole("link", { name: /Plan for conflict/ }).className, + ).toContain("brand-red"); }); it("marks the content block with the Figma node id", () => { diff --git a/tests/components/type/ContentLockup.test.tsx b/tests/components/type/ContentLockup.test.tsx index d19919f..cc5be69 100644 --- a/tests/components/type/ContentLockup.test.tsx +++ b/tests/components/type/ContentLockup.test.tsx @@ -84,6 +84,29 @@ describe("ContentLockup", () => { expect(link.className).toMatch(/focus-visible:outline/); }); + it("renders the ask subtitle as a paragraph, not a heading", () => { + renderWithProviders( + , + ); + + 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", () => { renderWithProviders( { ]; for (const feature of features) { - const featureElement = page.locator(`text=${feature}`); - if ( - (await featureElement.count()) > 0 && - (await featureElement.first().isVisible()) - ) { - await featureElement.first().click(); - } + await expect(page.getByText(feature).first()).toBeVisible(); } // 8. User reads testimonial @@ -134,16 +128,16 @@ test.describe("Critical User Journeys", () => { ).toHaveCount(0); await expect( featureSection.getByRole("link", { name: "Choose how you decide" }), - ).toHaveCount(0); - await expect( - featureSection.getByRole("link", { name: "Plan for conflict" }), - ).toHaveCount(0); + ).toHaveAttribute("href", "/blog/making-decisions-without-hierarchy"); await expect( featureSection.getByRole("link", { name: "Name your values" }), ).toHaveAttribute("href", "/how-it-works"); await expect( featureSection.getByRole("link", { name: "Define membership" }), ).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( featureSection.getByRole("link", { name: "Explore the patterns" }), ).toHaveAttribute("href", "/templates"); diff --git a/tests/pages/home.test.jsx b/tests/pages/home.test.jsx index 2594a04..c81ee2c 100644 --- a/tests/pages/home.test.jsx +++ b/tests/pages/home.test.jsx @@ -124,6 +124,53 @@ describe("Page", () => { name: "Explore the patterns", }); 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(); + + 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", () => { diff --git a/tests/pages/page-flow.test.jsx b/tests/pages/page-flow.test.jsx index 8ac29b6..87993e8 100644 --- a/tests/pages/page-flow.test.jsx +++ b/tests/pages/page-flow.test.jsx @@ -187,6 +187,7 @@ describe("Page Flow Integration", () => { const headings = screen.getAllByRole("heading"); expect(headings.length).toBeGreaterThan(4); + expect(screen.getAllByRole("heading", { level: 1 })).toHaveLength(1); const mainContent = screen.getByText( /Strong communities agree on four things early/, From ae1a148b98e0b6ceeaef370a53b6df82bbe1b236 Mon Sep 17 00:00:00 2001 From: adilallo <39313955+adilallo@users.noreply.github.com> Date: Thu, 12 Nov 2026 17:09:51 -0700 Subject: [PATCH 2/2] Call the emailed link a login link on the login screens, and keep the nav label as Log in. --- messages/en/metadata.json | 2 +- messages/en/pages/login.json | 6 +++--- tests/components/Top.test.tsx | 12 ++++++++++++ 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/messages/en/metadata.json b/messages/en/metadata.json index 7635517..9e5ff64 100644 --- a/messages/en/metadata.json +++ b/messages/en/metadata.json @@ -51,7 +51,7 @@ }, "login": { "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": { "title": "Invitation", diff --git a/messages/en/pages/login.json b/messages/en/pages/login.json index b68d268..d969a6f 100644 --- a/messages/en/pages/login.json +++ b/messages/en/pages/login.json @@ -2,11 +2,11 @@ "title": "Log in to CommunityRule", "subtitle": "Enter your email and we'll send you a login link. No password needed.", "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", - "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", - "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", "continueWithoutSaving": "Continue without saving", "emailLabel": "Email address", diff --git a/tests/components/Top.test.tsx b/tests/components/Top.test.tsx index 55f393d..34b82bb 100644 --- a/tests/components/Top.test.tsx +++ b/tests/components/Top.test.tsx @@ -173,6 +173,18 @@ describe("Top header chrome", () => { ).toHaveAttribute("href", "/workshops"); }); + it("labels the signed-out control Log in, not Sign in", () => { + renderWithProviders(); + 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", () => { renderWithProviders(); expect(