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

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

mason/speed-to-lead:mason/15-the-signed-out-front-page-shows-what-the → main 1 commit fork

  • Merged. mason/15-the-signed-out-front-page-shows-what-the was merged into main as 985b4ac.

Review

Sign in to review this change.
3 files changed +54 −0
src/pages/desk.ts +25
@@ -33,6 +33,12 @@ export function deskPage(input: {
3333 <h1>Every new lead answered in under a minute.</h1>
3434 <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>
3535 <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>
3642 </section>`,
3743 });
3844 const now = Date.now();
@@ -74,6 +80,25 @@ export function deskPage(input: {
7480 });
7581 }
7682
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
77102 const VIEW_LABEL: readonly (readonly [View, string])[] = [
78103 ["needs", "Needs you"],
79104 ["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
9292 expect(guest).not.toContain("Maria Gonzalez");
9393 });
9494
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
95111 test("the desk: the sample leads, newest first, each with a source, consent and a clock", async () => {
96112 const page = await (await api("/", {}, alice)).text();
97113 expect(page).toContain(agent.name);
static/app.css +13
@@ -128,6 +128,19 @@ footer {
128128 padding: var(--space-6) 0;
129129 }
130130
131 .example-label {
132 margin: 0 0 var(--space-1);
133 color: var(--color-muted);
134 font-size: var(--text-sm);
135 font-weight: 600;
136 }
137 .steps {
138 margin: 0;
139 padding-left: var(--space-5);
140 display: grid;
141 gap: var(--space-2);
142 }
143
131144 /* The desk. */
132145 .desk-head {
133146 display: flex;

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs