Public: anyone can read this; the crew can change it.

People's nudge line reads without colour, and the fresh-boot test pins its whole sentence #238

Merged opened this

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

Merged

mason/deal-clock:mason/232-people-s-nudge-line-reads-without-colour → main 2 commits fork

  • Merged. mason/232-people-s-nudge-line-reads-without-colour was merged into main as 3a44623.

Review

Sign in to review this change.
3 files changed +10 −2
docs/design/areas/people.md +1 −1
@@ -4,4 +4,4 @@ Classes on `/people`, the list of everyone on the agent's deals with the dates t
44
55 - `.person` — one person's card: name, roles and contact, then their open dates or "Nothing open".
66 - `.contact-link` — a party's email, phone or Text link on `/people` and the deal page's party list; at least `--size-tap` tall.
7 - `.person-nudge` — an amber line under a person's name when they owe a date within three days and have heard nothing for a week; same colour as `.closing-clash`.
7 - `.person-nudge` — an amber line under a person's name when they owe a date within three days and have heard nothing for a week; same colour as `.closing-clash`; it opens with a `.badge` reading "Nudge" so it reads without colour.
src/lastsent.test.ts +8
@@ -47,4 +47,12 @@ test("the sample data on a fresh boot flags at least one person on /people, esca
4747 const html = peoplePage({ who: alice, people: people(l.value, on), on });
4848 expect(html).toContain('class="person-nudge"');
4949 expect(html).toContain("Owes ");
50 const cards = html.split('<section class="card person">').slice(1);
51 const first = cards[0] ?? "";
52 const line = /<p class="person-nudge"><span class="badge" data-u="soon">Nudge<\/span> ([^<]*)<\/p>/.exec(first);
53 expect(line).not.toBeNull();
54 expect(line![1]!.replaceAll("&#39;", "'").replaceAll("&amp;", "&")).toMatch(/^Owes .+ on .+ (today|tomorrow|in \d+ days) · nothing sent (yet|in \d+ days)$/);
55 const quiet = cards.find((c) => !c.includes("person-nudge"));
56 expect(quiet).toBeDefined();
57 expect(quiet).not.toContain("Nudge");
5058 });
src/pages/people.ts +1 −1
@@ -26,7 +26,7 @@ const person = (p: Person, on: string): string => `<section class="card person">
2626 <h2>${escape(p.name)}</h2>
2727 <p class="muted">${escape(p.roles.join(", "))}${[p.email, p.phone, ...(p.email === "" && p.phone === "" ? [p.contact] : [])].filter((v) => v !== "").map((v) => ` · ${partyContact(v)}`).join("")}</p>
2828 ${!p.reach ? "" : `<p class="muted">${escape(reachLine(p.reach))}</p>`}
29 ${p.nudge === null ? "" : `<p class="person-nudge">${escape(nudgeLine(p.nudge, on))}</p>`}
29 ${p.nudge === null ? "" : `<p class="person-nudge"><span class="badge" data-u="soon">Nudge</span> ${escape(nudgeLine(p.nudge, on))}</p>`}
3030 ${lastHeard(p.last_sent)}
3131 ${p.owes.length === 0 ? `<p class="muted">Nothing open</p>` : `<ul class="week-list">${p.owes.map((o) => owedRow(o, on)).join("")}</ul>`}
3232 </section>`;

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs