@nanocollective/roster 0.1.0-beta.3 → 0.1.0-beta.31
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -0
- package/dist/agents-POITEZRI.js +232 -0
- package/dist/chunk-FF2WBNNW.js +370 -0
- package/dist/chunk-GDAJPOHK.js +562 -0
- package/dist/cli.js +3391 -1239
- package/dist/compose-5DBEHSEV.js +17 -0
- package/dist/connectors-5E5ZMGZV.js +23 -0
- package/dist/worker/assets/assets/css/astryx.css +948 -0
- package/dist/worker/assets/assets/css/base.css +51 -110
- package/dist/worker/assets/assets/css/brain.css +28 -2
- package/dist/worker/assets/assets/css/connectors.css +58 -0
- package/dist/worker/assets/assets/css/graph.css +9 -12
- package/dist/worker/assets/assets/css/health.css +4 -7
- package/dist/worker/assets/assets/css/home.css +155 -60
- package/dist/worker/assets/assets/css/inbox.css +11 -0
- package/dist/worker/assets/assets/css/layout.css +18 -22
- package/dist/worker/assets/assets/css/markdown.css +22 -1
- package/dist/worker/assets/assets/css/routines.css +43 -0
- package/dist/worker/assets/assets/css/runs.css +5 -3
- package/dist/worker/assets/assets/css/search.css +3 -6
- package/dist/worker/assets/assets/css/setup.css +8 -15
- package/dist/worker/assets/assets/js/api.js +3 -0
- package/dist/worker/assets/assets/js/app.js +28 -1
- package/dist/worker/assets/assets/js/astryx-ui.js +34 -0
- package/dist/worker/assets/assets/js/dom.js +1 -1
- package/dist/worker/assets/assets/js/homesort.js +66 -20
- package/dist/worker/assets/assets/js/icons.js +6 -0
- package/dist/worker/assets/assets/js/md.js +7 -2
- package/dist/worker/assets/assets/js/mention.js +2 -1
- package/dist/worker/assets/assets/js/readiness.js +36 -0
- package/dist/worker/assets/assets/js/refcard.js +216 -0
- package/dist/worker/assets/assets/js/refresh.js +8 -2
- package/dist/worker/assets/assets/js/report.js +51 -0
- package/dist/worker/assets/assets/js/select.js +362 -0
- package/dist/worker/assets/assets/js/state.js +14 -1
- package/dist/worker/assets/assets/js/views/connectors.js +428 -0
- package/dist/worker/assets/assets/js/views/graph.js +67 -28
- package/dist/worker/assets/assets/js/views/health.js +11 -5
- package/dist/worker/assets/assets/js/views/home.js +453 -174
- package/dist/worker/assets/assets/js/views/inbox.js +82 -17
- package/dist/worker/assets/assets/js/views/notready.js +60 -0
- package/dist/worker/assets/assets/js/views/org.js +16 -1
- package/dist/worker/assets/assets/js/views/people.js +109 -0
- package/dist/worker/assets/assets/js/views/routines.js +395 -0
- package/dist/worker/assets/assets/js/views/runonce.js +5 -0
- package/dist/worker/assets/assets/js/views/runs.js +14 -2
- package/dist/worker/assets/assets/js/views/staff.js +18 -3
- package/dist/worker/assets/docs-images/brain.jpg +0 -0
- package/dist/worker/assets/docs-images/home.jpg +0 -0
- package/dist/worker/assets/docs-images/org.jpg +0 -0
- package/dist/worker/assets/docs-images/prompt.jpg +0 -0
- package/dist/worker/assets/docs-images/setup-org.jpg +0 -0
- package/dist/worker/assets/docs-images/setup-plan.jpg +0 -0
- package/dist/worker/assets/docs-images/staff.jpg +0 -0
- package/dist/worker/assets/index.html +19 -3
- package/dist/worker/index.js +4478 -1098
- package/docs/README.md +2 -0
- package/docs/architecture.md +23 -4
- package/docs/commands.md +111 -9
- package/docs/concepts.md +2 -1
- package/docs/connectors.md +169 -0
- package/docs/cost.md +1 -1
- package/docs/developing.md +3 -3
- package/docs/doctor-codes.md +8 -2
- package/docs/export.md +4 -3
- package/docs/extending.md +1 -1
- package/docs/getting-started.md +20 -3
- package/docs/hosting.md +67 -3
- package/docs/images/brain.jpg +0 -0
- package/docs/images/home.jpg +0 -0
- package/docs/images/org.jpg +0 -0
- package/docs/images/prompt.jpg +0 -0
- package/docs/images/setup-org.jpg +0 -0
- package/docs/images/setup-plan.jpg +0 -0
- package/docs/images/staff.jpg +0 -0
- package/docs/memory.md +3 -2
- package/docs/org-yaml.md +58 -5
- package/docs/portal.md +52 -11
- package/docs/prompts.md +3 -2
- package/docs/routines.md +65 -0
- package/docs/security.md +37 -4
- package/docs/session-workflow.md +31 -8
- package/docs/staff-yaml.md +7 -3
- package/docs/troubleshooting.md +1 -1
- package/docs/upgrading.md +1 -1
- package/docs/writing-a-charter.md +1 -1
- package/package.json +8 -1
- package/templates/brain/.gitattributes +3 -0
- package/templates/brain/.github/workflows/%%STAFF%%-daily.yaml +24 -15
- package/templates/brain/.github/workflows/%%STAFF%%-mention.yaml +12 -10
- package/templates/brain/CHARTER.md +2 -2
- package/templates/brain/STATE.md +16 -0
- package/templates/brain/memory/INDEX.md +1 -1
- package/templates/brain/staff.yaml +3 -0
- package/templates/ops/.gitattributes +3 -0
- package/templates/ops/.github/workflows/session.yaml +92 -13
- package/templates/ops/agents.mjs +38 -11
- package/templates/ops/compose.mjs +60 -2
- package/templates/ops/connectors.mjs +722 -0
- package/templates/ops/org/operating.md +10 -0
- package/templates/ops/org/voice.md +21 -3
- package/templates/ops/prompts/_identity.md +20 -0
- package/templates/ops/prompts/daily.md +70 -19
- package/templates/ops/prompts/mention.md +7 -2
- package/templates/ops/status-week.mjs +169 -0
- package/templates/portal/css/astryx.css +948 -0
- package/templates/portal/css/base.css +51 -110
- package/templates/portal/css/brain.css +28 -2
- package/templates/portal/css/connectors.css +58 -0
- package/templates/portal/css/graph.css +9 -12
- package/templates/portal/css/health.css +4 -7
- package/templates/portal/css/home.css +155 -60
- package/templates/portal/css/inbox.css +11 -0
- package/templates/portal/css/layout.css +18 -22
- package/templates/portal/css/markdown.css +22 -1
- package/templates/portal/css/routines.css +43 -0
- package/templates/portal/css/runs.css +5 -3
- package/templates/portal/css/search.css +3 -6
- package/templates/portal/css/setup.css +8 -15
- package/templates/portal/index.html +19 -3
- package/templates/portal/js/api.js +3 -0
- package/templates/portal/js/app.js +28 -1
- package/templates/portal/js/astryx-ui.js +34 -0
- package/templates/portal/js/dom.js +1 -1
- package/templates/portal/js/homesort.js +66 -20
- package/templates/portal/js/icons.js +6 -0
- package/templates/portal/js/md.js +7 -2
- package/templates/portal/js/mention.js +2 -1
- package/templates/portal/js/readiness.js +36 -0
- package/templates/portal/js/refcard.js +216 -0
- package/templates/portal/js/refresh.js +8 -2
- package/templates/portal/js/report.js +51 -0
- package/templates/portal/js/select.js +362 -0
- package/templates/portal/js/state.js +14 -1
- package/templates/portal/js/views/connectors.js +428 -0
- package/templates/portal/js/views/graph.js +67 -28
- package/templates/portal/js/views/health.js +11 -5
- package/templates/portal/js/views/home.js +453 -174
- package/templates/portal/js/views/inbox.js +82 -17
- package/templates/portal/js/views/notready.js +60 -0
- package/templates/portal/js/views/org.js +16 -1
- package/templates/portal/js/views/people.js +109 -0
- package/templates/portal/js/views/routines.js +395 -0
- package/templates/portal/js/views/runonce.js +5 -0
- package/templates/portal/js/views/runs.js +14 -2
- package/templates/portal/js/views/staff.js +18 -3
- package/templates/skill/SKILL.md +115 -0
|
@@ -1,14 +1,18 @@
|
|
|
1
|
-
/* Home: what needs you,
|
|
1
|
+
/* Home: who is working, what needs you, how each staff member is getting on, what you asked
|
|
2
|
+
* for, and what was closed today.
|
|
2
3
|
*
|
|
3
4
|
* Built from the inbox list and /api/live, sorted by homesort.js, which is where the rule that
|
|
4
5
|
* every open item has exactly one place lives. Clicking an item opens its thread in a side
|
|
5
6
|
* sheet, the same thread view Trackers has, with the reply box in it. */
|
|
6
7
|
|
|
7
8
|
import { getLive, post } from "../api.js";
|
|
8
|
-
import { sheet } from "../dialog.js";
|
|
9
|
+
import { askText, sheet } from "../dialog.js";
|
|
9
10
|
import { ago, el, skeleton } from "../dom.js";
|
|
10
|
-
import { daysUntil, sortHome } from "../homesort.js";
|
|
11
|
+
import { daysUntil, isFor, sortHome } from "../homesort.js";
|
|
11
12
|
import { mdlite } from "../md.js";
|
|
13
|
+
import { checkAll, notReady, ORG_STEPS, stepCommand } from "../readiness.js";
|
|
14
|
+
import { commandLine } from "./notready.js";
|
|
15
|
+
import { parseReport } from "../report.js";
|
|
12
16
|
import { icon, iconHTML, staffIcon } from "../icons.js";
|
|
13
17
|
import { ensureInbox, stampCounts } from "../refresh.js";
|
|
14
18
|
import { go, render } from "../router.js";
|
|
@@ -53,56 +57,44 @@ export function viewHome(m) {
|
|
|
53
57
|
stampCounts();
|
|
54
58
|
|
|
55
59
|
const page = el("div", { className: "home" });
|
|
56
|
-
page.append(
|
|
57
|
-
|
|
58
|
-
if (
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
if (!ev.target.closest("a, button")) openThread(r.item);
|
|
77
|
-
};
|
|
78
|
-
row.onkeydown = (ev) => {
|
|
79
|
-
if (ev.target === row && (ev.key === "Enter" || ev.key === " ")) {
|
|
80
|
-
ev.preventDefault();
|
|
81
|
-
openThread(r.item);
|
|
82
|
-
}
|
|
83
|
-
};
|
|
84
|
-
box.append(row);
|
|
85
|
-
}
|
|
86
|
-
page.append(box);
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
page.append(section("Needs you", h.needs.length));
|
|
90
|
-
if (h.needs.length) for (const e of h.needs) page.append(needCard(e));
|
|
91
|
-
else page.append(el("p", { className: "homeempty", textContent: "Nothing needs you." }));
|
|
60
|
+
page.append(team(staff));
|
|
61
|
+
const unset = setupLeft(staff);
|
|
62
|
+
if (unset) page.append(unset);
|
|
63
|
+
|
|
64
|
+
/* With more than one person, each sees what is on them, plus anything on nobody in
|
|
65
|
+
particular. Everyone's is one click away, so nothing is hidden for good. */
|
|
66
|
+
const me = meHuman();
|
|
67
|
+
const split = Boolean(me) && humansOf().length > 1;
|
|
68
|
+
const mine = split ? h.needs.filter((e) => isFor(e, me.github)) : h.needs;
|
|
69
|
+
const shown = split && needsScope === "all" ? h.needs : mine;
|
|
70
|
+
const needsHead = section("Needs you", shown.length);
|
|
71
|
+
if (split && mine.length !== h.needs.length) needsHead.append(scopeToggle(mine.length, h.needs.length));
|
|
72
|
+
page.append(needsHead);
|
|
73
|
+
/* One list rather than a card each: five boxes with a green button apiece read as a wall, and
|
|
74
|
+
nothing in it said which to do first. The top row's action is the one in green. */
|
|
75
|
+
if (shown.length) {
|
|
76
|
+
page.append(
|
|
77
|
+
el("div", { className: "card homelist" }, shown.map((e, i) => needRow(e, i === 0, split ? me : null))),
|
|
78
|
+
);
|
|
79
|
+
} else page.append(el("p", { className: "homeempty", textContent: "Nothing needs you." }));
|
|
92
80
|
|
|
81
|
+
// What is waiting on you, or was asked by you, comes before how the staff say it is going.
|
|
93
82
|
if (h.unread.length) {
|
|
94
83
|
page.append(section("Unread", h.unread.length));
|
|
95
84
|
page.append(listBox(h.unread.map(unreadRow)));
|
|
96
85
|
}
|
|
97
86
|
|
|
98
|
-
page.append(section("Working now"));
|
|
99
|
-
page.append(working(staff));
|
|
100
|
-
|
|
101
87
|
if (h.requests.length) {
|
|
102
88
|
page.append(section("Your requests", h.requests.length));
|
|
103
89
|
page.append(listBox(h.requests.map(requestRow)));
|
|
104
90
|
}
|
|
105
91
|
|
|
92
|
+
const reporters = staff.filter((x) => x.brain && x.statusIssue);
|
|
93
|
+
if (reporters.length) {
|
|
94
|
+
page.append(section("Progress"));
|
|
95
|
+
page.append(el("div", { className: "card homereports" }, reporters.map((s) => reportRow(s, h.reports))));
|
|
96
|
+
}
|
|
97
|
+
|
|
106
98
|
if (h.closedToday.length) {
|
|
107
99
|
page.append(section("Closed today", h.closedToday.length));
|
|
108
100
|
page.append(listBox(h.closedToday.map(closedRow)));
|
|
@@ -113,48 +105,178 @@ export function viewHome(m) {
|
|
|
113
105
|
m.append(page);
|
|
114
106
|
}
|
|
115
107
|
|
|
116
|
-
/* -------------------------------
|
|
108
|
+
/* ------------------------------- reports -------------------------------- */
|
|
117
109
|
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
110
|
+
/** Whose reports are open in full. Kept here, since Home repaints on every poll. */
|
|
111
|
+
const openReports = new Set();
|
|
112
|
+
|
|
113
|
+
const STATUS_TONE = { "on track": "ok", "needs you": "warm", stuck: "hot", blocked: "hot" };
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* One staff member's report, as a row: who, their status, and when it was written; then the
|
|
117
|
+
* one line on how it is going and what is next. What got done, and the rest of the report,
|
|
118
|
+
* open under it. Their status issue is rewritten by every run, so this is always the latest.
|
|
119
|
+
*/
|
|
120
|
+
function reportRow(s, reports) {
|
|
121
|
+
/* Before a first run the status issue holds the scaffold hire wrote, which read as a report
|
|
122
|
+
from 36 minutes ago. And asking for one wakes somebody who cannot run yet. */
|
|
123
|
+
const left = S.readiness?.[s.handle] ?? [];
|
|
124
|
+
const neverRan = left.includes("run once");
|
|
125
|
+
const unready = left.some((x) => x !== "run once");
|
|
126
|
+
const r = neverRan ? null : reports.find((x) => x.staff.handle === s.handle);
|
|
127
|
+
const item = r?.item ?? { repo: s.brain, number: s.statusIssue, kind: "issue" };
|
|
129
128
|
const note = el("span", { className: "meta" });
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
note.textContent = "Sending…";
|
|
129
|
+
const ask = el("button", { className: "ghbtn sm", textContent: "Ask for an update" });
|
|
130
|
+
ask.onclick = async () => {
|
|
131
|
+
ask.disabled = true;
|
|
132
|
+
note.className = "meta";
|
|
133
|
+
note.textContent = "Asking…";
|
|
136
134
|
try {
|
|
137
135
|
await post({
|
|
138
|
-
action: "
|
|
136
|
+
action: "comment",
|
|
139
137
|
repo: s.brain,
|
|
140
|
-
|
|
141
|
-
body: `${s.mention ?? "@" + s.handle}
|
|
138
|
+
number: s.statusIssue,
|
|
139
|
+
body: `${s.mention ?? "@" + s.handle} Report, please.`,
|
|
142
140
|
});
|
|
143
|
-
|
|
144
|
-
note.textContent = `
|
|
141
|
+
ask.remove();
|
|
142
|
+
note.textContent = `Asked. ${s.name} updates it in a few minutes.`;
|
|
145
143
|
refreshSoon();
|
|
146
144
|
} catch (e) {
|
|
147
145
|
note.textContent = String(e.message || e);
|
|
148
146
|
note.className = "meta err";
|
|
149
|
-
|
|
150
|
-
send.disabled = false;
|
|
147
|
+
ask.disabled = false;
|
|
151
148
|
}
|
|
152
149
|
};
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
150
|
+
|
|
151
|
+
const full = openReports.has(s.handle);
|
|
152
|
+
const row = el("div", { className: "homereport" + (full ? " full" : "") });
|
|
153
|
+
const issue = el("button", { className: "homereportissue", textContent: "#" + item.number });
|
|
154
|
+
issue.onclick = () => openThread(item);
|
|
155
|
+
const p = r ? parseReport(r.body) : null;
|
|
156
|
+
const needs = p?.sections.needs?.length ?? 0;
|
|
157
|
+
|
|
158
|
+
const head = el("div", { className: "homereporthead" }, [
|
|
159
|
+
el("span", { className: "homewho2" }, [icon(staffIcon(s), "ic"), el("b", { textContent: s.name })]),
|
|
157
160
|
]);
|
|
161
|
+
if (p?.status) {
|
|
162
|
+
head.append(
|
|
163
|
+
el("span", {
|
|
164
|
+
className: "chip homereportstatus " + (STATUS_TONE[p.status] ?? ""),
|
|
165
|
+
textContent: cap(p.status) + (needs ? ` · ${needs}` : ""),
|
|
166
|
+
title: needs ? `Waiting on a person: ${needs} thing${needs === 1 ? "" : "s"}` : "",
|
|
167
|
+
}),
|
|
168
|
+
);
|
|
169
|
+
}
|
|
170
|
+
head.append(
|
|
171
|
+
el("span", { className: "meta homereportwhen" }, [
|
|
172
|
+
document.createTextNode(
|
|
173
|
+
(r ? "Updated " + ago(r.at) : neverRan ? "No report yet: the first comes with their first run" : "No report yet") +
|
|
174
|
+
" · ",
|
|
175
|
+
),
|
|
176
|
+
issue,
|
|
177
|
+
]),
|
|
178
|
+
);
|
|
179
|
+
const acts = el("span", { className: "homereportacts" }, [note]);
|
|
180
|
+
if (r) {
|
|
181
|
+
const more = el("button", { className: "ghbtn sm", textContent: full ? "Show less" : "Full report" });
|
|
182
|
+
more.onclick = () => {
|
|
183
|
+
if (openReports.has(s.handle)) openReports.delete(s.handle);
|
|
184
|
+
else openReports.add(s.handle);
|
|
185
|
+
repaintInPlace();
|
|
186
|
+
};
|
|
187
|
+
acts.append(more);
|
|
188
|
+
}
|
|
189
|
+
if (!unready) acts.append(ask);
|
|
190
|
+
head.append(acts);
|
|
191
|
+
row.append(head);
|
|
192
|
+
|
|
193
|
+
if (!p) return row;
|
|
194
|
+
if (p.headline) {
|
|
195
|
+
row.append(el("div", { className: "md homereportline", innerHTML: mdlite(p.headline, { repo: s.brain }) }));
|
|
196
|
+
}
|
|
197
|
+
const next = p.sections.next?.[0];
|
|
198
|
+
if (next && !full) {
|
|
199
|
+
row.append(
|
|
200
|
+
el("div", { className: "homereportnext" }, [
|
|
201
|
+
el("b", { textContent: "Next" }),
|
|
202
|
+
el("span", { className: "md", innerHTML: mdlite(next, { repo: s.brain }) }),
|
|
203
|
+
]),
|
|
204
|
+
);
|
|
205
|
+
}
|
|
206
|
+
if (full) {
|
|
207
|
+
const cols = [
|
|
208
|
+
["done", "Done"],
|
|
209
|
+
["next", "Next"],
|
|
210
|
+
["needs", "Waiting on a person"],
|
|
211
|
+
].filter(([k]) => p.sections[k]?.length);
|
|
212
|
+
if (cols.length) {
|
|
213
|
+
row.append(
|
|
214
|
+
el(
|
|
215
|
+
"div",
|
|
216
|
+
{ className: "homereportcols" },
|
|
217
|
+
cols.map(([k, label]) => bullets(label, p.sections[k], s.brain, 99)),
|
|
218
|
+
),
|
|
219
|
+
);
|
|
220
|
+
} else {
|
|
221
|
+
// A report in the old shape has no sections, so the whole of it stands in.
|
|
222
|
+
row.append(el("div", { className: "md homereportbody", innerHTML: mdlite(r.body, { repo: s.brain }) }));
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
return row;
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
/** A short list under a label, with how many more there are once it runs past `max`. */
|
|
229
|
+
function bullets(label, items, repo, max) {
|
|
230
|
+
const list = el(
|
|
231
|
+
"ul",
|
|
232
|
+
{},
|
|
233
|
+
items.slice(0, max).map((x) => el("li", { className: "md", innerHTML: mdlite(x, { repo }) })),
|
|
234
|
+
);
|
|
235
|
+
const box = el("div", { className: "homereportcol" }, [el("h3", { textContent: label }), list]);
|
|
236
|
+
if (items.length > max) box.append(el("p", { className: "meta", textContent: `and ${items.length - max} more` }));
|
|
237
|
+
return box;
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
/* ------------------------------- asking -------------------------------- */
|
|
241
|
+
|
|
242
|
+
/** What each staff member is being asked, kept if the dialog is closed before sending. */
|
|
243
|
+
const askDrafts = {};
|
|
244
|
+
/** When each was last asked, so their card can say so until they pick it up. */
|
|
245
|
+
const askedAt = {};
|
|
246
|
+
|
|
247
|
+
/**
|
|
248
|
+
* Asking one staff member to do something: their card's button opens this, already addressed
|
|
249
|
+
* to them. It becomes a new issue on their tracker that mentions them, which starts a run.
|
|
250
|
+
*/
|
|
251
|
+
async function askStaff(s, error = "") {
|
|
252
|
+
const said = await askText({
|
|
253
|
+
title: `Ask ${s.name}`,
|
|
254
|
+
hint: error,
|
|
255
|
+
value: askDrafts[s.handle] ?? "",
|
|
256
|
+
placeholder: "What do you need? For example: write a post about the new pricing page.",
|
|
257
|
+
confirm: "Send",
|
|
258
|
+
decorate: (ta) => {
|
|
259
|
+
ta.addEventListener("input", () => {
|
|
260
|
+
askDrafts[s.handle] = ta.value;
|
|
261
|
+
});
|
|
262
|
+
},
|
|
263
|
+
});
|
|
264
|
+
if (!said) return;
|
|
265
|
+
try {
|
|
266
|
+
await post({
|
|
267
|
+
action: "create",
|
|
268
|
+
repo: s.brain,
|
|
269
|
+
title: titleOf(said),
|
|
270
|
+
body: `${s.mention ?? "@" + s.handle} ${said}`,
|
|
271
|
+
});
|
|
272
|
+
delete askDrafts[s.handle];
|
|
273
|
+
askedAt[s.handle] = Date.now();
|
|
274
|
+
repaintInPlace();
|
|
275
|
+
refreshSoon();
|
|
276
|
+
} catch (e) {
|
|
277
|
+
askDrafts[s.handle] = said;
|
|
278
|
+
await askStaff(s, String(e.message || e));
|
|
279
|
+
}
|
|
158
280
|
}
|
|
159
281
|
|
|
160
282
|
/** The first line, short enough to be an issue title. */
|
|
@@ -165,57 +287,107 @@ function titleOf(said) {
|
|
|
165
287
|
|
|
166
288
|
/* ------------------------------ needs you ------------------------------- */
|
|
167
289
|
|
|
168
|
-
|
|
290
|
+
/** "mine" or "all": whose asks Needs you lists, when there is more than one person. */
|
|
291
|
+
let needsScope = readScope();
|
|
292
|
+
|
|
293
|
+
function readScope() {
|
|
294
|
+
try {
|
|
295
|
+
return localStorage.getItem("roster.needsScope") === "all" ? "all" : "mine";
|
|
296
|
+
} catch {
|
|
297
|
+
return "mine";
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
/** The signed-in person, when they are one of the org's humans. */
|
|
302
|
+
function meHuman() {
|
|
303
|
+
const login = String(S.me ?? "").toLowerCase();
|
|
304
|
+
return login ? (humansOf().find((h) => String(h.github ?? "").toLowerCase() === login) ?? null) : null;
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
function scopeToggle(mine, all) {
|
|
308
|
+
const bar = el("span", { className: "homescope", role: "group", ariaLabel: "Whose to show" });
|
|
309
|
+
for (const [value, label] of [
|
|
310
|
+
["mine", `Yours ${mine}`],
|
|
311
|
+
["all", `Everyone's ${all}`],
|
|
312
|
+
]) {
|
|
313
|
+
const b = el("button", { className: needsScope === value ? "on" : "", textContent: label });
|
|
314
|
+
b.setAttribute("aria-pressed", String(needsScope === value));
|
|
315
|
+
b.onclick = () => {
|
|
316
|
+
needsScope = value;
|
|
317
|
+
try {
|
|
318
|
+
localStorage.setItem("roster.needsScope", value);
|
|
319
|
+
} catch {
|
|
320
|
+
/* a private window: it is only remembered for this visit */
|
|
321
|
+
}
|
|
322
|
+
repaintInPlace();
|
|
323
|
+
};
|
|
324
|
+
bar.append(b);
|
|
325
|
+
}
|
|
326
|
+
return bar;
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
/** "For Ben", on an ask that is on somebody else. */
|
|
330
|
+
function forWhom(e, me) {
|
|
331
|
+
if (!me || !e.for?.length || e.for.some((g) => g.toLowerCase() === me.github.toLowerCase())) return "";
|
|
332
|
+
const names = e.for.map((g) => humansOf().find((h) => h.github === g)?.name ?? g);
|
|
333
|
+
return "For " + names.join(" and ");
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
function needRow(e, first, me = null) {
|
|
169
337
|
const { item, kind } = e;
|
|
170
|
-
/* The whole
|
|
338
|
+
/* The whole row opens the thread; the one quick action on it does not. Answering in words
|
|
171
339
|
happens in the thread, where what was asked is in front of you. */
|
|
172
|
-
const
|
|
173
|
-
className: "
|
|
340
|
+
const row = el("div", {
|
|
341
|
+
className: "homeneed" + (item.unread ? " unread" : ""),
|
|
174
342
|
tabIndex: 0,
|
|
175
343
|
role: "button",
|
|
176
344
|
});
|
|
177
|
-
|
|
345
|
+
row.onclick = (ev) => {
|
|
178
346
|
if (!ev.target.closest("button, a, textarea")) openThread(item);
|
|
179
347
|
};
|
|
180
|
-
|
|
181
|
-
if (ev.target ===
|
|
348
|
+
row.onkeydown = (ev) => {
|
|
349
|
+
if (ev.target === row && (ev.key === "Enter" || ev.key === " ")) {
|
|
182
350
|
ev.preventDefault();
|
|
183
351
|
openThread(item);
|
|
184
352
|
}
|
|
185
353
|
};
|
|
186
|
-
// What it is on the left, what you can do about it on the right.
|
|
187
|
-
const about = el("div", { className: "homeabout" }, [
|
|
188
|
-
el("div", { className: "homehead" }, [
|
|
189
|
-
el("span", { className: "chip " + (KIND_TONE[kind] ?? ""), textContent: KIND_LABEL[kind] }),
|
|
190
|
-
openLink(item),
|
|
191
|
-
]),
|
|
192
|
-
el("div", { className: "meta", textContent: whereOf(e) + " · " + ago(item.createdAt) }),
|
|
193
|
-
]);
|
|
194
|
-
card.append(about);
|
|
195
354
|
|
|
355
|
+
/* What kind of thing it is sits in the line under the title, so every title starts in the
|
|
356
|
+
same place; a chip in front of it pushed each one along by its own width. */
|
|
357
|
+
const other = forWhom(e, me);
|
|
358
|
+
const meta = el("div", { className: "meta" }, [
|
|
359
|
+
el("span", { className: "homekind " + (KIND_TONE[kind] ?? ""), textContent: KIND_LABEL[kind] }),
|
|
360
|
+
...(other ? [document.createTextNode(" · "), el("span", { className: "homefor", textContent: other })] : []),
|
|
361
|
+
document.createTextNode(" · " + whereOf(e) + " · " + ago(item.createdAt)),
|
|
362
|
+
]);
|
|
363
|
+
const about = el("div", { className: "homeabout" }, [openLink(item), meta]);
|
|
196
364
|
if (kind === "decision" && item.due) about.append(dueLine(item.due));
|
|
197
365
|
if (kind === "merge") about.append(checksLine(item));
|
|
198
366
|
|
|
199
367
|
// The note comes first so that what happened sits just left of the button that did it.
|
|
200
368
|
const note = el("span", { className: "meta" });
|
|
201
369
|
const actions = el("div", { className: "row homeacts" }, [note]);
|
|
370
|
+
row.append(el("span", { className: "homedot", ariaHidden: "true" }), about, actions);
|
|
202
371
|
|
|
203
372
|
if (kind === "decision" || kind === "ask") {
|
|
204
|
-
actions.append(button("Reply",
|
|
205
|
-
if (item.due)
|
|
373
|
+
actions.append(button("Reply", first, () => openThread(item)));
|
|
374
|
+
if (item.due) {
|
|
375
|
+
actions.append(button("Go with the default", false, () => say(e, "Go with your default.", note, actions)));
|
|
376
|
+
}
|
|
206
377
|
} else if (kind === "review") {
|
|
207
|
-
actions.append(button("Approve",
|
|
378
|
+
actions.append(button("Approve", first, () => say(e, "Approved.", note, actions)));
|
|
208
379
|
} else if (kind === "chore") {
|
|
209
|
-
actions.append(button("Done",
|
|
380
|
+
actions.append(button("Done", first, () => done(e, note, actions)));
|
|
210
381
|
} else if (kind === "merge") {
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
if (
|
|
218
|
-
|
|
382
|
+
/* Merge is offered only when pressing it can work. A conflict, failing checks or checks
|
|
383
|
+
still running are in the line under the title instead; a grey button that cannot be
|
|
384
|
+
pressed looked like one that could. */
|
|
385
|
+
const blocked =
|
|
386
|
+
item.checks === "failing" || item.checks === "pending" || item.mergeable === "CONFLICTING";
|
|
387
|
+
const merge = () => button("Merge", first, () => merge_(e, note, actions));
|
|
388
|
+
if (item.reviewDecision === "REVIEW_REQUIRED") {
|
|
389
|
+
// Approve is the person's review, given on purpose; Merge waits for it.
|
|
390
|
+
const approve = button("Approve", first, async () => {
|
|
219
391
|
approve.disabled = true;
|
|
220
392
|
note.className = "meta";
|
|
221
393
|
note.textContent = "Approving…";
|
|
@@ -224,8 +396,7 @@ function needCard(e) {
|
|
|
224
396
|
item.reviewDecision = "APPROVED";
|
|
225
397
|
note.textContent = "Approved.";
|
|
226
398
|
approve.remove();
|
|
227
|
-
|
|
228
|
-
merge.disabled = blocked || item.checks === "pending";
|
|
399
|
+
if (!blocked) actions.append(merge());
|
|
229
400
|
} catch (err) {
|
|
230
401
|
note.textContent = String(err.message || err);
|
|
231
402
|
note.className = "meta err";
|
|
@@ -233,11 +404,9 @@ function needCard(e) {
|
|
|
233
404
|
}
|
|
234
405
|
});
|
|
235
406
|
actions.append(approve);
|
|
236
|
-
}
|
|
237
|
-
actions.append(merge);
|
|
407
|
+
} else if (!blocked) actions.append(merge());
|
|
238
408
|
}
|
|
239
|
-
|
|
240
|
-
return card;
|
|
409
|
+
return row;
|
|
241
410
|
}
|
|
242
411
|
|
|
243
412
|
function dueLine(due) {
|
|
@@ -250,20 +419,20 @@ function dueLine(due) {
|
|
|
250
419
|
});
|
|
251
420
|
}
|
|
252
421
|
|
|
422
|
+
/** Where a pull request stands, with only the parts that stop a merge in amber. */
|
|
253
423
|
function checksLine(item) {
|
|
254
|
-
const
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
const
|
|
261
|
-
|
|
262
|
-
(
|
|
263
|
-
|
|
264
|
-
className: "homedue" + (item.checks === "failing" || conflict ? " late" : ""),
|
|
265
|
-
textContent: (words[item.checks] ?? "") + conflict,
|
|
424
|
+
const parts = [];
|
|
425
|
+
if (item.checks === "passing") parts.push(["Checks pass", false]);
|
|
426
|
+
if (item.checks === "failing") parts.push(["Checks fail", true]);
|
|
427
|
+
if (item.checks === "pending") parts.push(["Checks are running", false]);
|
|
428
|
+
if (item.mergeable === "CONFLICTING") parts.push(["Conflicts with its base", true]);
|
|
429
|
+
if (item.reviewDecision === "REVIEW_REQUIRED") parts.push(["Needs your approval", false]);
|
|
430
|
+
const line = el("p", { className: "homedue" });
|
|
431
|
+
parts.forEach(([text, bad], i) => {
|
|
432
|
+
if (i) line.append(document.createTextNode(" · "));
|
|
433
|
+
line.append(el("span", { className: bad ? "bad" : "", textContent: text }));
|
|
266
434
|
});
|
|
435
|
+
return line;
|
|
267
436
|
}
|
|
268
437
|
|
|
269
438
|
async function say(e, text, note, actions) {
|
|
@@ -289,7 +458,7 @@ async function act(note, actions, payload, ok) {
|
|
|
289
458
|
await post(payload);
|
|
290
459
|
note.textContent = ok;
|
|
291
460
|
// Done is done: the card goes now, rather than when GitHub next answers.
|
|
292
|
-
const card = actions.closest?.(".
|
|
461
|
+
const card = actions.closest?.(".homeneed, .homeline");
|
|
293
462
|
if (card) {
|
|
294
463
|
card.classList.add("gone");
|
|
295
464
|
setTimeout(() => card.remove(), 220);
|
|
@@ -302,75 +471,181 @@ async function act(note, actions, payload, ok) {
|
|
|
302
471
|
}
|
|
303
472
|
}
|
|
304
473
|
|
|
305
|
-
/*
|
|
474
|
+
/* ---------------------------------- team ---------------------------------- */
|
|
306
475
|
|
|
307
|
-
|
|
476
|
+
/* One colour per staff member, in hire order, so two orbs side by side are told apart. */
|
|
477
|
+
const HUES = ["#30d158", "#0a84ff", "#bf5af2", "#ff375f", "#ff9f0a", "#64d2ff", "#ffd60a"];
|
|
478
|
+
|
|
479
|
+
/** What a run is doing, as a person would say it. */
|
|
308
480
|
function whatRun(r) {
|
|
309
|
-
|
|
310
|
-
if (r.trigger === "
|
|
481
|
+
const on = r.issue ? titleOn(r) : "";
|
|
482
|
+
if (r.trigger === "mention") return r.issue ? `Answering #${r.issue}${on}` : "Answering a message";
|
|
483
|
+
if (r.trigger === "peer") return r.issue ? `Helping a colleague with #${r.issue}${on}` : "Helping a colleague";
|
|
484
|
+
if (r.trigger === "routine") return r.routine ? `Running the ${r.routine} routine` : "Running a routine";
|
|
311
485
|
return (
|
|
312
|
-
{
|
|
313
|
-
|
|
486
|
+
{
|
|
487
|
+
daily: "Doing their daily work",
|
|
488
|
+
manual: "Doing the work you started",
|
|
489
|
+
"follow-on": "Carrying on from their last session",
|
|
490
|
+
}[r.trigger] ?? "Working"
|
|
314
491
|
);
|
|
315
492
|
}
|
|
316
493
|
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
494
|
+
/** ": the issue's title", when the inbox has it. */
|
|
495
|
+
function titleOn(r) {
|
|
496
|
+
const s = (S.data?.staff ?? []).find((x) => x.handle === r.handle);
|
|
497
|
+
const it = (S.inbox?.items ?? []).find((i) => i.number === r.issue && (!s || i.repo === s.brain));
|
|
498
|
+
return it?.title ? `: ${it.title}` : "";
|
|
499
|
+
}
|
|
500
|
+
|
|
501
|
+
/**
|
|
502
|
+
* Who is working, as a row of orbs. A lit, moving orb is somebody at work; a still, dim one is
|
|
503
|
+
* somebody free. Under it, in words, what they are doing or when they last finished. Pressing
|
|
504
|
+
* an orb that is answering something opens that thread.
|
|
505
|
+
*/
|
|
506
|
+
function team(staff) {
|
|
507
|
+
const box = el("div", { className: "hometeam" });
|
|
508
|
+
const live = S.live?.staff ?? [];
|
|
509
|
+
staff.forEach((s, i) => {
|
|
510
|
+
const l = live.find((x) => x.handle === s.handle);
|
|
325
511
|
const runs = l && !l.error ? (l.running ?? []) : [];
|
|
326
|
-
const
|
|
512
|
+
const queued = runs.length > 0 && runs.every((r) => r.status === "queued");
|
|
513
|
+
const busy = runs.length > 0 && !queued;
|
|
327
514
|
const last = l?.finished?.[0];
|
|
328
|
-
|
|
329
|
-
const
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
515
|
+
const failed = !runs.length && last && last.conclusion === "failure";
|
|
516
|
+
const state = !S.live ? "wait" : busy ? "busy" : queued ? "queued" : failed ? "failed" : "idle";
|
|
517
|
+
|
|
518
|
+
let word = "Free";
|
|
519
|
+
let line = "Not working right now";
|
|
520
|
+
if (!S.live) {
|
|
521
|
+
word = "…";
|
|
522
|
+
line = "Checking…";
|
|
523
|
+
} else if (!l || l.error) {
|
|
524
|
+
word = "Unknown";
|
|
525
|
+
line = "Could not check on them";
|
|
526
|
+
} else if (busy || queued) {
|
|
527
|
+
const r = { ...runs[0], handle: s.handle };
|
|
528
|
+
word = busy ? "Working" : "Waiting to start";
|
|
529
|
+
line = busy
|
|
530
|
+
? `${whatRun(r)} · ${minutes(r.createdAt)} so far`
|
|
531
|
+
: `${whatRun(r)} · queued ${minutes(r.createdAt)} ago`;
|
|
532
|
+
} else if (failed) {
|
|
533
|
+
word = "Free";
|
|
534
|
+
line = `Their last session stopped with a problem, ${ago(last.updatedAt)}`;
|
|
338
535
|
} else if (last) {
|
|
339
|
-
|
|
340
|
-
el("div", { textContent: `${cap(whatRun(last))}, ${outcome(last)} ${ago(last.updatedAt)}` }),
|
|
341
|
-
);
|
|
342
|
-
log = last.url;
|
|
343
|
-
} else {
|
|
344
|
-
what.append(el("div", { textContent: "No runs in the last few hours." }));
|
|
536
|
+
line = `Last finished ${ago(last.updatedAt)}`;
|
|
345
537
|
}
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
538
|
+
/* Somebody who cannot run yet looked exactly like somebody free. A run in progress, the
|
|
539
|
+
first one included, still says what it is doing. */
|
|
540
|
+
const left = S.readiness?.[s.handle] ?? [];
|
|
541
|
+
const unready = left.length > 0 && !busy && !queued;
|
|
542
|
+
if (unready) {
|
|
543
|
+
// The card is narrow; the steps themselves are in the panel under it.
|
|
544
|
+
word = "Not set up yet";
|
|
545
|
+
line = left.length === 1 ? "One step left: " + left[0] : `${left.length} steps left, below`;
|
|
546
|
+
}
|
|
547
|
+
// A run takes about a minute to start, and until then the card would say nothing happened.
|
|
548
|
+
if (!busy && !queued && Date.now() - (askedAt[s.handle] ?? 0) < 120_000) {
|
|
549
|
+
line = "Sent. Starts in about a minute";
|
|
353
550
|
}
|
|
354
551
|
|
|
355
|
-
const
|
|
356
|
-
|
|
357
|
-
|
|
552
|
+
const issue = (busy || queued) && runs[0].issue && s.brain ? runs[0].issue : null;
|
|
553
|
+
const card = el("div", {
|
|
554
|
+
className: "orbcard " + state + (issue ? " homeclick" : ""),
|
|
555
|
+
...(issue ? { tabIndex: 0, role: "button", title: `Open #${issue}` } : {}),
|
|
358
556
|
});
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
557
|
+
card.style?.setProperty?.("--hue", HUES[i % HUES.length]);
|
|
558
|
+
const orb = el("div", { className: "orb", ariaHidden: "true" }, [
|
|
559
|
+
el("span", { className: "orbglow" }),
|
|
560
|
+
el("span", { className: "orbbody" }, [el("span", { className: "orbswirl" })]),
|
|
561
|
+
el("span", { className: "orbicon" }, [icon(staffIcon(s), "ic")]),
|
|
562
|
+
]);
|
|
563
|
+
card.append(
|
|
564
|
+
orb,
|
|
565
|
+
el("b", { className: "orbname", textContent: s.name }),
|
|
566
|
+
el("span", { className: "orbstate", textContent: word }),
|
|
567
|
+
el("span", { className: "orbline", textContent: line }),
|
|
568
|
+
);
|
|
569
|
+
const log = runs[0]?.url ?? last?.url;
|
|
570
|
+
if (log && state !== "idle") {
|
|
571
|
+
card.append(
|
|
572
|
+
el("a", { className: "orblog", href: log, target: "_blank", rel: "noopener", textContent: "View log" }),
|
|
363
573
|
);
|
|
364
574
|
}
|
|
575
|
+
// Asking wakes them, which proves nothing until the rest is done. A first run is fine.
|
|
576
|
+
if (s.brain && !(unready && left.some((x) => x !== "run once"))) {
|
|
577
|
+
const ask = el("button", { className: "ghbtn orbask", textContent: "Ask a question" });
|
|
578
|
+
ask.onclick = () => askStaff(s);
|
|
579
|
+
card.append(el("span", { className: "orbgap" }), ask);
|
|
580
|
+
}
|
|
581
|
+
if (issue) {
|
|
582
|
+
const open = () => openThread({ repo: s.brain, number: issue, kind: "issue" });
|
|
583
|
+
card.onclick = (ev) => {
|
|
584
|
+
if (!ev.target.closest("a, button")) open();
|
|
585
|
+
};
|
|
586
|
+
card.onkeydown = (ev) => {
|
|
587
|
+
if (ev.target === card && (ev.key === "Enter" || ev.key === " ")) {
|
|
588
|
+
ev.preventDefault();
|
|
589
|
+
open();
|
|
590
|
+
}
|
|
591
|
+
};
|
|
592
|
+
}
|
|
593
|
+
box.append(card);
|
|
594
|
+
});
|
|
595
|
+
return box;
|
|
596
|
+
}
|
|
365
597
|
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
598
|
+
/* ------------------------------- setup left ----------------------------- */
|
|
599
|
+
|
|
600
|
+
let readinessAsked = false;
|
|
601
|
+
|
|
602
|
+
/**
|
|
603
|
+
* What is left of setting up, at the top of Home. Home said a staff member who could not run
|
|
604
|
+
* was "Free" with a button to ask them something, and nothing on it said setup was unfinished.
|
|
605
|
+
* Hosted, the steps are commands, since that is the only place they can be done.
|
|
606
|
+
*/
|
|
607
|
+
function setupLeft(staff) {
|
|
608
|
+
if (staff.some((s) => !S.readiness?.[s.handle]) && !readinessAsked) {
|
|
609
|
+
readinessAsked = true;
|
|
610
|
+
checkAll(() => {
|
|
611
|
+
readinessAsked = false;
|
|
612
|
+
if (S.view === "home") render();
|
|
613
|
+
});
|
|
614
|
+
}
|
|
615
|
+
const steps = [];
|
|
616
|
+
for (const id of S.data?.unfinished ?? []) if (ORG_STEPS[id]) steps.push(ORG_STEPS[id]);
|
|
617
|
+
for (const s of notReady()) {
|
|
618
|
+
for (const what of S.readiness[s.handle]) {
|
|
619
|
+
steps.push([`${s.name}: ${what}`, stepCommand(what, s.handle)]);
|
|
620
|
+
}
|
|
621
|
+
}
|
|
622
|
+
if (!steps.length) return null;
|
|
623
|
+
|
|
624
|
+
const box = el("div", { className: "card homesetup" });
|
|
625
|
+
box.append(
|
|
626
|
+
el("b", { textContent: "Setup is not finished" }),
|
|
627
|
+
el("p", {
|
|
628
|
+
className: "sub",
|
|
629
|
+
textContent: S.hosted
|
|
630
|
+
? "Nobody runs until these are done. They need your own machine: run each in your workspace, in order."
|
|
631
|
+
: "Nobody runs until these are done.",
|
|
632
|
+
}),
|
|
633
|
+
);
|
|
634
|
+
const seen = new Set();
|
|
635
|
+
const list = el("ol", { className: "homesetupsteps" });
|
|
636
|
+
for (const [what, cmd] of steps) {
|
|
637
|
+
// The credential is the org's, so two staff members missing it is one step.
|
|
638
|
+
if (cmd && seen.has(cmd)) continue;
|
|
639
|
+
seen.add(cmd);
|
|
640
|
+
const row = el("li", {}, [el("span", { textContent: cap(what) })]);
|
|
641
|
+
if (S.hosted && cmd) row.append(commandLine(cmd));
|
|
642
|
+
list.append(row);
|
|
643
|
+
}
|
|
644
|
+
box.append(list);
|
|
645
|
+
if (!S.hosted) {
|
|
646
|
+
const cont = el("button", { className: "btn primary", textContent: "Continue setting up" });
|
|
647
|
+
cont.onclick = () => go({ view: "setup" });
|
|
648
|
+
box.append(el("div", { className: "row" }, [cont]));
|
|
374
649
|
}
|
|
375
650
|
return box;
|
|
376
651
|
}
|
|
@@ -423,7 +698,7 @@ function poll() {
|
|
|
423
698
|
|
|
424
699
|
/* ------------------------------ your requests ---------------------------- */
|
|
425
700
|
|
|
426
|
-
/** A card of rows
|
|
701
|
+
/** A card of rows. */
|
|
427
702
|
function listBox(rows) {
|
|
428
703
|
return el("div", { className: "card homeworking" }, rows);
|
|
429
704
|
}
|
|
@@ -437,10 +712,14 @@ function listRow(e, { chip, tone = "", sub, action = null }) {
|
|
|
437
712
|
"div",
|
|
438
713
|
{ className: "homeline homeclick" + (e.item.unread ? " unread" : ""), tabIndex: 0, role: "button" },
|
|
439
714
|
[
|
|
440
|
-
|
|
715
|
+
// The same row as Needs you: an unread dot, the title, and what it is in the line under it.
|
|
716
|
+
el("span", { className: "homedot", ariaHidden: "true" }),
|
|
441
717
|
el("div", { className: "homerunwhat" }, [
|
|
442
718
|
el("div", { className: "homerowtitle", textContent: e.item.title }),
|
|
443
|
-
el("div", { className: "homerunsub"
|
|
719
|
+
el("div", { className: "homerunsub" }, [
|
|
720
|
+
el("span", { className: "homekind " + tone, textContent: chip }),
|
|
721
|
+
document.createTextNode(` · ${whereOf(e)} · ${sub}`),
|
|
722
|
+
]),
|
|
444
723
|
]),
|
|
445
724
|
el("div", { className: "homerunlog" }, action ? [action] : []),
|
|
446
725
|
],
|