@nanocollective/roster 0.1.0-beta.15 → 0.1.0-beta.17
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/{agents-NMGVORU3.js → agents-Q2DSTLOQ.js} +1 -1
- package/dist/{chunk-E3EVPK4I.js → chunk-JH3LQ34C.js} +16 -1
- package/dist/{chunk-QCKEGMXD.js → chunk-UEZPQ5PV.js} +2 -2
- package/dist/cli.js +64 -21
- package/dist/{compose-56JIIIHA.js → compose-H43W3QI5.js} +3 -1
- package/dist/{connectors-ZVEPXSAR.js → connectors-U5VT5W2I.js} +1 -1
- package/dist/worker/assets/assets/css/base.css +4 -0
- package/dist/worker/assets/assets/css/home.css +98 -34
- package/dist/worker/assets/assets/css/inbox.css +11 -0
- package/dist/worker/assets/assets/js/app.js +1 -0
- package/dist/worker/assets/assets/js/homesort.js +20 -0
- package/dist/worker/assets/assets/js/md.js +7 -2
- package/dist/worker/assets/assets/js/refresh.js +4 -2
- package/dist/worker/assets/assets/js/report.js +51 -0
- package/dist/worker/assets/assets/js/state.js +2 -0
- package/dist/worker/assets/assets/js/views/home.js +272 -119
- package/dist/worker/assets/assets/js/views/inbox.js +52 -11
- package/dist/worker/index.js +58 -8
- package/docs/hosting.md +2 -1
- package/docs/org-yaml.md +15 -0
- package/package.json +1 -1
- package/templates/ops/compose.mjs +20 -0
- package/templates/ops/org/operating.md +10 -0
- package/templates/ops/org/voice.md +19 -1
- package/templates/ops/prompts/daily.md +27 -6
- package/templates/ops/prompts/mention.md +3 -2
- package/templates/portal/css/base.css +4 -0
- package/templates/portal/css/home.css +98 -34
- package/templates/portal/css/inbox.css +11 -0
- package/templates/portal/js/app.js +1 -0
- package/templates/portal/js/homesort.js +20 -0
- package/templates/portal/js/md.js +7 -2
- package/templates/portal/js/refresh.js +4 -2
- package/templates/portal/js/report.js +51 -0
- package/templates/portal/js/state.js +2 -0
- package/templates/portal/js/views/home.js +272 -119
- package/templates/portal/js/views/inbox.js +52 -11
package/docs/hosting.md
CHANGED
|
@@ -136,7 +136,8 @@ setup. To keep it everywhere rather than per data centre, bind a KV namespace as
|
|
|
136
136
|
|
|
137
137
|
A [connector](connectors.md) that signs in with a browser, like Notion, keeps its sign-in on the
|
|
138
138
|
hosted portal, which needs somewhere durable to keep it: a KV namespace bound as `CONNECTORS`.
|
|
139
|
-
`roster portal deploy`
|
|
139
|
+
`roster portal deploy` finds one by name, or creates it, on any deploy that does not have it
|
|
140
|
+
bound yet, the morning one included; a deploy by hand also writes it into
|
|
140
141
|
`portal/wrangler.jsonc`. Without it, connectors that take a key still work, and the ones that
|
|
141
142
|
sign in are not offered.
|
|
142
143
|
|
package/docs/org-yaml.md
CHANGED
|
@@ -104,6 +104,7 @@ humans:
|
|
|
104
104
|
| `name` | no | What to call them in prose. Defaults to the login. |
|
|
105
105
|
| `marker` | no | Provenance tag on a fact they ruled on, as in `[will]`. Also used as a label. Defaults to the first part of the name, lowercased. |
|
|
106
106
|
| `role` | no | Prose only. |
|
|
107
|
+
| `handles` | no | What they look after, as `[marketing, content]`. Staff send each ask to the person whose area it is. See below. |
|
|
107
108
|
| `view_only` | no | `true` for somebody who should see how the org runs and nothing more. See below. |
|
|
108
109
|
|
|
109
110
|
Both keys are read, and the singular is not deprecated: an org with one human should keep
|
|
@@ -116,6 +117,20 @@ here"), and a list of two cannot go in that sentence, so the first one goes ther
|
|
|
116
117
|
`{{humans_extra}}` in the identity fragment. Everything that *gates* on identity reads all of
|
|
117
118
|
them: the mention caller's `if:` is `contains(fromJSON('["will-lamerton","sam-x"]'), …)`.
|
|
118
119
|
|
|
120
|
+
**Who handles what.** With more than one person, give each a `handles` list:
|
|
121
|
+
|
|
122
|
+
```yaml
|
|
123
|
+
humans:
|
|
124
|
+
- { name: Will, github: will-lamerton, marker: will, handles: [technical work, the product, deploys] }
|
|
125
|
+
- { name: Ben, github: ben-x, marker: ben, handles: [marketing, content, social] }
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
The staff are told who looks after what, and send each ask (an issue with a person's label, or
|
|
129
|
+
a pull request) to that one person: their label, assigned to them. On Home, **Needs you** then
|
|
130
|
+
shows the signed-in person what is on them, plus anything on nobody in particular, with a
|
|
131
|
+
**Yours / Everyone's** switch beside the heading. Something that fits nobody's area goes to the
|
|
132
|
+
first person.
|
|
133
|
+
|
|
119
134
|
**View-only.** `{ name: Ben, github: ben-x, view_only: true }` signs in to the portal and the
|
|
120
135
|
Claude connector like anyone in the list, and reads everything there. They are not in the mention
|
|
121
136
|
gate, so an `@cto` from them wakes nobody, and the portal refuses to post one rather than leave
|
package/package.json
CHANGED
|
@@ -265,12 +265,30 @@ export function readHumans(org) {
|
|
|
265
265
|
name: name || github,
|
|
266
266
|
marker: String(entry.marker ?? "").trim() || defaultMarker(name || github),
|
|
267
267
|
role: entry.role ?? undefined,
|
|
268
|
+
...(handlesOf(entry.handles).length ? { handles: handlesOf(entry.handles) } : {}),
|
|
268
269
|
...(entry.view_only === true ? { viewOnly: true } : {}),
|
|
269
270
|
});
|
|
270
271
|
}
|
|
271
272
|
return out;
|
|
272
273
|
}
|
|
273
274
|
|
|
275
|
+
/** `handles: [marketing, content]`, or one string, as a list of what that person looks after. */
|
|
276
|
+
function handlesOf(v) {
|
|
277
|
+
const list = Array.isArray(v) ? v : v ? String(v).split(",") : [];
|
|
278
|
+
return list.map((x) => String(x ?? "").trim()).filter(Boolean);
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
/** Who looks after what, one line each, for when there is more than one person to ask. */
|
|
282
|
+
export function handlesList(humans) {
|
|
283
|
+
if (humans.length < 2 || !humans.some((h) => h.handles?.length)) return "";
|
|
284
|
+
return humans
|
|
285
|
+
.map((h) => {
|
|
286
|
+
const who = `- **${h.name}**${h.github ? ` (@${h.github}, label \`${h.marker}\`)` : ""}`;
|
|
287
|
+
return h.handles?.length ? `${who}: ${h.handles.join(", ")}` : `${who}: anything else`;
|
|
288
|
+
})
|
|
289
|
+
.join("\n");
|
|
290
|
+
}
|
|
291
|
+
|
|
274
292
|
/** "Will (@will-lamerton) and Sam (@sam)", for a sentence in a prompt. */
|
|
275
293
|
export function humanSentence(humans) {
|
|
276
294
|
const parts = humans.map((h) => (h.github ? `${h.name} (@${h.github})` : h.name));
|
|
@@ -389,6 +407,8 @@ export function compose({
|
|
|
389
407
|
human_list: humanSentence(humans),
|
|
390
408
|
inflight,
|
|
391
409
|
humans_extra: humanSentence(humans.slice(1)),
|
|
410
|
+
// Who looks after what, when an org has said. Empty for one person, and the rule goes.
|
|
411
|
+
humans_handles: handlesList(humans),
|
|
392
412
|
// Who can read along and cannot rule. Empty, and the paragraph gone, when nobody is.
|
|
393
413
|
humans_viewing: humanSentence(everyone.filter((h) => h.viewOnly)),
|
|
394
414
|
// The services this staff member may use, as a list for the prompt. Empty, and the section
|
|
@@ -45,6 +45,16 @@ question instead of doing work has wasted its slot.
|
|
|
45
45
|
- `decision`: they rule on something. Carries the default and date above.
|
|
46
46
|
- `review`: they read or approve something you made.
|
|
47
47
|
- `chore`: something only they can do, such as a setting, an account or a key.
|
|
48
|
+
{{#if humans_handles}}
|
|
49
|
+
- **Send each ask to the one person whose area it is**, not to {{human.name}} by default. It
|
|
50
|
+
carries their label and is assigned to them, and the same goes for a pull request: assign the
|
|
51
|
+
person who should look at it (`gh pr create --assignee <login>`). Each of them is shown only
|
|
52
|
+
what is theirs, so an ask sent to the wrong person is not seen. Who looks after what:
|
|
53
|
+
|
|
54
|
+
{{humans_handles}}
|
|
55
|
+
|
|
56
|
+
Something that fits nobody's area goes to {{human.name}}.
|
|
57
|
+
{{/if}}
|
|
48
58
|
- **Ideas live in your brain, not on the tracker.** Park a speculative idea as one line in
|
|
49
59
|
`strategy/ideas.md`. Open an `IDEA:` issue only when it needs a ruling, and never more than one
|
|
50
60
|
at a time.
|
|
@@ -12,6 +12,24 @@ bodies, your status report, briefs to other staff, and how you talk to them in a
|
|
|
12
12
|
- **An issue title is the ask, not the topic.**
|
|
13
13
|
- **Say the default** on anything needing a ruling: what you do if they say nothing.
|
|
14
14
|
|
|
15
|
+
**Plain English, whatever your job.** Write for a smart person who is not technical, and that
|
|
16
|
+
includes the CTO. Say what happened and what it means, the way you would tell a colleague in a
|
|
17
|
+
corridor:
|
|
18
|
+
|
|
19
|
+
- **Say what changed for people, not how.** "Sign-up works on phones again", not "fixed the
|
|
20
|
+
viewport meta in `layout.tsx`". "The site is down for some visitors", not "500s on the edge
|
|
21
|
+
worker".
|
|
22
|
+
- **No code, file paths, commit hashes, branch names, function names or command lines** in
|
|
23
|
+
reports, comments and issues a person reads. They belong in the pull request's diff, your brain
|
|
24
|
+
and your commit messages.
|
|
25
|
+
- **Translate the jargon.** "Put it live", not "deploy to prod". "The automatic checks failed",
|
|
26
|
+
not "CI is red". "A change for you to approve", not "PR against main". If a technical word has no
|
|
27
|
+
plain version, explain it in five words the first time.
|
|
28
|
+
- **Ask for what you need in their terms.** "Press Merge on #42 to put the new pricing page
|
|
29
|
+
live" beats a list of steps. When a person really has to run something by hand, say what it
|
|
30
|
+
does first in a plain sentence, then give the exact steps in the issue, and send it to the
|
|
31
|
+
person who can do it.
|
|
32
|
+
|
|
15
33
|
**Length ceilings.** Lead with the outcome or the ask, then stop at:
|
|
16
34
|
|
|
17
35
|
- **A comment or reply: 100 words.** Most need three lines.
|
|
@@ -44,6 +62,6 @@ and mirrored clauses, every sentence landing a beat, em-dash rhythm chains, inte
|
|
|
44
62
|
("genuinely", "actually", "literally" as seasoning - one per piece, maximum). **Leave some sentences
|
|
45
63
|
flat and functional; humans do.**
|
|
46
64
|
|
|
47
|
-
**Concise is not vague.** Name the
|
|
65
|
+
**Concise is not vague.** Name the number, the date, the page, the person, the issue.
|
|
48
66
|
|
|
49
67
|
Direct, opinionated, no flattery. If something is a bad idea, say so and why, in a sentence.
|
|
@@ -72,14 +72,35 @@ writing a plan for {{human.name}} to approve.
|
|
|
72
72
|
what the next run picks up in priority order, and anything parked. Commands and notes to
|
|
73
73
|
yourself go here. Rewrite it, do not append, and cut anything the next run can find for itself.
|
|
74
74
|
**Then rewrite the body of #{{staff.status_issue}}. It is your report**, the one place
|
|
75
|
-
{{human.name}} reads where things are, so it is for them, not for you.
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
75
|
+
{{human.name}} reads where things are, so it is for them, not for you. The portal shows it as a
|
|
76
|
+
card, so keep exactly this shape and these headings:
|
|
77
|
+
|
|
78
|
+
```
|
|
79
|
+
Updated <date> <HH:MM> UTC.
|
|
80
|
+
|
|
81
|
+
**Status: on track.** <one plain sentence on how things are going>
|
|
82
|
+
|
|
83
|
+
## Done
|
|
84
|
+
- <what got finished since the last report, as what changed for people or the business>
|
|
85
|
+
|
|
86
|
+
## Working on
|
|
87
|
+
- <each priority: where it stands, with the numbers>
|
|
88
|
+
|
|
89
|
+
## Needs you
|
|
90
|
+
- <what is waiting on a person, oldest first, by issue number{{#if humans_handles}}, naming who it is for{{/if}}>
|
|
91
|
+
|
|
92
|
+
## Next
|
|
93
|
+
- <what you do next>
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
The status is one of `on track`, `needs you` (something is waiting on a person) or `stuck`
|
|
97
|
+
(you cannot move a priority). An empty section says `- Nothing.` Say what changed for people,
|
|
98
|
+
not "opened a PR". Nothing they need to scroll past, and no notes to yourself. **Never comment
|
|
99
|
+
on it**: they want one report, not a thread to scroll.
|
|
80
100
|
3. **Reconcile the tracker.** Open issues for anything new needing {{human.name}}: the
|
|
81
101
|
`{{human.marker}}` label plus one of `decision`, `review` or `chore`, assigned to
|
|
82
|
-
`{{human.github}}`.
|
|
102
|
+
`{{human.github}}`.{{#if humans_handles}} An ask in someone else's area goes to them instead,
|
|
103
|
+
with their label.{{/if}} Sweep **every** open issue on your tracker, whoever opened it: close what is
|
|
83
104
|
done, superseded or needs nothing, citing what closed it. A `decision` whose date has passed with
|
|
84
105
|
no answer: act on the default and close it. **Comments and replies get the same concision as
|
|
85
106
|
everything else:** what changed and what it means for them. A comment that only says an issue is still open
|
|
@@ -56,8 +56,9 @@ An issue opened this way often carries a pull request somewhere else, and says w
|
|
|
56
56
|
unreviewable and costs a second review. If you spot something real and separate, say so in your
|
|
57
57
|
reply and leave it alone.
|
|
58
58
|
- **Asked for a report?** Read `{{staff.dir}}/STATE.md` and your open issues, then bring the
|
|
59
|
-
body of #{{staff.status_issue}} up to date: it is the report, in the shape it always has
|
|
60
|
-
|
|
59
|
+
body of #{{staff.status_issue}} up to date: it is the report, in the shape it always has
|
|
60
|
+
(`Updated <date> <HH:MM> UTC.`, the `**Status: …**` line, then `## Done`, `## Working on`,
|
|
61
|
+
`## Needs you` and `## Next`). Reply with one line, `Updated: <link to the issue>`, and
|
|
61
62
|
nothing else. Change nothing else.
|
|
62
63
|
- **Only touch `memory/INDEX.md` if a durable fact or watch-out changed**, and then it is one line
|
|
63
64
|
saying what it changes. Commit and push it.
|
|
@@ -133,6 +133,10 @@ button.ghbtn:hover{background:color-mix(in srgb,var(--surface-2) 88%,var(--ink)
|
|
|
133
133
|
.ghbtn.primary{background:var(--accent);border-color:transparent;color:var(--accent-ink);font-weight:600}
|
|
134
134
|
.ghbtn.primary:hover{background:var(--accent);color:var(--accent-ink);opacity:.88}
|
|
135
135
|
.ghbtn:disabled{opacity:.45;cursor:default}
|
|
136
|
+
/* Something that ends a thing: light red, so it is never mistaken for the way forward. */
|
|
137
|
+
.ghbtn.danger{color:var(--err);background:color-mix(in srgb,var(--err) 10%,transparent);
|
|
138
|
+
border-color:color-mix(in srgb,var(--err) 28%,transparent)}
|
|
139
|
+
button.ghbtn.danger:hover{color:var(--err);background:color-mix(in srgb,var(--err) 17%,transparent)}
|
|
136
140
|
.iconbtn{background:var(--surface-2);border:1px solid transparent;color:var(--ink-dim);
|
|
137
141
|
border-radius:8px;width:34px;height:34px;cursor:pointer;font-size:15px;line-height:1;
|
|
138
142
|
transition:background .15s var(--ease),color .15s var(--ease)}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* Home: what needs you,
|
|
1
|
+
/* Home: who is working, what needs you, progress, your requests, closed today. */
|
|
2
2
|
|
|
3
3
|
.home{max-width:820px;margin-top:22px}
|
|
4
4
|
/* The placeholder lines up with the title, as the cards that replace it do. */
|
|
@@ -11,7 +11,10 @@
|
|
|
11
11
|
.home h2 .pill{font-size:10.5px}
|
|
12
12
|
.homeempty{color:var(--ink-faint);font-size:13px;margin:0 0 8px}
|
|
13
13
|
|
|
14
|
-
.homeaskcard{display:flex;flex-direction:column;gap:10px}
|
|
14
|
+
.homeaskcard{display:flex;flex-direction:column;gap:10px;margin-top:14px}
|
|
15
|
+
.home .homeasktitle{margin:0;font:600 15px var(--sans);color:var(--ink);letter-spacing:-.01em}
|
|
16
|
+
.homeaskto{gap:8px}
|
|
17
|
+
.homeaskto label{font:500 12.5px var(--sans);color:var(--ink-dim)}
|
|
15
18
|
.homeask,.homeanswer{width:100%;box-sizing:border-box;resize:vertical;min-height:44px;
|
|
16
19
|
font:13px/1.45 var(--sans);color:var(--ink);background:var(--surface-2);
|
|
17
20
|
border:1px solid transparent;border-radius:8px;padding:8px 10px}
|
|
@@ -51,25 +54,12 @@
|
|
|
51
54
|
}
|
|
52
55
|
|
|
53
56
|
.homeworking{display:flex;flex-direction:column;padding:4px 16px}
|
|
54
|
-
.homerun{display:grid;grid-template-columns:minmax(150px,220px) auto 1fr auto;align-items:center;
|
|
55
|
-
gap:12px;padding:12px 0;font-size:13.5px}
|
|
56
|
-
.homerun + .homerun{border-top:1px solid var(--line)}
|
|
57
|
-
.homewho2{display:inline-flex;align-items:center;gap:8px;min-width:0}
|
|
58
|
-
.homewho2 b{font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
|
|
59
|
-
.homewho2 .ic{--ic:15px;color:var(--ink-dim);flex:none}
|
|
60
|
-
.homestate{justify-self:start}
|
|
61
|
-
.homestate.ok::before{content:"";width:6px;height:6px;border-radius:50%;background:currentColor;
|
|
62
|
-
margin-right:6px;animation:homepulse 1.6s var(--ease) infinite}
|
|
63
|
-
@keyframes homepulse{50%{opacity:.3}}
|
|
64
|
-
@media (prefers-reduced-motion:reduce){.homestate.ok::before{animation:none}}
|
|
65
57
|
.homerunwhat{color:var(--ink);line-height:1.45;min-width:0}
|
|
66
58
|
.homerunsub{color:var(--ink-dim);font-size:12.5px;margin-top:2px}
|
|
67
59
|
.homerunlog .ghbtn{min-height:28px;padding:3px 12px}
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
.homerun .homerunwhat{grid-area:what}.homerun .homerunlog{grid-area:log}
|
|
72
|
-
}
|
|
60
|
+
.homewho2{display:inline-flex;align-items:center;gap:8px;min-width:0}
|
|
61
|
+
.homewho2 b{font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
|
|
62
|
+
.homewho2 .ic{--ic:15px;color:var(--ink-dim);flex:none}
|
|
73
63
|
|
|
74
64
|
.homerest{margin-top:26px}
|
|
75
65
|
.homeneed.gone,.homeline.gone{opacity:0;transform:translateX(12px);
|
|
@@ -81,26 +71,100 @@
|
|
|
81
71
|
.unread .homeopen,.unread .homerowtitle{font-weight:700}
|
|
82
72
|
|
|
83
73
|
|
|
84
|
-
|
|
85
|
-
.
|
|
86
|
-
|
|
87
|
-
.
|
|
88
|
-
.
|
|
89
|
-
.
|
|
90
|
-
.
|
|
91
|
-
.
|
|
92
|
-
.
|
|
93
|
-
|
|
94
|
-
.
|
|
74
|
+
/* Progress: a card per staff member. Status and one line, then Done and Next side by side. */
|
|
75
|
+
.homereports{display:flex;flex-direction:column;gap:12px}
|
|
76
|
+
.homereport{display:flex;flex-direction:column;gap:10px;font-size:13px;line-height:1.5}
|
|
77
|
+
.homereporthead{display:flex;align-items:center;flex-wrap:wrap;gap:8px 10px}
|
|
78
|
+
.homereportstatus{font-weight:600}
|
|
79
|
+
.homereportstatus.ok{color:var(--accent);background:var(--accent-soft)}
|
|
80
|
+
.homereportwhen{margin-left:auto}
|
|
81
|
+
.homereportline{font-size:14px;color:var(--ink)}
|
|
82
|
+
.homereportline p{margin:0}
|
|
83
|
+
.homereportcols{display:grid;grid-template-columns:1fr 1fr;gap:6px 22px}
|
|
84
|
+
.homereportcol h3{margin:0 0 4px;font:600 11.5px var(--sans);color:var(--ink-dim);
|
|
85
|
+
text-transform:uppercase;letter-spacing:.04em}
|
|
86
|
+
.homereportcol ul{margin:0;padding-left:18px}
|
|
87
|
+
.homereportcol li{margin:0 0 3px;color:var(--ink)}
|
|
88
|
+
.homereportcol li p{margin:0}
|
|
89
|
+
.homereportcol .meta{margin:2px 0 0}
|
|
90
|
+
.homereportneeds{margin:0;font-size:12.5px;color:var(--warn)}
|
|
91
|
+
.homereportbody{min-width:0}
|
|
92
|
+
.homereportbody.fade{max-height:6em;overflow:hidden;
|
|
95
93
|
-webkit-mask-image:linear-gradient(#000 55%,transparent);mask-image:linear-gradient(#000 55%,transparent)}
|
|
96
|
-
.
|
|
94
|
+
.homereportbody p{margin:0 0 6px}
|
|
95
|
+
.homereportbody a,.homereportcol a,.homereportline a{color:var(--accent)}
|
|
97
96
|
.homereportissue{border:0;background:none;padding:0;font:inherit;color:var(--accent);cursor:pointer}
|
|
98
97
|
.homereportissue:hover{text-decoration:underline}
|
|
99
|
-
.
|
|
100
|
-
.
|
|
101
|
-
|
|
102
|
-
|
|
98
|
+
.homereportacts{gap:8px}
|
|
99
|
+
.homereportacts .ghbtn{min-height:28px;padding:3px 12px;font-size:12.5px}
|
|
100
|
+
@media (max-width:640px){
|
|
101
|
+
.homereportcols{grid-template-columns:1fr}
|
|
102
|
+
.homereportwhen{margin-left:0;flex-basis:100%}
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
/* Yours / Everyone's, beside the Needs you heading. */
|
|
106
|
+
.homescope{display:inline-flex;margin-left:auto;background:var(--surface-2);border-radius:8px;padding:2px}
|
|
107
|
+
.homescope button{border:0;background:none;cursor:pointer;font:500 12px var(--sans);color:var(--ink-dim);
|
|
108
|
+
padding:4px 10px;border-radius:6px}
|
|
109
|
+
.homescope button.on{background:var(--panel);color:var(--ink);box-shadow:var(--shadow-sm)}
|
|
110
|
+
.homefor{color:var(--blue);font-weight:600}
|
|
111
|
+
|
|
112
|
+
/* ---------- the team: an orb per staff member ----------
|
|
113
|
+
Lit and moving is somebody at work, still and grey is somebody free. Each has a colour of
|
|
114
|
+
their own, so two at work side by side are told apart. */
|
|
115
|
+
.hometeam{display:grid;grid-template-columns:repeat(auto-fill,minmax(180px,1fr));gap:12px}
|
|
116
|
+
.orbcard{display:flex;flex-direction:column;align-items:center;text-align:center;gap:3px;
|
|
117
|
+
padding:20px 14px 16px;background:var(--panel);border:1px solid var(--line);border-radius:var(--r-lg);
|
|
118
|
+
box-shadow:var(--shadow-sm);transition:border-color .3s var(--ease)}
|
|
119
|
+
.orbcard.busy{border-color:color-mix(in srgb,var(--hue) 40%,var(--line))}
|
|
120
|
+
.orbcard.homeclick{cursor:pointer}
|
|
121
|
+
.orbcard.homeclick:hover .orbname{text-decoration:underline}
|
|
122
|
+
.orbcard:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
|
|
123
|
+
.orb{position:relative;width:76px;height:76px;margin-bottom:10px}
|
|
124
|
+
.orbglow{position:absolute;inset:-16px;border-radius:50%;opacity:0;
|
|
125
|
+
background:radial-gradient(circle,color-mix(in srgb,var(--hue) 55%,transparent) 0,transparent 68%)}
|
|
126
|
+
.orbbody{position:absolute;inset:0;border-radius:50%;overflow:hidden;
|
|
127
|
+
background:radial-gradient(circle at 32% 26%,rgba(255,255,255,.9) 0 5%,
|
|
128
|
+
color-mix(in srgb,var(--hue) 50%,#fff) 16%,var(--hue) 46%,color-mix(in srgb,var(--hue) 50%,#000) 100%);
|
|
129
|
+
box-shadow:inset 0 -8px 16px rgba(0,0,0,.28),0 8px 22px color-mix(in srgb,var(--hue) 30%,transparent);
|
|
130
|
+
transition:filter .5s var(--ease),opacity .5s var(--ease)}
|
|
131
|
+
.orbswirl{position:absolute;inset:-35%;opacity:0;mix-blend-mode:screen;filter:blur(7px);
|
|
132
|
+
background:conic-gradient(from 0deg,transparent 0 12%,rgba(255,255,255,.55) 20%,transparent 32% 58%,
|
|
133
|
+
rgba(255,255,255,.4) 68%,transparent 80%)}
|
|
134
|
+
.orbicon{position:absolute;inset:0;display:grid;place-items:center;color:#fff;
|
|
135
|
+
filter:drop-shadow(0 1px 2px rgba(0,0,0,.35))}
|
|
136
|
+
.orbicon .ic{--ic:24px}
|
|
137
|
+
.orbname{font:600 14px var(--sans);color:var(--ink);letter-spacing:-.01em}
|
|
138
|
+
.orbstate{font:600 12px var(--sans);color:var(--ink-faint)}
|
|
139
|
+
.orbline{font:12.5px/1.45 var(--sans);color:var(--ink-dim);max-width:100%;overflow:hidden;
|
|
140
|
+
display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}
|
|
141
|
+
.orblog{margin-top:6px;font:12px var(--sans);color:var(--ink-faint)}
|
|
142
|
+
.orblog:hover{color:var(--accent)}
|
|
103
143
|
|
|
144
|
+
.orbcard.busy .orbstate{color:color-mix(in srgb,var(--hue) 80%,var(--ink))}
|
|
145
|
+
.orbcard.busy .orbglow{animation:orbbreathe 2.6s ease-in-out infinite}
|
|
146
|
+
.orbcard.busy .orbswirl{opacity:1;animation:orbspin 5s linear infinite}
|
|
147
|
+
.orbcard.busy .orbbody{animation:orbfloat 3.2s ease-in-out infinite}
|
|
148
|
+
.orbcard.queued .orbglow{animation:orbbreathe 1.4s ease-in-out infinite}
|
|
149
|
+
.orbcard.queued .orbswirl{opacity:.6;animation:orbspin 9s linear infinite}
|
|
150
|
+
.orbcard.queued .orbstate{color:var(--warn)}
|
|
151
|
+
/* Free: the same orb, still and drained of colour. */
|
|
152
|
+
.orbcard.idle .orbbody,.orbcard.failed .orbbody,.orbcard.wait .orbbody{filter:saturate(.12) brightness(.95);opacity:.6}
|
|
153
|
+
.orbcard.failed .orb::after{content:"";position:absolute;top:4px;right:4px;width:12px;height:12px;border-radius:50%;
|
|
154
|
+
background:var(--err);box-shadow:0 0 0 3px var(--panel)}
|
|
155
|
+
.orbcard.wait .orbbody{animation:orbbreathe 1.6s ease-in-out infinite}
|
|
156
|
+
@keyframes orbbreathe{0%,100%{opacity:.35;transform:scale(.92)}50%{opacity:1;transform:scale(1.06)}}
|
|
157
|
+
@keyframes orbspin{to{transform:rotate(360deg)}}
|
|
158
|
+
@keyframes orbfloat{0%,100%{transform:translateY(0)}50%{transform:translateY(-3px)}}
|
|
159
|
+
@media (prefers-reduced-motion:reduce){
|
|
160
|
+
.orbcard .orbglow,.orbcard .orbswirl,.orbcard .orbbody{animation:none!important}
|
|
161
|
+
.orbcard.busy .orbglow{opacity:.8}
|
|
162
|
+
}
|
|
163
|
+
@media (max-width:640px){
|
|
164
|
+
.hometeam{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
|
|
165
|
+
.orbcard{padding:16px 10px 12px}
|
|
166
|
+
.orb{width:64px;height:64px}
|
|
167
|
+
}
|
|
104
168
|
|
|
105
169
|
/* Rows in a list card (Unread, Your requests, Closed today) that open a thread. */
|
|
106
170
|
.homeline{display:grid;grid-template-columns:8px minmax(0,1fr) auto;align-items:center;gap:4px 14px;
|
|
@@ -69,6 +69,17 @@
|
|
|
69
69
|
.chead .clogin{font:11.5px var(--mono);color:var(--ink-faint)}
|
|
70
70
|
.chead .cwhen{margin-left:auto;font-size:12px;color:var(--ink-faint);white-space:nowrap}
|
|
71
71
|
.cbodywrap{padding:12px 16px 14px}
|
|
72
|
+
/* The newest message in a thread: what you opened it to read. */
|
|
73
|
+
.cmt.latest{border-color:color-mix(in srgb,var(--blue) 55%,var(--line));
|
|
74
|
+
box-shadow:0 0 0 3px color-mix(in srgb,var(--blue) 12%,transparent)}
|
|
75
|
+
.cmt.latest .chead{background:color-mix(in srgb,var(--blue) 9%,var(--panel-2))}
|
|
76
|
+
.chead .clatest{color:var(--blue);background:color-mix(in srgb,var(--blue) 14%,transparent);
|
|
77
|
+
font:600 10.5px var(--sans);margin-left:2px}
|
|
78
|
+
/* Everything between the newest message and the opening post, folded. */
|
|
79
|
+
.tearlierbtn{display:block;width:100%;margin:6px 0;padding:9px 12px;cursor:pointer;
|
|
80
|
+
font:500 12.5px var(--sans);color:var(--ink-dim);background:var(--panel-2);
|
|
81
|
+
border:1px dashed var(--line);border-radius:var(--r)}
|
|
82
|
+
.tearlierbtn:hover{color:var(--ink);border-color:var(--border-strong)}
|
|
72
83
|
/* The header already draws a line under itself. Whatever the reversed thread puts first must
|
|
73
84
|
not draw a second one right under it. */
|
|
74
85
|
.lead{border-top:0}
|
|
@@ -103,6 +103,7 @@ export async function boot() {
|
|
|
103
103
|
the thing that fixes it. */
|
|
104
104
|
const [first, session] = await Promise.all([loadWithProgress(), getSession()]);
|
|
105
105
|
S.hosted = session?.hosted ? session : null;
|
|
106
|
+
S.me = session?.login || null;
|
|
106
107
|
if (S.hosted) showSignedIn(S.hosted.login);
|
|
107
108
|
if (first && first.mode === "setup") {
|
|
108
109
|
document.body.dataset.setup = "1";
|
|
@@ -80,6 +80,7 @@ export function sortHome(items, staff, humans, live = [], now = new Date()) {
|
|
|
80
80
|
? "answered"
|
|
81
81
|
: "waiting";
|
|
82
82
|
}
|
|
83
|
+
if (place.place === "needs") entry.for = whoFor(item, humans);
|
|
83
84
|
out[place.place].push(entry);
|
|
84
85
|
}
|
|
85
86
|
|
|
@@ -126,6 +127,25 @@ export function placeOf(item, owner, people, markers) {
|
|
|
126
127
|
};
|
|
127
128
|
}
|
|
128
129
|
|
|
130
|
+
/**
|
|
131
|
+
* The people an ask is on, by login: whoever it is assigned to, and whoever's label it carries.
|
|
132
|
+
* Empty means nobody in particular, such as a pull request nobody was asked to look at, and then
|
|
133
|
+
* it is everybody's.
|
|
134
|
+
*/
|
|
135
|
+
export function whoFor(item, humans) {
|
|
136
|
+
const labels = new Set((item.labels ?? []).map(lower));
|
|
137
|
+
const assigned = new Set((item.assignees ?? []).map(lower));
|
|
138
|
+
return humans
|
|
139
|
+
.filter((h) => (h.github && assigned.has(lower(h.github))) || (h.marker && labels.has(lower(h.marker))))
|
|
140
|
+
.map((h) => h.github);
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
/** Whether an ask is for this login: it is on them, or on nobody in particular. */
|
|
144
|
+
export function isFor(entry, login) {
|
|
145
|
+
if (!login || !entry.for?.length) return true;
|
|
146
|
+
return entry.for.some((g) => lower(g) === lower(login));
|
|
147
|
+
}
|
|
148
|
+
|
|
129
149
|
function kindOf(labels) {
|
|
130
150
|
const found = KINDS.find((k) => labels.includes(k));
|
|
131
151
|
if (found) return found;
|
|
@@ -64,8 +64,13 @@ function htmlToMarkdown(html, breakAs, stripUnknown) {
|
|
|
64
64
|
.replace(/<(strong|b)[^>]*>([\s\S]*?)<\/\1>/gi, (_m, _t, x) => "**" + x.trim() + "**")
|
|
65
65
|
.replace(/<(em|i)[^>]*>([\s\S]*?)<\/\1>/gi, (_m, _t, x) => "*" + x.trim() + "*")
|
|
66
66
|
.replace(/<code[^>]*>([\s\S]*?)<\/code>/gi, (_m, x) => "`" + x.trim() + "`")
|
|
67
|
-
|
|
68
|
-
|
|
67
|
+
/* A screenshot dragged into an issue on GitHub is written as an <img> tag, not as markdown,
|
|
68
|
+
and dropping it to its alt text left the word "Image" where the picture was. */
|
|
69
|
+
.replace(/<img[^>]*>/gi, (tag) => {
|
|
70
|
+
const src = /\ssrc=["'](https?:\/\/[^"'\s]+)["']/i.exec(tag)?.[1];
|
|
71
|
+
const alt = (/\salt=["']([^"']*)["']/i.exec(tag)?.[1] ?? "").replace(/[[\]]/g, "");
|
|
72
|
+
return src ? "" : alt;
|
|
73
|
+
})
|
|
69
74
|
// Only http(s). A `javascript:` href would be escaped downstream anyway, but a link that
|
|
70
75
|
// cannot go anywhere useful is better dropped than rendered.
|
|
71
76
|
.replace(
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
import { getInbox, getOrg, getSync } from "./api.js";
|
|
11
11
|
import { $, ago, el, esc } from "./dom.js";
|
|
12
12
|
import { render } from "./router.js";
|
|
13
|
-
import { sortHome } from "./homesort.js";
|
|
13
|
+
import { isFor, sortHome } from "./homesort.js";
|
|
14
14
|
import { humansOf, openCount, S, unreadCount } from "./state.js";
|
|
15
15
|
|
|
16
16
|
/**
|
|
@@ -75,7 +75,9 @@ export function stampCounts() {
|
|
|
75
75
|
/** What Home's "Needs you" holds, for the sidebar. */
|
|
76
76
|
function needsCount() {
|
|
77
77
|
if (!S.inbox || !S.data) return 0;
|
|
78
|
-
return sortHome(S.inbox.items ?? [], S.data.staff, humansOf(), S.live?.staff ?? []).needs.
|
|
78
|
+
return sortHome(S.inbox.items ?? [], S.data.staff, humansOf(), S.live?.staff ?? []).needs.filter(
|
|
79
|
+
(e) => isFor(e, S.me),
|
|
80
|
+
).length;
|
|
79
81
|
}
|
|
80
82
|
|
|
81
83
|
export function countInBackground() {
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/* A staff member's report, the body of their status issue, taken apart for Home's card. */
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* A report, taken apart: the status line, and the Done, Working on, Needs you and Next
|
|
5
|
+
* sections the prompts ask for. A report written before that shape has none of them, and is
|
|
6
|
+
* shown as its opening lines instead.
|
|
7
|
+
*/
|
|
8
|
+
export function parseReport(body) {
|
|
9
|
+
const lines = String(body ?? "").replace(/\r/g, "").split("\n");
|
|
10
|
+
const out = { status: "", headline: "", sections: {} };
|
|
11
|
+
let at = null;
|
|
12
|
+
const intro = [];
|
|
13
|
+
for (const raw of lines) {
|
|
14
|
+
const line = raw.trim();
|
|
15
|
+
const h = /^#{2,3}\s+(.+?)\s*$/.exec(line);
|
|
16
|
+
if (h) {
|
|
17
|
+
at = sectionKey(h[1]);
|
|
18
|
+
if (at) out.sections[at] ??= [];
|
|
19
|
+
continue;
|
|
20
|
+
}
|
|
21
|
+
if (!at) {
|
|
22
|
+
if (/^_?updated\b/i.test(line)) continue;
|
|
23
|
+
const st = /^\**status:\s*(on track|needs you|stuck|blocked)\b[.!]?\**\s*[.:\u2013\u2014-]?\s*(.*)$/i.exec(line);
|
|
24
|
+
if (st && !out.status) {
|
|
25
|
+
out.status = st[1].trim().toLowerCase();
|
|
26
|
+
if (st[2]) out.headline = st[2].replace(/^\**\s*/, "").trim();
|
|
27
|
+
continue;
|
|
28
|
+
}
|
|
29
|
+
if (line) intro.push(line);
|
|
30
|
+
continue;
|
|
31
|
+
}
|
|
32
|
+
const item = /^[-*]\s+(.*)$/.exec(line) ?? /^\d+[.)]\s+(.*)$/.exec(line);
|
|
33
|
+
if (item) out.sections[at].push(item[1]);
|
|
34
|
+
else if (line && out.sections[at].length) out.sections[at][out.sections[at].length - 1] += " " + line;
|
|
35
|
+
else if (line) out.sections[at].push(line);
|
|
36
|
+
}
|
|
37
|
+
if (!out.headline && intro.length) out.headline = intro[0];
|
|
38
|
+
for (const k of Object.keys(out.sections)) {
|
|
39
|
+
out.sections[k] = out.sections[k].filter((x) => !/^nothing\.?$/i.test(x.trim()));
|
|
40
|
+
}
|
|
41
|
+
return out;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
function sectionKey(title) {
|
|
45
|
+
const t = title.toLowerCase();
|
|
46
|
+
if (/^(done|shipped|finished|completed)/.test(t)) return "done";
|
|
47
|
+
if (/^(working on|priorities|in progress)/.test(t)) return "working";
|
|
48
|
+
if (/^(needs you|on you|waiting on)/.test(t)) return "needs";
|
|
49
|
+
if (/^next/.test(t)) return "next";
|
|
50
|
+
return null;
|
|
51
|
+
}
|
|
@@ -42,6 +42,8 @@ export const S = {
|
|
|
42
42
|
data: null,
|
|
43
43
|
/** `{login}` on a hosted portal, null on your own machine. Hosted has no setup, hire or doctor. */
|
|
44
44
|
hosted: null,
|
|
45
|
+
/** The signed-in GitHub login, hosted or local. Null when it could not be read. */
|
|
46
|
+
me: null,
|
|
45
47
|
docs: null,
|
|
46
48
|
inbox: null,
|
|
47
49
|
/** /api/runs. Kept once read: it is minutes of downloads on a cold cache. */
|