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
Check · Review · Land · Live done — Landed and live in production.
mason/deal-clock:mason/232-people-s-nudge-line-reads-without-colour → main 2 commits fork
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 | ||
| 4 | 4 | |
| 5 | 5 | - `.person` — one person's card: name, roles and contact, then their open dates or "Nothing open". |
| 6 | 6 | - `.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 | ||
| 47 | 47 | const html = peoplePage({ who: alice, people: people(l.value, on), on }); |
| 48 | 48 | expect(html).toContain('class="person-nudge"'); |
| 49 | 49 | 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("'", "'").replaceAll("&", "&")).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"); | |
| 50 | 58 | }); |
src/pages/people.ts +1 −1
| @@ -26,7 +26,7 @@ const person = (p: Person, on: string): string => `<section class="card person"> | ||
| 26 | 26 | <h2>${escape(p.name)}</h2> |
| 27 | 27 | <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> |
| 28 | 28 | ${!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>`} | |
| 30 | 30 | ${lastHeard(p.last_sent)} |
| 31 | 31 | ${p.owes.length === 0 ? `<p class="muted">Nothing open</p>` : `<ul class="week-list">${p.owes.map((o) => owedRow(o, on)).join("")}</ul>`} |
| 32 | 32 | </section>`; |
new above
offline