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

A People page lists each person on the agent's deals with every open date they owe, across all deals, soonest first, so one call covers them all #49

Merged opened this

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

Merged

mason/deal-clock:mason/30-a-people-page-lists-each-person-on-the-a → main 3 commits fork

  • Merged. mason/30-a-people-page-lists-each-person-on-the-a was merged into main as d01a4c1.

Review

Sign in to review this change.
16 files changed +391 −7
README.md +5
@@ -22,6 +22,11 @@ address, who owes it and how urgent it is; tap a row to open its sheet. It
2222 reads well on a phone, with no sideways scrolling. In the terminal, press w
2323 for the same list; over MCP, an agent asks for the `this_week` tool.
2424
25 Before calling a lender or an inspector, open **People** in the header: each
26 person on your deals appears once, with every open date they owe across all
27 deals, soonest first (try Priya Nair, who works both 1418 Alder Lane and 9 Orchard
28 Row). In the terminal, press P; over MCP, ask for `list_people`.
29
2530 To find a deal, type part of its address, or of a buyer's, seller's or other
2631 party's name, phone or email, into **Find a deal** above the clock and press
2732 Find (try `harbor`). The clock, This week and today's reminders narrow to the
contract/openapi.json +81
@@ -203,6 +203,87 @@
203203 }
204204 }
205205 },
206 "/api/people": {
207 "get": {
208 "summary": "Each person on your deals once (parties with the same contact are one), with their roles and every open date they owe across deals, soonest first; people who owe nothing open come last.",
209 "operationId": "getApiPeople",
210 "responses": {
211 "200": {
212 "description": "Each person on your deals once (parties with the same contact are one), with their roles and every open date they owe across deals, soonest first; people who owe nothing open come last.",
213 "content": {
214 "application/json": {
215 "schema": {
216 "type": "array",
217 "items": {
218 "type": "object",
219 "properties": {
220 "name": {
221 "type": "string"
222 },
223 "contact": {
224 "type": "string"
225 },
226 "roles": {
227 "type": "array",
228 "items": {
229 "type": "string"
230 }
231 },
232 "owes": {
233 "type": "array",
234 "items": {
235 "type": "object",
236 "properties": {
237 "deal_id": {
238 "type": "integer"
239 },
240 "address": {
241 "type": "string"
242 },
243 "deadline_id": {
244 "type": "integer"
245 },
246 "label": {
247 "type": "string"
248 },
249 "due": {
250 "type": "string",
251 "format": "date"
252 },
253 "urgency": {
254 "enum": [
255 "overdue",
256 "soon",
257 "later"
258 ]
259 }
260 }
261 }
262 }
263 }
264 }
265 }
266 }
267 }
268 },
269 "default": {
270 "description": "{ error, message }: why not",
271 "content": {
272 "application/json": {
273 "schema": {
274 "$ref": "#/components/schemas/Error"
275 }
276 }
277 }
278 }
279 },
280 "x-contract": {
281 "resource": "deal",
282 "verb": "list",
283 "least": "user"
284 }
285 }
286 },
206287 "/api/deals/{id}": {
207288 "get": {
208289 "summary": "One deal.",
docs/TECHNICAL.md +3 −1
@@ -45,13 +45,15 @@ reads like the deal page: `deal` read through `permit`, 401 signed out, 404 for
4545 no such deal. Over MCP it is `client_timeline`; in the terminal, `t` on an open
4646 deal (`b` goes back). Its print rules in `static/app.css` apply to that page only.
4747
48 `GET /people` (and `GET /api/people`, described in `openapi.json` under the `deal` list cell) groups every party on the deals the viewer may list into people — parties with the same contact, trimmed and case-insensitive, are one, under the newest name — each with the open dates they owe (`src/people.ts`, pure). Dates of a closed deal are not listed. The terminal's `P` view shows the same.
49
4850 A deal is **closed** when its Closing date is marked done (derived, no column; `closed` on `GET /api/deals` and `list_deals`). It leaves the clock for the Closed card, sends no reminders (`/tick`, `reminders_today`, the terminal `r` list), and the terminal date list shows its dates only after `h`. Reopening the Closing date reopens the deal.
4951
5052 `POST /tick` answers the reminders that go out today and are not yet
5153 marked sent, as JSON — call it each morning as a signed-in account (a
5254 stranger gets 401; it sends nothing and changes nothing). `GET /deals/:id/ics` is a deal's calendar file. The JSON API is
5355 `/api/deals`, described at `/openapi.json`; the same operations are MCP
54 tools at `POST /mcp` (`list_deals`, `get_deal`, `client_timeline`, `reminders_today`, `this_week`,
56 tools at `POST /mcp` (`list_deals`, `get_deal`, `client_timeline`, `reminders_today`, `this_week`, `list_people`,
5557 `open_deal`, `add_date`, `update_address`, `add_party`, `edit_party`, `remove_party`,
5658 `remove_date` — custom dates only — `remove_deal` — its author or an admin —
5759 `mark_done` — with `done: false` to
docs/design/areas/people.md added +5
@@ -0,0 +1,5 @@
1 # People
2
3 Classes on `/people`, the list of everyone on the agent's deals with the dates they owe. Rows reuse `.week-list`, `.week-row` and `.badge`.
4
5 - `.person` — one person's card: name, roles and contact, then their open dates or "Nothing open".
src/contract.test.ts +9
@@ -136,3 +136,12 @@ test("restoring the samples answers as the table says for the cells it exercises
136136 expect(mayRestore({ role: "admin", id: "a", name: "a" }).ok).toBe(true);
137137 expect(mayRestore({ role: "user", id: "u", name: "u" }).ok).toBe(false);
138138 });
139
140 test("People, at the page, GET /api/people and list_people, answers as deal list says, as every identity", () => {
141 for (const identity of identities(contract)) {
142 const who = whoIs(identity);
143 const said = `people as ${identity}`;
144 const listed = listDeals(db, who);
145 expect([said, listed.ok]).toEqual([said, permit(who, "deal", "list") !== "no"]);
146 }
147 });
src/mcp.ts +10
@@ -31,6 +31,7 @@ import { agent, title } from "./env.ts";
3131 import { dueOn } from "./reminders.ts";
3232 import { FIND_REFUSAL, find, query } from "./find.ts";
3333 import { fields } from "./http.ts";
34 import { people } from "./people.ts";
3435 import { timelineRows } from "./timeline.ts";
3536 import { owner, thisWeek } from "./week.ts";
3637 import type { Who } from "./who.ts";
@@ -103,6 +104,15 @@ export const tools: readonly Tool[] = [
103104 : deals;
104105 },
105106 },
107 {
108 name: "list_people",
109 description: "Each person on the deals once (parties with the same contact are one) with their roles and every open date they owe across deals, soonest first; people who owe nothing open come last.",
110 inputSchema: { type: "object", properties: {} },
111 run: (db, who) => {
112 const deals = listDeals(db, who);
113 return deals.ok ? { ok: true, value: people(deals.value, today()) } : deals;
114 },
115 },
106116 {
107117 name: "mark_done",
108118 description: "Mark a date done (or reopen it with done: false).",
src/openapi.ts +2 −2
@@ -42,7 +42,7 @@ export function openapi(): Record<string, unknown> {
4242 const paths: Record<string, Record<string, unknown>> = {};
4343 for (const route of routes) {
4444 if (route.api === undefined) continue;
45 const { summary, body, answer, status, query } = route.api;
45 const { summary, body, answer, status, query, cell } = route.api;
4646 const path = route.path.replace(/:(\w+)/g, "{$1}");
4747 const params = [...route.path.matchAll(/:(\w+)/g)].map(([, name]) => ({
4848 name,
@@ -50,7 +50,7 @@ export function openapi(): Record<string, unknown> {
5050 required: true,
5151 schema: { type: "integer" },
5252 }));
53 const door = doorOf(route.method, route.path.replace(/:\w+/g, "0"));
53 const door = doorOf(route.method, route.path.replace(/:\w+/g, "0")) ?? cell;
5454 const least =
5555 door === undefined
5656 ? undefined
src/pages/layout.ts +1
@@ -75,6 +75,7 @@ ${plain || input.live === false ? "" : `<script type="module" src="${asset("live
7575 ? ""
7676 : `<nav class="row">
7777 ${env === "production" ? "" : `<span class="pill" data-env="${escape(env)}">${escape(where)}</span>`}
78 ${who.role === "anon" ? "" : `<a class="button button-quiet" href="/">Clock</a> <a class="button button-quiet" href="/people">People</a>`}
7879 ${door}
7980 </nav>`
8081 }
src/pages/people.ts added +29
@@ -0,0 +1,29 @@
1 /**
2 * Who owes what, at `/people`: each person on the agent's deals once, with
3 * every open date they owe across deals, soonest first. Server-rendered, no
4 * script; a row opens its deal.
5 */
6
7 import { relative, spoken } from "../dates.ts";
8 import { escape } from "../http.ts";
9 import type { Person } from "../people.ts";
10 import type { Who } from "../who.ts";
11 import { layout } from "./layout.ts";
12 import { URGENCY_LABEL } from "./sheet.ts";
13
14 const owedRow = (o: Person["owes"][number], on: string): string =>
15 `<li><a class="week-row" href="/deals/${o.deal_id}"><span class="week-what"><b>${escape(o.label)}</b><small class="muted">${escape(o.address)} · ${escape(spoken(o.due))} · ${escape(relative(o.due, on))}</small></span><span class="badge" data-u="${o.urgency}">${URGENCY_LABEL[o.urgency]}</span></a></li>`;
16
17 const person = (p: Person, on: string): string => `<section class="card person">
18 <h2>${escape(p.name)}</h2>
19 <p class="muted">${escape(p.roles.join(", "))}${p.contact === "" ? "" : ` · ${escape(p.contact)}`}</p>
20 ${p.owes.length === 0 ? `<p class="muted">Nothing open</p>` : `<ul class="week-list">${p.owes.map((o) => owedRow(o, on)).join("")}</ul>`}
21 </section>`;
22
23 export function peoplePage(input: { who: Who; people: readonly Person[]; on: string }): string {
24 const { who, people, on } = input;
25 const body = `<h1>People</h1>
26 <p class="summary">Everyone on your deals, with every open date they owe, soonest first.</p>
27 ${people.length === 0 ? `<p class="muted">No one yet: add a deal and its parties.</p>` : people.map((p) => person(p, on)).join("")}`;
28 return layout({ body, who, path: "/people", heading: "People", live: false });
29 }
src/people.test.ts added +45
@@ -0,0 +1,45 @@
1 import { expect, test } from "bun:test";
2 import type { DealView } from "./deals.ts";
3 import { people, personKey } from "./people.ts";
4
5 const on = "2026-10-10";
6 const deal = (id: number, address: string, parties: [number, string, string, string][], dates: [number, string, string, string, string | null][], closed = false): DealView =>
7 ({
8 id,
9 address,
10 closed,
11 parties: parties.map(([pid, role, name, contact]) => ({ id: pid, deal_id: id, role, name, contact })),
12 deadlines: dates.map(([did, owes, label, due, done_at]) => ({ id: did, owes, label, due, done_at })),
13 }) as unknown as DealView;
14
15 const deals = [
16 deal(1, "B Street", [[1, "lender", "Priya Nair", "[email protected]"]], [[1, "lender", "Financing", "2026-10-20", null], [2, "buyer", "Inspection", "2026-10-11", null]]),
17 deal(2, "A Street", [[5, "lender", "Priya N., Coastline", " [email protected] "], [6, "title", "Tess", "[email protected]"]], [
18 [3, "lender", "Appraisal", "2026-10-05", null],
19 [4, "lender", "Rate lock", "2026-10-02", "2026-10-02T10:00:00Z"],
20 [5, "title", "Title search", "2026-10-30", null],
21 ]),
22 ];
23
24 test("parties with the same contact, trimmed and case-insensitive, are one person under the newest name", () => {
25 expect(personKey({ name: "x", contact: " [email protected] " })).toBe("[email protected]");
26 const all = people(deals, on);
27 const priya = all.find((p) => p.contact === "[email protected]")!;
28 expect(all.filter((p) => p.name.startsWith("Priya"))).toHaveLength(1);
29 expect(priya.name).toBe("Priya N., Coastline");
30 expect(priya.roles).toEqual(["Lender"]);
31 });
32
33 test("a person's open dates come from every deal, soonest first, and a done date is left out", () => {
34 const priya = people(deals, on)[0]!;
35 expect(priya.owes.map((o) => [o.label, o.address, o.urgency])).toEqual([
36 ["Appraisal", "A Street", "overdue"],
37 ["Financing", "B Street", "later"],
38 ]);
39 });
40
41 test("people who owe nothing open come last; a closed deal's dates are not chased", () => {
42 const all = people([...deals, deal(3, "C", [[9, "buyer", "Zed", "zed"]], [[9, "buyer", "Offer", "2026-10-01", null]], true)], on);
43 expect(all.map((p) => p.name)).toEqual(["Priya N., Coastline", "Tess", "Zed"]);
44 expect(all.at(-1)!.owes).toEqual([]);
45 });
src/people.ts added +74
@@ -0,0 +1,74 @@
1 /**
2 * The people on the agent's deals and what each owes: every party of every
3 * deal, one person per contact, with every open date they owe across deals.
4 * Plain data from deals and a day; the page, the API and the MCP tool share it.
5 */
6
7 import { urgency, type Urgency } from "./dates.ts";
8 import type { DealView } from "./deals.ts";
9 import { PARTY_LABEL, type PartyRole } from "./deadlines.ts";
10
11 export interface Owed {
12 readonly deal_id: number;
13 readonly address: string;
14 readonly deadline_id: number;
15 readonly label: string;
16 /** ISO date. */
17 readonly due: string;
18 readonly urgency: Urgency;
19 }
20
21 export interface Person {
22 /** The name on the person's most recently added party row. */
23 readonly name: string;
24 readonly contact: string;
25 /** The roles they hold across deals, as words, in the order first met. */
26 readonly roles: readonly string[];
27 /** Open dates they owe, soonest first, then by address. */
28 readonly owes: readonly Owed[];
29 }
30
31 /** Two parties are one person when their contact is the same, ignoring case and outer spaces; with no contact, their name. */
32 export const personKey = (p: { name: string; contact: string }): string =>
33 (p.contact.trim() === "" ? p.name : p.contact).trim().toLowerCase();
34
35 export function people(deals: readonly DealView[], on: string): Person[] {
36 const byKey = new Map<string, { name: string; newest: number; contact: string; roles: Set<PartyRole>; owes: Map<number, Owed> }>();
37 for (const deal of deals) {
38 for (const party of deal.parties) {
39 const key = personKey(party);
40 const one = byKey.get(key) ?? { name: party.name, newest: -1, contact: party.contact.trim(), roles: new Set(), owes: new Map() };
41 byKey.set(key, one);
42 if (party.id > one.newest) {
43 one.newest = party.id;
44 one.name = party.name;
45 one.contact = party.contact.trim();
46 }
47 one.roles.add(party.role);
48 // A closed deal is off the clock: nothing on it is chased.
49 if (deal.closed) continue;
50 for (const d of deal.deadlines) {
51 if (d.owes !== party.role || d.done_at !== null) continue;
52 one.owes.set(d.id, {
53 deal_id: deal.id,
54 address: deal.address,
55 deadline_id: d.id,
56 label: d.label,
57 due: d.due,
58 urgency: urgency(d.due, on, false),
59 });
60 }
61 }
62 }
63 return [...byKey.values()]
64 .map((p) => ({
65 name: p.name,
66 contact: p.contact,
67 roles: [...p.roles].map((r) => PARTY_LABEL[r]),
68 owes: [...p.owes.values()].sort((a, b) => a.due.localeCompare(b.due) || a.address.localeCompare(b.address)),
69 }))
70 .sort((a, b) => {
71 if ((a.owes.length === 0) !== (b.owes.length === 0)) return a.owes.length === 0 ? 1 : -1;
72 return (a.owes[0]?.due ?? "").localeCompare(b.owes[0]?.due ?? "") || a.name.localeCompare(b.name);
73 });
74 }
src/routes.ts +54
@@ -34,6 +34,7 @@ import {
3434 staticFile,
3535 text,
3636 } from "./http.ts";
37 import type { Verb } from "./can.ts";
3738 import { events } from "./live.ts";
3839 import { today } from "./dates.ts";
3940 import {
@@ -63,6 +64,8 @@ import { FIND_REFUSAL, find, query } from "./find.ts";
6364 import { clock } from "./pages/clock.ts";
6465 import { dealPage, newDealPage } from "./pages/deal.ts";
6566 import { refusedPage } from "./pages/refused.ts";
67 import { people } from "./people.ts";
68 import { peoplePage } from "./pages/people.ts";
6669 import { timelinePage } from "./pages/timeline.ts";
6770 import { welcomePage } from "./pages/welcome.ts";
6871 import { dueOn } from "./reminders.ts";
@@ -90,6 +93,8 @@ export interface Api {
9093 readonly status?: number;
9194 /** The query parameters it reads. */
9295 readonly query?: Readonly<Record<string, Schema>>;
96 /** The cell of the table a route outside its resource's `api` path reads through, for the description. */
97 readonly cell?: { readonly resource: string; readonly verb: Verb };
9398 }
9499
95100 export interface Route {
@@ -122,6 +127,28 @@ const PARTY: Schema = {
122127 type: "object",
123128 properties: { id: { type: "integer" }, role: ROLE, name: { type: "string" }, contact: { type: "string" } },
124129 };
130 export const PERSON: Schema = {
131 type: "object",
132 properties: {
133 name: { type: "string" },
134 contact: { type: "string" },
135 roles: { type: "array", items: { type: "string" } },
136 owes: {
137 type: "array",
138 items: {
139 type: "object",
140 properties: {
141 deal_id: { type: "integer" },
142 address: { type: "string" },
143 deadline_id: { type: "integer" },
144 label: { type: "string" },
145 due: DATE,
146 urgency: { enum: ["overdue", "soon", "later"] },
147 },
148 },
149 },
150 },
151 };
125152 export const DEAL: Schema = {
126153 type: "object",
127154 properties: {
@@ -345,6 +372,19 @@ export const routes: readonly Route[] = [
345372 return html(clock({ who: c.who, deals: deals.value, on: today(), notice, q }), 200, clear);
346373 },
347374 },
375 {
376 method: "GET",
377 path: "/people",
378 handle: (c) => {
379 const deals = listDeals(c.db, c.who);
380 if (!deals.ok)
381 return html(
382 refusedPage({ who: c.who, path: "/people", heading: "People", error: deals.error, message: deals.message }),
383 STATUS[deals.error],
384 );
385 return html(peoplePage({ who: c.who, people: people(deals.value, today()), on: today() }));
386 },
387 },
348388 {
349389 method: "GET",
350390 path: "/deals/new",
@@ -608,6 +648,20 @@ export const routes: readonly Route[] = [
608648 query: { q: { type: "string", maxLength: 100 } },
609649 },
610650 },
651 {
652 method: "GET",
653 path: "/api/people",
654 handle: (c) => {
655 const deals = listDeals(c.db, c.who);
656 return answer(deals.ok ? { ok: true, value: people(deals.value, today()) } : deals);
657 },
658 api: {
659 summary:
660 "Each person on your deals once (parties with the same contact are one), with their roles and every open date they owe across deals, soonest first; people who owe nothing open come last.",
661 answer: list(PERSON),
662 cell: { resource: "deal", verb: "list" },
663 },
664 },
611665 {
612666 method: "POST",
613667 path: "/api/deals",
src/server.test.ts +19
@@ -168,6 +168,7 @@ test("the MCP server lists the tools and calls them as the caller", async () =>
168168 "client_timeline",
169169 "reminders_today",
170170 "this_week",
171 "list_people",
171172 "mark_done",
172173 "move_date",
173174 "send_reminder",
@@ -1056,3 +1057,21 @@ test("an agent finds a deal by name over MCP and GET /api/deals?q=, with one ref
10561057 expect((await call({ query: 5 })).isError).toBe(true);
10571058 expect((await api("/api/deals?q=a%01", {}, alice)).status).toBe(400);
10581059 });
1060
1061 test("People lists each person once with the dates they owe, the page and the API agree, and a stranger is refused", async () => {
1062 const pat = as("u-people", "pat");
1063 expect((await api("/people")).status).toBe(401);
1064 const page = await (await api("/people", {}, pat)).text();
1065 const people = (await (await api("/api/people", {}, pat)).json()) as any[];
1066 const priya = people.filter((p) => p.contact === "[email protected]");
1067 expect(priya).toHaveLength(1);
1068 const deals = new Set(priya[0].owes.map((o: any) => o.address));
1069 expect(deals.size).toBeGreaterThan(1);
1070 expect(priya[0].owes.every((o: any, i: number, all: any[]) => i === 0 || all[i - 1].due <= o.due)).toBe(true);
1071 expect(page).not.toContain("<script");
1072 for (const p of people) expect(page).toContain(`<h2>${p.name.replace(/&/g, "&amp;")}</h2>`);
1073 for (const o of priya[0].owes) expect(page).toContain(`href="/deals/${o.deal_id}"`);
1074 expect(page).toContain('href="/people"');
1075 const list = JSON.parse((await rpc({ jsonrpc: "2.0", id: 1, method: "tools/call", params: { name: "list_people", arguments: {} } }, pat)).result.content[0].text);
1076 expect(list).toEqual(people);
1077 });
src/terminal.test.ts +21
@@ -457,3 +457,24 @@ test("a signed-out terminal is not asked for an address", () => {
457457 t.press("A");
458458 expect(deal().address).toBe("12 Elm St");
459459 });
460
461 test("P lists each person once with the dates they owe across deals; a guest is refused", () => {
462 const own = openDb(mkdtempSync(join(tmpdir(), "app-terminal-people-")));
463 const open = (address: string) => {
464 const made = createDeal(own, alice, { address, buyer: "B", seller: "S", contractDate: today(), closingDate: addDays(today(), 30) });
465 if (!made.ok) throw new Error(made.message);
466 addParty(own, alice, { dealId: made.value.id, role: "lender", name: "Lena Lender", contact: "[email protected]" });
467 };
468 open("1 Shared Lane");
469 open("2 Shared Lane");
470 const t = terminal(own, alice, context);
471 t.press("P");
472 const screen = lines(t).join("\n");
473 expect(screen.match(/Lena Lender/g)).toHaveLength(1);
474 expect(screen).toContain("1 Shared Lane");
475 expect(screen).toContain("2 Shared Lane");
476 expect(screen).toContain("Nothing open");
477 const guest = terminal(own, { role: "anon" }, context);
478 guest.press("P");
479 expect(lines(guest).join("\n")).not.toContain("Lena Lender");
480 });
src/terminal.ts +24 −4
@@ -6,6 +6,7 @@
66 * dates every open date of every deal, soonest first (h shows done ones)
77 * week the open dates overdue or due in the next seven days, by day
88 * reminders what goes out today; enter reads a draft, e edits its words, s sends it
9 * people each person on the deals with every open date they owe (P)
910 * timeline a deal's dates as a client would get them (t on a deal)
1011 * deal one deal's dates and parties; a adds a date, p a party, A corrects the address, D removes it
1112 *
@@ -52,6 +53,7 @@ import { PARTY_LABEL, PARTY_ROLES, type PartyRole } from "./deadlines.ts";
5253 import { drafts, MOMENT_LABEL, pending, unsent, type Agent, type Draft } from "./reminders.ts";
5354 import type { Result } from "./result.ts";
5455 import type { Who } from "./who.ts";
56 import { people } from "./people.ts";
5557 import { owner, thisWeek } from "./week.ts";
5658
5759 const esc = "\x1b[";
@@ -60,7 +62,7 @@ const bold = (s: string): string => `${esc}1m${s}${esc}0m`;
6062 const COLOUR: Readonly<Record<Urgency, string>> = { overdue: "31", soon: "33", later: "36", done: "2" };
6163 const tint = (u: Urgency, s: string): string => `${esc}${COLOUR[u]}m${s}${esc}0m`;
6264
63 type View = "dates" | "week" | "reminders" | "deal" | "messages" | "timeline";
65 type View = "dates" | "week" | "people" | "reminders" | "deal" | "messages" | "timeline";
6466 interface Row {
6567 readonly deal: DealView;
6668 readonly date: DeadlineView;
@@ -367,6 +369,9 @@ export function terminal(
367369 } else if (key === "w") {
368370 view = "week";
369371 cursor = 0;
372 } else if (key === "P") {
373 view = "people";
374 cursor = 0;
370375 } else if (key === "r") {
371376 view = "reminders";
372377 cursor = 0;
@@ -445,7 +450,7 @@ export function terminal(
445450 const lines = [
446451 `${bold(context.title)} ${context.agent.name}, ${context.agent.brokerage} ${dim(`${context.agent.phone} · ${context.agent.email}`)} ${dim(context.where)} ${dim(me.role === "anon" ? "guest" : `${me.name}${me.role === "admin" ? " (admin)" : ""}`)}`,
447452 context.ssh === undefined ? dim("The terminal is off.") : dim(`connect: ${context.ssh}`),
448 `${spoken(day)} · ${all.length} deals · ${view === "dates" ? bold("[d] dates") : "[d] dates"} · ${view === "week" ? bold("[w] this week") : "[w] this week"} · ${view === "reminders" ? bold("[r] reminders today") : "[r] reminders today"}`,
453 `${spoken(day)} · ${all.length} deals · ${view === "dates" ? bold("[d] dates") : "[d] dates"} · ${view === "week" ? bold("[w] this week") : "[w] this week"} · ${view === "reminders" ? bold("[r] reminders today") : "[r] reminders today"} · ${view === "people" ? bold("[P] people") : "[P] people"}`,
449454 "",
450455 ];
451456 if (found !== "" && (view === "dates" || view === "week" || view === "reminders"))
@@ -476,6 +481,19 @@ export function terminal(
476481 heading = h;
477482 lines.push(dateLine(row, i, true));
478483 });
484 } else if (view === "people") {
485 const listed = listDeals(db, me);
486 if (!listed.ok) lines.push(listed.message);
487 else {
488 const all = people(listed.value, day);
489 if (all.length === 0) lines.push(dim("No one yet: add a deal and its parties."));
490 for (const p of all) {
491 lines.push(`${bold(p.name)} ${dim(`${p.roles.join(", ")}${p.contact === "" ? "" : ` · ${p.contact}`}`)}`);
492 if (p.owes.length === 0) lines.push(dim(" Nothing open"));
493 for (const o of p.owes)
494 lines.push(` ${tint(o.urgency, `${spoken(o.due).padEnd(12)} ${relative(o.due, day).padEnd(12)}`)} ${o.label} — ${o.address}`);
495 }
496 }
479497 } else if (view === "messages") {
480498 const deal = openDeal();
481499 if (deal === undefined) lines.push(dim("That deal is gone."));
@@ -529,7 +547,9 @@ export function terminal(
529547 else {
530548 if (said !== "") lines.push(...said.split("\n"));
531549 const keys =
532 view === "reminders"
550 view === "people"
551 ? "P people · d dates · w this week · r reminders · q quit"
552 : view === "reminders"
533553 ? "j/k move · enter read · e edit · s send · n don't send · u undo · / find · d dates · q quit"
534554 : view === "messages"
535555 ? "j/k move · enter read · b back to the deal · d dates · q quit"
@@ -537,7 +557,7 @@ export function terminal(
537557 ? "b back to the deal · d dates · q quit"
538558 : view === "deal"
539559 ? "j/k move · t client timeline · s messages · x done · u reopen · m move · a add date · p add party · e edit party · A edit address · X remove date/party · D remove deal · b back · q quit"
540 : `j/k move · x done · u reopen · m move · o open deal · n new deal · c check dates · / find · R restore samples · h ${showDone ? "hide" : "show"} done · w this week · r reminders · q quit`;
560 : `j/k move · x done · u reopen · m move · o open deal · n new deal · c check dates · / find · R restore samples · h ${showDone ? "hide" : "show"} done · w this week · r reminders · P people · q quit`;
541561 lines.push(dim(me.role === "anon" ? `${keys} · sign in with a key the forge knows to change anything` : keys));
542562 }
543563 return lines;
static/app.css +9
@@ -777,6 +777,15 @@ textarea.input {
777777 border-bottom: 1px solid var(--color-line);
778778 cursor: pointer;
779779 }
780 a.week-row {
781 text-decoration: none;
782 }
783 .person h2 {
784 margin: 0;
785 }
786 .person p {
787 margin: var(--space-1) 0 0;
788 }
780789 .week-what {
781790 display: grid;
782791 min-width: 0;

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs