@nanocollective/roster 0.1.0-beta.10 → 0.1.0-beta.11

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/dist/cli.js CHANGED
@@ -7059,6 +7059,9 @@ async function query(gh, owner, name) {
7059
7059
  if (!res.ok) throw new Error(res.error);
7060
7060
  return res.data?.repository;
7061
7061
  }
7062
+ function isStatus(n) {
7063
+ return (n.labels?.nodes ?? []).some((l) => l?.name === "status" || l?.name === "keep-open");
7064
+ }
7062
7065
  function shape(n, repo, role, kind) {
7063
7066
  const events = (n.timelineItems?.nodes ?? []).map((e) => event(e)).filter(Boolean);
7064
7067
  return {
@@ -7068,8 +7071,9 @@ function shape(n, repo, role, kind) {
7068
7071
  number: n.number,
7069
7072
  title: n.title ?? "",
7070
7073
  // The list carries the body only to find a decision's default; a row never shows it, and
7071
- // a thread that is opened is read whole on its own.
7072
- body: n.timelineItems ? n.body ?? "" : "",
7074
+ // a thread that is opened is read whole on its own. A status issue's body is the exception:
7075
+ // it is the staff member's report, and Home shows it.
7076
+ body: n.timelineItems || isStatus(n) ? n.body ?? "" : "",
7073
7077
  ...extras(n),
7074
7078
  labels: (n.labels?.nodes ?? []).map((l) => l.name),
7075
7079
  assignees: (n.assignees?.nodes ?? []).map((a) => a.login),
@@ -20,17 +20,6 @@ const CHORE_WORDS = ["setup", "submit", "data", "blocked"];
20
20
 
21
21
  const lower = (s) => String(s ?? "").toLowerCase();
22
22
 
23
- /** How old a run report can be and still be this morning's. */
24
- const REPORT_HOURS = 20;
25
-
26
- /** A run report as lines, without the @mention it opens with. */
27
- function reportLines(body) {
28
- return String(body ?? "")
29
- .split("\n")
30
- .map((l) => l.replace(/^\s*(@[\w-]+\s*)+/, "").replace(/^[-*]\s+/, "").trim())
31
- .filter(Boolean)
32
- .slice(0, 5);
33
- }
34
23
 
35
24
  /**
36
25
  * @param items the inbox list: open and recently closed issues and pull requests
@@ -76,16 +65,10 @@ export function sortHome(items, staff, humans, live = [], now = new Date()) {
76
65
  continue;
77
66
  }
78
67
 
79
- // The run report: the last word on a status issue, from the staff member, in the last day.
80
- const c = item.lastComment;
81
- if (
82
- owner &&
83
- item.number === owner.statusIssue &&
84
- c &&
85
- !people.has(lower(c.author)) &&
86
- now - new Date(c.createdAt) < REPORT_HOURS * 3_600_000
87
- ) {
88
- out.reports.push({ staff: owner, item, at: c.createdAt, lines: reportLines(c.body) });
68
+ /* The report: the body of a staff member's status issue, which every run rewrites. Not its
69
+ comments, which used to be the reports and grew into a thread nobody wanted to scroll. */
70
+ if (owner && item.number === owner.statusIssue && String(item.body ?? "").trim()) {
71
+ out.reports.push({ staff: owner, item, at: item.updatedAt, body: String(item.body).trim() });
89
72
  }
90
73
 
91
74
  const place = placeOf(item, owner, people, markers);
@@ -94,9 +94,9 @@ export function viewHome(m) {
94
94
  /* ------------------------------- reports -------------------------------- */
95
95
 
96
96
  /**
97
- * One staff member's last report, or a line saying there is none today, with a button that asks
98
- * for one. The report is markdown the staff member wrote, with links to the work it names. The
99
- * whole row opens their status issue, where it was posted; a link inside it goes where it points.
97
+ * One staff member's report: the body of their status issue, which every run rewrites, with a
98
+ * button that asks them to bring it up to date now. It is markdown they wrote, with links to the
99
+ * work it names. The whole row opens the issue; a link inside it goes where it points.
100
100
  */
101
101
  function reportRow(s, reports) {
102
102
  const r = reports.find((x) => x.staff.handle === s.handle);
@@ -115,7 +115,7 @@ function reportRow(s, reports) {
115
115
  body: `${s.mention ?? "@" + s.handle} Report, please.`,
116
116
  });
117
117
  ask.remove();
118
- note.textContent = `Asked. ${s.name} replies in a few minutes.`;
118
+ note.textContent = `Asked. ${s.name} updates it in a few minutes.`;
119
119
  refreshSoon();
120
120
  } catch (e) {
121
121
  note.textContent = String(e.message || e);
@@ -127,11 +127,11 @@ function reportRow(s, reports) {
127
127
  const row = el("div", { className: "homereport homeclick", tabIndex: 0, role: "button" }, [
128
128
  el("div", { className: "homereportwho" }, [
129
129
  el("span", { className: "homewho2" }, [icon(staffIcon(s), "ic"), el("b", { textContent: s.name })]),
130
- el("span", { className: "meta", textContent: r ? ago(r.at) : "No report today" }),
130
+ el("span", { className: "meta", textContent: r ? "Updated " + ago(r.at) : "No report yet" }),
131
131
  el("div", { className: "homereportask" }, [ask, note]),
132
132
  ]),
133
133
  r
134
- ? el("div", { className: "md homereportbody", innerHTML: mdlite(r.lines.join("\n\n"), { repo: s.brain }) })
134
+ ? el("div", { className: "md homereportbody", innerHTML: mdlite(r.body, { repo: s.brain }) })
135
135
  : el("div"),
136
136
  ]);
137
137
  row.onclick = (ev) => {