Public: anyone can read this; the crew can change it.
The signed-out front page shows what the desk does before anyone signs in #18
Check · Review · Land · Live done — Landed and live in production.
mason/speed-to-lead:mason/15-the-signed-out-front-page-shows-what-the → main 1 commit fork
3 files
changed +54
−0
src/pages/desk.ts +25
| @@ -33,6 +33,12 @@ export function deskPage(input: { | ||
| 33 | 33 | <h1>Every new lead answered in under a minute.</h1> |
| 34 | 34 | <p>Your desk of incoming leads, a reply drafted for each one, and a 30-day follow-up plan so no one is left waiting. You approve every message before it goes.</p> |
| 35 | 35 | <p><a class="button" href="/__forge/signin?to=%2F">Sign in to open your desk</a></p> |
| 36 | ${example} | |
| 37 | <ol class="steps"> | |
| 38 | <li>A lead comes in and the clock starts.</li> | |
| 39 | <li>You approve the drafted reply in one tap.</li> | |
| 40 | <li>The app drafts follow-ups for day 1, 3, 7, 14 and 30, until they're qualified or gone.</li> | |
| 41 | </ol> | |
| 36 | 42 | </section>`, |
| 37 | 43 | }); |
| 38 | 44 | const now = Date.now(); |
| @@ -74,6 +80,25 @@ export function deskPage(input: { | ||
| 74 | 80 | }); |
| 75 | 81 | } |
| 76 | 82 | |
| 83 | /** | |
| 84 | * One made-up row, fixed text and never read from the database, drawn with | |
| 85 | * the real row and clock markup but not a link and not ticking. | |
| 86 | */ | |
| 87 | const example = `<div class="example" aria-label="Example lead"> | |
| 88 | <p class="example-label">Example, not a real lead</p> | |
| 89 | <div class="desk"> | |
| 90 | <div class="lead-row"> | |
| 91 | <span class="lead-main"> | |
| 92 | <span class="lead-name">Sample: Dana P.</span> | |
| 93 | <span class="tags"><span class="chip">Zillow</span><span class="badge" data-consent="text">Text OK</span></span> | |
| 94 | <span class="ask">Can we see 12 Example St this weekend?</span> | |
| 95 | <span class="status" data-ready>Reply drafted — approve and send</span> | |
| 96 | </span> | |
| 97 | <span class="clock" data-tone="ok"><small>waiting</small> <span class="clock-time">0:42</span></span> | |
| 98 | </div> | |
| 99 | </div> | |
| 100 | </div>`; | |
| 101 | ||
| 77 | 102 | const VIEW_LABEL: readonly (readonly [View, string])[] = [ |
| 78 | 103 | ["needs", "Needs you"], |
| 79 | 104 | ["open", "In follow-up"], |
src/server.test.ts +16
| @@ -92,6 +92,22 @@ test("a guest sees who the desk belongs to and is asked to sign in; nothing abou | ||
| 92 | 92 | expect(guest).not.toContain("Maria Gonzalez"); |
| 93 | 93 | }); |
| 94 | 94 | |
| 95 | test("a guest sees the example row and the three steps, and none of the sample leads' names", async () => { | |
| 96 | const guest = await (await fetch(base + "/")).text(); | |
| 97 | expect(guest).toContain("Example, not a real lead"); | |
| 98 | expect(guest).toContain('class="lead-row"'); | |
| 99 | expect(guest).toContain("0:42"); | |
| 100 | expect(guest).toContain("A lead comes in and the clock starts."); | |
| 101 | expect(guest).toContain("You approve the drafted reply in one tap."); | |
| 102 | expect(guest).toContain("day 1, 3, 7, 14 and 30"); | |
| 103 | expect(guest).toContain("/__forge/signin?to="); | |
| 104 | expect(guest).not.toContain("data-since"); | |
| 105 | const source = await Bun.file(new URL("./sample.ts", import.meta.url)).text(); | |
| 106 | for (const [, name] of source.matchAll(/person\("([^"]+)"/g)) expect(guest).not.toContain(name!); | |
| 107 | const desk = await (await api("/", {}, alice)).text(); | |
| 108 | expect(desk).not.toContain("Example, not a real lead"); | |
| 109 | }); | |
| 110 | ||
| 95 | 111 | test("the desk: the sample leads, newest first, each with a source, consent and a clock", async () => { |
| 96 | 112 | const page = await (await api("/", {}, alice)).text(); |
| 97 | 113 | expect(page).toContain(agent.name); |
static/app.css +13
| @@ -128,6 +128,19 @@ footer { | ||
| 128 | 128 | padding: var() 0; |
| 129 | 129 | } |
| 130 | 130 | |
| 131 | .example-label { | |
| 132 | margin: 0 0 var(); | |
| 133 | color: var(); | |
| 134 | font-size: var(); | |
| 135 | font-weight: 600; | |
| 136 | } | |
| 137 | .steps { | |
| 138 | margin: 0; | |
| 139 | padding-left: var(); | |
| 140 | display: grid; | |
| 141 | gap: var(); | |
| 142 | } | |
| 143 | ||
| 131 | 144 | /* The desk. */ |
| 132 | 145 | .desk-head { |
| 133 | 146 | display: flex; |
new above
offline