From 95f7291c45eb76e04a605a258b5d9d12d4e523a5 Mon Sep 17 00:00:00 2001 From: adilallo <39313955+adilallo@users.noreply.github.com> Date: Thu, 12 Nov 2026 18:06:41 -0700 Subject: [PATCH] Keep draft notes off the How it works guide, link the conflict article, and print only the rule card. --- .../_components/HowItWorksGuideBody.tsx | 87 +++++++++++-------- .../_components/HowItWorksShareRow.tsx | 28 ++++++ lib/howItWorksGuide.ts | 26 ++++-- messages/en/pages/howItWorks.json | 18 ++-- tests/pages/how-it-works-share.test.tsx | 7 +- tests/pages/how-it-works.test.jsx | 17 +++- tests/unit/howItWorksGuide.test.ts | 14 ++- 7 files changed, 136 insertions(+), 61 deletions(-) diff --git a/app/(marketing)/how-it-works/_components/HowItWorksGuideBody.tsx b/app/(marketing)/how-it-works/_components/HowItWorksGuideBody.tsx index 798591b..bf302bc 100644 --- a/app/(marketing)/how-it-works/_components/HowItWorksGuideBody.tsx +++ b/app/(marketing)/how-it-works/_components/HowItWorksGuideBody.tsx @@ -12,6 +12,7 @@ import { import { asHowItWorksGuideBlock, formatHowItWorksByline, + HOW_IT_WORKS_RULE_CARD_ID, howItWorksReadMinutes, howItWorksWikiMarkdown, type HowItWorksGuideBlock, @@ -149,7 +150,7 @@ function TeamRuleFigure({ const { teamRule } = page; return (
@@ -203,23 +204,26 @@ function GuideBlockView({ if (block.type === "ruleFigure") { return ; } - const wikiMarkdown = howItWorksWikiMarkdown( - page.banner.title, - page.banner.description, - shareUrl, - ); - const mailtoHref = `mailto:?subject=${encodeURIComponent(page.banner.title)}&body=${encodeURIComponent(`${page.banner.title}\n${shareUrl}`)}`; - return ( - - ); + if (block.type === "shareRow") { + const wikiMarkdown = howItWorksWikiMarkdown( + page.banner.title, + page.banner.description, + shareUrl, + ); + const mailtoHref = `mailto:?subject=${encodeURIComponent(page.banner.title)}&body=${encodeURIComponent(`${page.banner.title}\n${shareUrl}`)}`; + return ( + + ); + } + return null; } export default function HowItWorksGuideBody({ @@ -241,25 +245,34 @@ export default function HowItWorksGuideBody({

- {page.sections.map((section) => ( -
-

- {section.heading} -

- {section.blocks.map((block, index) => ( - - ))} -
- ))} + {page.sections.map((section) => { + const blocks = section.blocks.flatMap((block) => { + const guideBlock = asHowItWorksGuideBlock(block); + return guideBlock ? [guideBlock] : []; + }); + const hasCopy = blocks.some((block) => block.type !== "shareRow"); + return ( +
+ {hasCopy ? ( +

+ {section.heading} +

+ ) : null} + {blocks.map((block, index) => ( + + ))} +
+ ); + })}