From b645d1bec21290dc6009ddd3b3697e96ea042c4b Mon Sep 17 00:00:00 2001 From: pat Date: Tue, 1 Sep 2026 03:44:06 +0000 Subject: [PATCH] Restructure the chapter shell around a visible outline --- marketing-site/pages/read/real-estate.jsx | 117 +++++++++++++++------- 1 file changed, 82 insertions(+), 35 deletions(-) diff --git a/marketing-site/pages/read/real-estate.jsx b/marketing-site/pages/read/real-estate.jsx index f74d242..d20e921 100644 --- a/marketing-site/pages/read/real-estate.jsx +++ b/marketing-site/pages/read/real-estate.jsx @@ -1,16 +1,18 @@ -import { useEffect } from "react"; +import { useEffect, useMemo } from "react"; import Head from "next/head"; import ReaderNav from "../../components/reader/ReaderNav"; import ReaderFooter from "../../components/reader/ReaderFooter"; import WorkflowBlock from "../../components/reader/WorkflowBlock"; +import ChapterOutline from "../../components/reader/ChapterOutline"; import useActivation from "../../components/reader/useActivation"; -import { CHAPTER, RECIPES } from "../../data/sample-chapter"; +import { CHAPTER, RECIPES, buildOutline } from "../../data/sample-chapter"; const RECIPE_IDS = RECIPES.map((r) => r.id); +const ESSAY_KEYS = ["stakes", "constraints", "practice"]; -function Essay({ heading, paragraphs }) { +function Essay({ id, heading, paragraphs }) { return ( -
+

{heading}

{paragraphs.map((p) => (

{p}

@@ -22,6 +24,9 @@ function Essay({ heading, paragraphs }) { export default function RealEstateChapter() { const { complete, toggle, count, total } = useActivation(RECIPE_IDS); const [first, second] = RECIPES; + const outline = useMemo(() => buildOutline(CHAPTER, RECIPES), []); + const essayGroup = outline.find((g) => g.label === "Essay"); + const workflowGroup = outline.find((g) => g.label === "Workflows"); useEffect(() => { const hash = window.location.hash; @@ -33,32 +38,23 @@ export default function RealEstateChapter() { return ( <> - {CHAPTER.title} — AIBook.fun reading demo + {CHAPTER.title} · AIBook.fun reading demo -
-
- - {count}/{total} Try-its complete - - - {RECIPES.map((r) => ( - - {r.id} - {complete[r.id] ? " · done" : ""} - - ))} - -
-
-
-
+
+ +
Reading demo · not the live book

@@ -67,40 +63,90 @@ export default function RealEstateChapter() {

{CHAPTER.title}

{CHAPTER.authors}

+ +

{CHAPTER.promise}

+
+

What's in this chapter

+
+

Essay

+
    + {essayGroup.items.map((item) => ( +
  • + {item.label} +
  • + ))} +
+
+
+

Workflows

+ +
+
+
Skip to a Try-it - {CHAPTER.skip.map((s) => ( - - {s.id} - {s.title} + {RECIPES.map((r) => ( + + {r.id} + {r.shortTitle} ))}
- - - + {ESSAY_KEYS.map((key) => ( + + ))} +

+ Workflow 1 of {RECIPES.length} in this chapter +

- + +

+ Workflow 2 of {RECIPES.length} in this chapter +

-
+

Further workflows in this vertical

    {CHAPTER.further.map((item) => ( @@ -125,14 +171,15 @@ export default function RealEstateChapter() { ))}
+
+

Sources

    {CHAPTER.sources.map((s) => (
  • {s}
  • ))}
-

Last updated: {CHAPTER.lastUpdated}