@nanocollective/roster 0.1.0-beta.2 → 0.1.0-beta.21
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 +3187 -1105
- package/dist/compose-5DBEHSEV.js +17 -0
- package/dist/connectors-5E5ZMGZV.js +23 -0
- package/dist/worker/assets/assets/css/base.css +21 -2
- package/dist/worker/assets/assets/css/brain.css +20 -0
- package/dist/worker/assets/assets/css/connectors.css +50 -0
- package/dist/worker/assets/assets/css/home.css +141 -54
- package/dist/worker/assets/assets/css/inbox.css +11 -0
- package/dist/worker/assets/assets/css/layout.css +6 -0
- package/dist/worker/assets/assets/css/markdown.css +21 -0
- package/dist/worker/assets/assets/css/routines.css +40 -0
- package/dist/worker/assets/assets/js/api.js +33 -0
- package/dist/worker/assets/assets/js/app.js +47 -3
- package/dist/worker/assets/assets/js/homesort.js +28 -21
- package/dist/worker/assets/assets/js/icons.js +4 -0
- package/dist/worker/assets/assets/js/md.js +7 -2
- package/dist/worker/assets/assets/js/refcard.js +216 -0
- 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 +14 -1
- package/dist/worker/assets/assets/js/views/connectors.js +290 -0
- package/dist/worker/assets/assets/js/views/home.js +368 -152
- package/dist/worker/assets/assets/js/views/inbox.js +68 -16
- package/dist/worker/assets/assets/js/views/org.js +2 -0
- package/dist/worker/assets/assets/js/views/people.js +103 -0
- package/dist/worker/assets/assets/js/views/routines.js +378 -0
- package/dist/worker/assets/index.html +8 -0
- package/dist/worker/index.js +3972 -963
- 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 +157 -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 +19 -2
- package/docs/hosting.md +42 -3
- package/docs/memory.md +3 -2
- package/docs/org-yaml.md +58 -5
- package/docs/portal.md +37 -6
- package/docs/prompts.md +3 -2
- package/docs/routines.md +65 -0
- package/docs/security.md +35 -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 +2 -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 +74 -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/base.css +21 -2
- package/templates/portal/css/brain.css +20 -0
- package/templates/portal/css/connectors.css +50 -0
- package/templates/portal/css/home.css +141 -54
- package/templates/portal/css/inbox.css +11 -0
- package/templates/portal/css/layout.css +6 -0
- package/templates/portal/css/markdown.css +21 -0
- package/templates/portal/css/routines.css +40 -0
- package/templates/portal/index.html +8 -0
- package/templates/portal/js/api.js +33 -0
- package/templates/portal/js/app.js +47 -3
- package/templates/portal/js/homesort.js +28 -21
- package/templates/portal/js/icons.js +4 -0
- package/templates/portal/js/md.js +7 -2
- package/templates/portal/js/refcard.js +216 -0
- package/templates/portal/js/refresh.js +4 -2
- package/templates/portal/js/report.js +51 -0
- package/templates/portal/js/state.js +14 -1
- package/templates/portal/js/views/connectors.js +290 -0
- package/templates/portal/js/views/home.js +368 -152
- package/templates/portal/js/views/inbox.js +68 -16
- package/templates/portal/js/views/org.js +2 -0
- package/templates/portal/js/views/people.js +103 -0
- package/templates/portal/js/views/routines.js +378 -0
- package/templates/skill/SKILL.md +115 -0
|
@@ -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}
|
|
@@ -20,82 +23,166 @@
|
|
|
20
23
|
.homewho{font:500 12.5px var(--sans);color:var(--ink);background:var(--surface-2);border:0;
|
|
21
24
|
border-radius:8px;padding:5px 8px}
|
|
22
25
|
|
|
23
|
-
|
|
24
|
-
|
|
26
|
+
/* Needs you: one list, a row per thing. A dot column for unread, the thing itself, and its
|
|
27
|
+
action; titles all start in the same place, and buttons are small enough not to shout. */
|
|
28
|
+
.homelist{padding:0 16px}
|
|
29
|
+
.homeneed{display:grid;grid-template-columns:8px minmax(0,1fr) auto;align-items:center;
|
|
30
|
+
gap:4px 14px;padding:14px 0;cursor:pointer}
|
|
31
|
+
.homeneed + .homeneed{border-top:1px solid var(--line)}
|
|
32
|
+
.homeneed:focus-visible{outline:2px solid var(--accent);outline-offset:2px;border-radius:6px}
|
|
33
|
+
.homeneed:hover .homeopen{text-decoration:underline}
|
|
34
|
+
.homedot{align-self:start;width:7px;height:7px;margin-top:7px;border-radius:50%}
|
|
35
|
+
.homeneed.unread .homedot{background:var(--blue)}
|
|
25
36
|
.homeabout{min-width:0}
|
|
26
|
-
.
|
|
27
|
-
.homecard:focus-visible{outline:none;border-color:var(--accent);box-shadow:0 0 0 3px var(--accent-soft)}
|
|
28
|
-
.homehead{display:flex;align-items:baseline;gap:8px}
|
|
29
|
-
.homehead .chip{flex:none}
|
|
30
|
-
.homeopen{all:unset;cursor:pointer;font:600 14px/1.35 var(--sans);color:var(--ink);letter-spacing:-.01em}
|
|
31
|
-
.homeopen:hover{text-decoration:underline}
|
|
37
|
+
.homeopen{all:unset;cursor:pointer;font:600 14px/1.4 var(--sans);color:var(--ink);letter-spacing:-.01em}
|
|
32
38
|
.homeopen:focus-visible{outline:2px solid var(--accent);outline-offset:2px;border-radius:4px}
|
|
33
|
-
.homeabout > .meta{margin-top:
|
|
34
|
-
.
|
|
35
|
-
.
|
|
36
|
-
.
|
|
39
|
+
.homeabout > .meta{margin-top:3px}
|
|
40
|
+
.homekind{font-weight:600;color:var(--ink-dim)}
|
|
41
|
+
.homekind.hot{color:var(--err)}
|
|
42
|
+
.homekind.warm{color:var(--warn)}
|
|
43
|
+
.homekind.cool{color:var(--ruled)}
|
|
44
|
+
.homekind.ok{color:var(--accent)}
|
|
45
|
+
.homedue{margin:5px 0 0;font-size:12.5px;color:var(--ink-dim)}
|
|
46
|
+
.homedue.late,.homedue .bad{color:var(--warn)}
|
|
47
|
+
.homeacts{justify-content:flex-end;flex-wrap:nowrap;gap:8px}
|
|
48
|
+
.homeacts .ghbtn{min-height:28px;padding:3px 12px;font-size:12.5px}
|
|
37
49
|
.homeacts .meta{white-space:normal;text-align:right;max-width:220px}
|
|
38
50
|
@media (max-width:640px){
|
|
39
|
-
.
|
|
40
|
-
.homeacts{justify-content:flex-start;flex-wrap:wrap}
|
|
51
|
+
.homeneed{grid-template-columns:8px minmax(0,1fr)}
|
|
52
|
+
.homeacts{grid-column:2;justify-content:flex-start;flex-wrap:wrap}
|
|
41
53
|
.homeacts .meta{text-align:left}
|
|
42
54
|
}
|
|
43
55
|
|
|
44
56
|
.homeworking{display:flex;flex-direction:column;padding:4px 16px}
|
|
45
|
-
.homerun{display:grid;grid-template-columns:minmax(150px,220px) auto 1fr auto;align-items:center;
|
|
46
|
-
gap:12px;padding:12px 0;font-size:13.5px}
|
|
47
|
-
.homerun + .homerun{border-top:1px solid var(--line)}
|
|
48
|
-
.homewho2{display:inline-flex;align-items:center;gap:8px;min-width:0}
|
|
49
|
-
.homewho2 b{font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
|
|
50
|
-
.homewho2 .ic{--ic:15px;color:var(--ink-dim);flex:none}
|
|
51
|
-
.homestate{justify-self:start}
|
|
52
|
-
.homestate.ok::before{content:"";width:6px;height:6px;border-radius:50%;background:currentColor;
|
|
53
|
-
margin-right:6px;animation:homepulse 1.6s var(--ease) infinite}
|
|
54
|
-
@keyframes homepulse{50%{opacity:.3}}
|
|
55
|
-
@media (prefers-reduced-motion:reduce){.homestate.ok::before{animation:none}}
|
|
56
57
|
.homerunwhat{color:var(--ink);line-height:1.45;min-width:0}
|
|
57
58
|
.homerunsub{color:var(--ink-dim);font-size:12.5px;margin-top:2px}
|
|
58
59
|
.homerunlog .ghbtn{min-height:28px;padding:3px 12px}
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
.homerunwhat{grid-area:what}.homerunlog{grid-area:log}
|
|
63
|
-
}
|
|
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}
|
|
64
63
|
|
|
65
64
|
.homerest{margin-top:26px}
|
|
66
|
-
.
|
|
65
|
+
.homeneed.gone,.homeline.gone{opacity:0;transform:translateX(12px);
|
|
67
66
|
transition:opacity .2s var(--ease),transform .2s var(--ease)}
|
|
68
67
|
|
|
69
|
-
/* Activity you have not seen: a blue dot and a bold title
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
GitHub. */
|
|
73
|
-
.homecard.unread{box-shadow:inset 3px 0 0 var(--blue)}
|
|
68
|
+
/* Activity you have not seen: a blue dot and a bold title. In Needs you the dot has a column of
|
|
69
|
+
its own; in the other lists it sits before the title. Opening the thread marks it read, here
|
|
70
|
+
and on GitHub. */
|
|
74
71
|
.unread .homeopen,.unread .homerowtitle{font-weight:700}
|
|
75
|
-
.unread .homeopen::before,.unread .homerowtitle::before{content:"";display:inline-block;width:7px;height:7px;border-radius:50%;
|
|
76
|
-
background:var(--blue);margin:0 7px 1px 0;vertical-align:middle}
|
|
77
72
|
|
|
78
|
-
.homereports{display:flex;flex-direction:column;gap:14px;padding:14px 16px}
|
|
79
|
-
.homereport{display:grid;grid-template-columns:190px 1fr;gap:12px;font-size:13px;line-height:1.5;
|
|
80
|
-
cursor:pointer;border-radius:8px;padding:6px 8px;margin:-6px -8px}
|
|
81
|
-
.homereport:hover{background:var(--hover)}
|
|
82
|
-
.homereport:focus-visible{outline:2px solid var(--accent);outline-offset:0}
|
|
83
|
-
.homereportwho{display:flex;flex-direction:column;gap:2px;min-width:0}
|
|
84
|
-
.homereportwho .meta{padding-left:21px}
|
|
85
|
-
.homereportbody p{margin:0 0 4px;color:var(--ink-dim);font-size:13px;line-height:1.5}
|
|
86
|
-
.homereportbody p:first-child{color:var(--ink)}
|
|
87
|
-
.homereportbody a{color:var(--accent)}
|
|
88
|
-
@media (max-width:640px){.homereport{grid-template-columns:1fr;gap:4px}}
|
|
89
73
|
|
|
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;
|
|
93
|
+
-webkit-mask-image:linear-gradient(#000 55%,transparent);mask-image:linear-gradient(#000 55%,transparent)}
|
|
94
|
+
.homereportbody p{margin:0 0 6px}
|
|
95
|
+
.homereportbody a,.homereportcol a,.homereportline a{color:var(--accent)}
|
|
96
|
+
.homereportissue{border:0;background:none;padding:0;font:inherit;color:var(--accent);cursor:pointer}
|
|
97
|
+
.homereportissue:hover{text-decoration:underline}
|
|
98
|
+
.homereportacts{gap:8px}
|
|
99
|
+
.homereportacts .ghbtn{min-height:28px;padding:3px 12px;font-size:12.5px}
|
|
90
100
|
@media (max-width:640px){
|
|
91
|
-
.
|
|
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)}
|
|
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
|
+
/* Waiting to start: yellow whoever it is, lit but slow, so it reads as "about to" rather than
|
|
149
|
+
"at work". GitHub has the run queued and no runner has picked it up yet. */
|
|
150
|
+
.orbcard.queued{--hue:#ffd60a!important;border-color:color-mix(in srgb,#ffd60a 35%,var(--line))}
|
|
151
|
+
.orbcard.queued .orbglow{animation:orbbreathe 2.2s ease-in-out infinite}
|
|
152
|
+
.orbcard.queued .orbswirl{opacity:.45;animation:orbspin 14s linear infinite}
|
|
153
|
+
.orbcard.queued .orbicon{color:#5c4a00;filter:none}
|
|
154
|
+
.orbcard.queued .orbstate{color:color-mix(in srgb,#ffd60a 70%,var(--ink))}
|
|
155
|
+
/* Free: the same orb, still and drained of colour. */
|
|
156
|
+
.orbcard.idle .orbbody,.orbcard.failed .orbbody,.orbcard.wait .orbbody{filter:saturate(.12) brightness(.95);opacity:.6}
|
|
157
|
+
.orbcard.failed .orb::after{content:"";position:absolute;top:4px;right:4px;width:12px;height:12px;border-radius:50%;
|
|
158
|
+
background:var(--err);box-shadow:0 0 0 3px var(--panel)}
|
|
159
|
+
.orbcard.wait .orbbody{animation:orbbreathe 1.6s ease-in-out infinite}
|
|
160
|
+
@keyframes orbbreathe{0%,100%{opacity:.35;transform:scale(.92)}50%{opacity:1;transform:scale(1.06)}}
|
|
161
|
+
@keyframes orbspin{to{transform:rotate(360deg)}}
|
|
162
|
+
@keyframes orbfloat{0%,100%{transform:translateY(0)}50%{transform:translateY(-3px)}}
|
|
163
|
+
@media (prefers-reduced-motion:reduce){
|
|
164
|
+
.orbcard .orbglow,.orbcard .orbswirl,.orbcard .orbbody{animation:none!important}
|
|
165
|
+
.orbcard.busy .orbglow{opacity:.8}
|
|
166
|
+
}
|
|
167
|
+
@media (max-width:640px){
|
|
168
|
+
.hometeam{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
|
|
169
|
+
.orbcard{padding:16px 10px 12px}
|
|
170
|
+
.orb{width:64px;height:64px}
|
|
92
171
|
}
|
|
93
172
|
|
|
94
173
|
/* Rows in a list card (Unread, Your requests, Closed today) that open a thread. */
|
|
95
|
-
.homeline{display:grid;grid-template-columns:
|
|
174
|
+
.homeline{display:grid;grid-template-columns:8px minmax(0,1fr) auto;align-items:center;gap:4px 14px;
|
|
96
175
|
padding:12px 0;font-size:13.5px;cursor:pointer}
|
|
176
|
+
.homeline.unread .homedot{background:var(--blue)}
|
|
97
177
|
.homeline + .homeline{border-top:1px solid var(--line)}
|
|
98
|
-
.homeline .homestate{min-width:64px;justify-content:center}
|
|
99
178
|
.homeline:hover .homerowtitle{text-decoration:underline}
|
|
100
179
|
.homeline:focus-visible{outline:2px solid var(--accent);outline-offset:2px;border-radius:6px}
|
|
101
180
|
.homerowtitle{font-weight:600;color:var(--ink)}
|
|
181
|
+
|
|
182
|
+
/* On a phone the lists use the width: last in the file, so it wins over each list's own padding. */
|
|
183
|
+
@media (max-width:640px){
|
|
184
|
+
.homelist,.homeworking,.homereports{padding-left:14px;padding-right:14px}
|
|
185
|
+
.homeline{grid-template-columns:8px minmax(0,1fr)}
|
|
186
|
+
.homeline .homerunlog{grid-column:2}
|
|
187
|
+
.homeline .homerunlog:empty{display:none}
|
|
188
|
+
}
|
|
@@ -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}
|
|
@@ -150,6 +150,12 @@ main{padding:36px 44px 96px;max-width:1220px;overflow-x:clip}
|
|
|
150
150
|
.side{position:static;height:auto;border-right:none;border-bottom:1px solid var(--line)}
|
|
151
151
|
.sidefoot{margin-top:0}
|
|
152
152
|
}
|
|
153
|
+
/* A phone: the page uses its width. 44px a side was a desktop gutter, and on a phone it took
|
|
154
|
+
a quarter of the screen, with a card's own padding inside it again. */
|
|
155
|
+
@media (max-width:640px){
|
|
156
|
+
main{padding:20px 16px 64px}
|
|
157
|
+
.card{padding:14px}
|
|
158
|
+
}
|
|
153
159
|
|
|
154
160
|
/* A staff member who cannot run yet (readiness.js). */
|
|
155
161
|
.readydot{width:7px;height:7px;border-radius:50%;background:var(--warn);flex:none;margin-left:4px}
|
|
@@ -60,6 +60,27 @@ pre.yaml{color:var(--ink)}
|
|
|
60
60
|
.ref.pr{color:var(--measured)}
|
|
61
61
|
.ref.pr:hover{border-color:var(--measured);background:color-mix(in srgb,var(--measured) 14%,transparent)}
|
|
62
62
|
|
|
63
|
+
/* What a chip is, on hover. In the top layer as a popover, so it shows over a side sheet too;
|
|
64
|
+
the UA's popover styles (inset, margin, border) are reset for that reason. */
|
|
65
|
+
.refcard{position:fixed;inset:auto;margin:0;z-index:60;width:340px;max-width:calc(100vw - 24px);
|
|
66
|
+
padding:12px 14px;background:var(--bg-elev);color:var(--ink);border:1px solid var(--border-strong);
|
|
67
|
+
border-radius:var(--r);box-shadow:var(--shadow-lg);font:13px/1.45 var(--sans);
|
|
68
|
+
opacity:0;transform:translateY(-2px);transition:opacity .12s var(--ease),transform .12s var(--ease)}
|
|
69
|
+
.refcard.on{opacity:1;transform:none}
|
|
70
|
+
.refcard[hidden]{display:none}
|
|
71
|
+
.refcard .rcmeta{display:flex;align-items:center;gap:8px;font:11.5px var(--mono);color:var(--ink-dim)}
|
|
72
|
+
.refcard .rcstate{display:inline-flex;align-items:center;gap:4px;font:600 11px var(--sans);
|
|
73
|
+
padding:1px 8px 1px 6px;border-radius:20px;--ic:12px}
|
|
74
|
+
.refcard .rcstate.open{color:var(--accent);background:var(--accent-soft)}
|
|
75
|
+
.refcard .rcstate.closed,.refcard .rcstate.merged{color:var(--derived);
|
|
76
|
+
background:color-mix(in srgb,var(--derived) 15%,transparent)}
|
|
77
|
+
.refcard .rctitle{margin-top:8px;font:600 14px/1.35 var(--sans);letter-spacing:-.005em}
|
|
78
|
+
.refcard .rcbody{margin:6px 0 0;color:var(--ink-dim);display:-webkit-box;-webkit-line-clamp:3;
|
|
79
|
+
-webkit-box-orient:vertical;overflow:hidden}
|
|
80
|
+
.refcard .rclabels{display:flex;flex-wrap:wrap;gap:4px;margin-top:8px}
|
|
81
|
+
.refcard .rcfoot{margin-top:10px;font-size:11.5px;color:var(--ink-faint)}
|
|
82
|
+
.refcard .sk{margin-top:8px}
|
|
83
|
+
|
|
63
84
|
/* @cto and @you are how work is handed between people here, so they are marked
|
|
64
85
|
rather than left as prose. `.you` is anyone on this org's roster; a stranger stays plain. */
|
|
65
86
|
.at{display:inline-block;font:11.5px var(--mono);color:var(--ink-dim);background:var(--panel-2);
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/* Routines: each staff member's daily round and routines, as rows, and the editor sheet. */
|
|
2
|
+
|
|
3
|
+
.routhead{display:flex;align-items:center;justify-content:space-between;gap:12px;max-width:880px}
|
|
4
|
+
.routhead h1{margin:0}
|
|
5
|
+
.routlist{margin-bottom:6px}
|
|
6
|
+
.routrow{grid-template-columns:32px minmax(0,1fr) auto}
|
|
7
|
+
.routwhen{font-size:13px;color:var(--ink-dim)}
|
|
8
|
+
.routbody{font-size:13px;color:var(--ink-faint);display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;
|
|
9
|
+
overflow:hidden;white-space:pre-line}
|
|
10
|
+
.routadd{display:flex;align-items:center;gap:8px;padding:11px 16px;border:0;border-top:1px solid var(--line);
|
|
11
|
+
background:none;color:var(--accent);font:500 13px var(--sans);cursor:pointer;text-align:left;--ic:14px}
|
|
12
|
+
.routadd:hover{background:var(--accent-soft)}
|
|
13
|
+
|
|
14
|
+
.routform{display:flex;flex-direction:column;gap:16px}
|
|
15
|
+
.routform .sheettitle{margin-bottom:0}
|
|
16
|
+
.routfield{display:flex;flex-direction:column;gap:7px}
|
|
17
|
+
.routfield input[type=text]{width:100%;box-sizing:border-box}
|
|
18
|
+
.routtodo{min-height:160px;font:14px/1.55 var(--sans)}
|
|
19
|
+
.routwho,.routdays{display:flex;flex-wrap:wrap;gap:6px}
|
|
20
|
+
.routchip{padding:6px 12px;border:1px solid var(--border-strong);border-radius:999px;background:var(--bg-elev);
|
|
21
|
+
color:var(--ink);font:500 13px var(--sans);cursor:pointer;transition:background .12s var(--ease),border-color .12s var(--ease)}
|
|
22
|
+
.routchip:hover{border-color:var(--accent)}
|
|
23
|
+
.routchip.on{background:var(--accent);border-color:var(--accent);color:var(--accent-ink)}
|
|
24
|
+
.routwhenpick{display:flex;flex-direction:column;gap:10px;align-items:flex-start}
|
|
25
|
+
.routwhenpick [hidden]{display:none}
|
|
26
|
+
.routsaid{color:var(--ink-dim);font-size:12.5px}
|
|
27
|
+
|
|
28
|
+
/* The sentence the routine will be, as it is typed. */
|
|
29
|
+
.routpreview{display:grid;grid-template-columns:32px minmax(0,1fr);gap:12px;padding:14px 16px;
|
|
30
|
+
border:1px solid var(--line);border-radius:var(--r-lg);background:var(--panel);box-shadow:var(--shadow-sm)}
|
|
31
|
+
.routpreview b{font:600 14px var(--sans);letter-spacing:-.01em}
|
|
32
|
+
.routpreview p{margin:6px 0 0;font-size:13.5px;line-height:1.55;color:var(--ink-dim);white-space:pre-wrap;
|
|
33
|
+
max-height:9em;overflow:hidden}
|
|
34
|
+
|
|
35
|
+
@media (max-width:640px){
|
|
36
|
+
.routrow{grid-template-columns:32px minmax(0,1fr)}
|
|
37
|
+
.routrow .connacts{grid-column:1 / -1;flex-wrap:wrap}
|
|
38
|
+
}
|
|
39
|
+
.routwhenpick select{width:auto}
|
|
40
|
+
.routhead + div > .connhead:first-child{margin-top:20px}
|
|
@@ -20,6 +20,8 @@
|
|
|
20
20
|
<link rel="stylesheet" href="/assets/css/health.css">
|
|
21
21
|
<link rel="stylesheet" href="/assets/css/runs.css">
|
|
22
22
|
<link rel="stylesheet" href="/assets/css/setup.css">
|
|
23
|
+
<link rel="stylesheet" href="/assets/css/connectors.css">
|
|
24
|
+
<link rel="stylesheet" href="/assets/css/routines.css">
|
|
23
25
|
</head>
|
|
24
26
|
<body>
|
|
25
27
|
<div class="app">
|
|
@@ -56,6 +58,12 @@
|
|
|
56
58
|
<button class="nav" id="staffnav" data-view="staff">
|
|
57
59
|
<span class="ic" data-icon="person"></span> Staff
|
|
58
60
|
</button>
|
|
61
|
+
<button class="nav" id="routinesnav" data-view="routines" title="When the staff wake up, and what they do then">
|
|
62
|
+
<span class="ic" data-icon="clock"></span> Routines
|
|
63
|
+
</button>
|
|
64
|
+
<button class="nav" id="connectorsnav" data-view="connectors" title="Outside services the staff can use">
|
|
65
|
+
<span class="ic" data-icon="plug"></span> Connectors
|
|
66
|
+
</button>
|
|
59
67
|
<button class="nav" id="docsnav" data-view="docs">
|
|
60
68
|
<span class="ic" data-icon="docs"></span> Docs
|
|
61
69
|
</button>
|
|
@@ -14,7 +14,40 @@ export const getSession = () =>
|
|
|
14
14
|
.catch(() => null);
|
|
15
15
|
|
|
16
16
|
export const getOrg = () => json("/api/org");
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* The org, for the first load, saying what it is doing as it goes: `onStep(repo, step)` for each
|
|
20
|
+
* line the server streams, then the org itself. Anything that is not a stream (the setup answer,
|
|
21
|
+
* an older server) is read as plain JSON, so this is never worse than getOrg.
|
|
22
|
+
*/
|
|
23
|
+
export async function getOrgWithProgress(onStep) {
|
|
24
|
+
const res = await fetch("/api/org?progress=1", { cache: "no-store" });
|
|
25
|
+
if (res.status === 401) location.reload();
|
|
26
|
+
const type = String(res.headers?.get?.("content-type") ?? "");
|
|
27
|
+
if (!type.includes("ndjson") || !res.body?.pipeThrough) return res.json();
|
|
28
|
+
const reader = res.body.pipeThrough(new TextDecoderStream()).getReader();
|
|
29
|
+
let buf = "";
|
|
30
|
+
for (;;) {
|
|
31
|
+
const { done, value } = await reader.read();
|
|
32
|
+
if (done) break;
|
|
33
|
+
buf += value;
|
|
34
|
+
let nl;
|
|
35
|
+
while ((nl = buf.indexOf("\n")) >= 0) {
|
|
36
|
+
const line = buf.slice(0, nl).trim();
|
|
37
|
+
buf = buf.slice(nl + 1);
|
|
38
|
+
if (!line) continue;
|
|
39
|
+
const msg = JSON.parse(line);
|
|
40
|
+
if (msg.org) return msg.org;
|
|
41
|
+
if (msg.error) throw new Error(msg.error);
|
|
42
|
+
onStep(msg.repo, msg.step);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
throw new Error("The org did not arrive. Reload to try again.");
|
|
46
|
+
}
|
|
17
47
|
export const getDocs = () => json("/api/docs");
|
|
48
|
+
|
|
49
|
+
/** Connectors: the catalogue, what this org has, and whether each one's key is stored. */
|
|
50
|
+
export const getConnectors = () => json("/api/connectors");
|
|
18
51
|
export const getInbox = (force) => json("/api/inbox" + (force ? "?refresh=1" : ""));
|
|
19
52
|
export const getSync = () => json("/api/sync").catch(() => null);
|
|
20
53
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/* The shell: boot, the sidebar, and dispatching a view into <main>. */
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import { getOrgWithProgress, getSession } from "./api.js";
|
|
4
4
|
import { $, el, store } from "./dom.js";
|
|
5
5
|
import { icon, iconHTML, staffIcon } from "./icons.js";
|
|
6
6
|
import { installLightbox } from "./lightbox.js";
|
|
@@ -13,10 +13,13 @@ import {
|
|
|
13
13
|
stampLoaded,
|
|
14
14
|
syncNotice,
|
|
15
15
|
} from "./refresh.js";
|
|
16
|
+
import { installRefs } from "./refcard.js";
|
|
16
17
|
import { onRender } from "./router.js";
|
|
17
18
|
import { ORG_WIDE, S, VIEWS, applyHash, humanLabel, readHash, writeHash } from "./state.js";
|
|
18
19
|
import { viewBrain } from "./views/brain.js";
|
|
19
20
|
import { viewChanged } from "./views/changed.js";
|
|
21
|
+
import { viewConnectors } from "./views/connectors.js";
|
|
22
|
+
import { viewRoutines } from "./views/routines.js";
|
|
20
23
|
import { viewDocs } from "./views/docs.js";
|
|
21
24
|
import { viewGraph } from "./views/graph.js";
|
|
22
25
|
import { viewHealth } from "./views/health.js";
|
|
@@ -38,6 +41,8 @@ const SCREEN = {
|
|
|
38
41
|
runs: viewRuns,
|
|
39
42
|
org: viewOrg,
|
|
40
43
|
staff: viewStaff,
|
|
44
|
+
connectors: viewConnectors,
|
|
45
|
+
routines: viewRoutines,
|
|
41
46
|
docs: viewDocs,
|
|
42
47
|
brain: viewBrain,
|
|
43
48
|
memory: viewBrain,
|
|
@@ -64,6 +69,8 @@ const NAV = [
|
|
|
64
69
|
["#inboxnav", "inbox"],
|
|
65
70
|
["#runsnav", "runs"],
|
|
66
71
|
["#staffnav", "staff"],
|
|
72
|
+
["#routinesnav", "routines"],
|
|
73
|
+
["#connectorsnav", "connectors"],
|
|
67
74
|
["#orgnav", "org"],
|
|
68
75
|
["#docsnav", "docs"],
|
|
69
76
|
];
|
|
@@ -92,12 +99,14 @@ export async function boot() {
|
|
|
92
99
|
/* Before the first render, and once: it is delegated, so it covers every image any screen
|
|
93
100
|
draws from here on, including the setup screen. */
|
|
94
101
|
installLightbox();
|
|
102
|
+
installRefs();
|
|
95
103
|
|
|
96
104
|
/* Before there is a tenant the server answers every data route with `mode: setup`. That is
|
|
97
105
|
not an error state: it is the first thing a new user ever sees, and the whole page becomes
|
|
98
106
|
the thing that fixes it. */
|
|
99
|
-
const [first, session] = await Promise.all([
|
|
107
|
+
const [first, session] = await Promise.all([loadWithProgress(), getSession()]);
|
|
100
108
|
S.hosted = session?.hosted ? session : null;
|
|
109
|
+
S.me = session?.login || null;
|
|
101
110
|
if (S.hosted) showSignedIn(S.hosted.login);
|
|
102
111
|
if (first && first.mode === "setup") {
|
|
103
112
|
document.body.dataset.setup = "1";
|
|
@@ -105,7 +114,7 @@ export async function boot() {
|
|
|
105
114
|
/* Every one of these reads a tenant, so during setup they answer 409 and the sidebar is a
|
|
106
115
|
row of four dead ends beside an empty Staff heading. There is one thing to do on this
|
|
107
116
|
screen; the navigation comes back with the org. */
|
|
108
|
-
for (const el of document.querySelectorAll("#sidesearch, #homenav, #inboxnav, #runsnav, #orgnav, #staffnav, #docsnav, #refreshall, .sect, #stafflist")) {
|
|
117
|
+
for (const el of document.querySelectorAll("#sidesearch, #homenav, #inboxnav, #runsnav, #orgnav, #staffnav, #routinesnav, #connectorsnav, #docsnav, #refreshall, .sect, #stafflist")) {
|
|
109
118
|
el.hidden = true;
|
|
110
119
|
}
|
|
111
120
|
for (const slot of document.querySelectorAll("[data-icon]")) {
|
|
@@ -409,6 +418,41 @@ function render() {
|
|
|
409
418
|
(SCREEN[S.view] ?? viewBrain)(m);
|
|
410
419
|
}
|
|
411
420
|
|
|
421
|
+
/* ------------------------------- first load -------------------------------- */
|
|
422
|
+
|
|
423
|
+
/**
|
|
424
|
+
* The first read of the org, with what it is doing on screen. A cold start reads every
|
|
425
|
+
* repository from GitHub, which can take a while, and "Loading…" for fifteen seconds reads as
|
|
426
|
+
* broken. One row per repository, saying which step it is on, and a tick when it is ready.
|
|
427
|
+
*/
|
|
428
|
+
async function loadWithProgress() {
|
|
429
|
+
const main = $("#main");
|
|
430
|
+
const rows = new Map();
|
|
431
|
+
const list = el("div", { className: "loadlist" });
|
|
432
|
+
const head = el("p", { className: "sub", textContent: "Reading the org from GitHub…" });
|
|
433
|
+
// Only once something is actually slow: a warm load is over before this would be read.
|
|
434
|
+
const show = setTimeout(() => main.replaceChildren(head, list), 400);
|
|
435
|
+
try {
|
|
436
|
+
return await getOrgWithProgress((repo, step) => {
|
|
437
|
+
let row = rows.get(repo);
|
|
438
|
+
if (!row) {
|
|
439
|
+
row = el("div", { className: "loadrow" }, [
|
|
440
|
+
el("span", { className: "loadmark" }),
|
|
441
|
+
el("b", { textContent: repo }),
|
|
442
|
+
el("span", { className: "meta" }),
|
|
443
|
+
]);
|
|
444
|
+
rows.set(repo, row);
|
|
445
|
+
list.append(row);
|
|
446
|
+
}
|
|
447
|
+
const ready = step === "ready" || step === "up to date";
|
|
448
|
+
row.classList.toggle("done", ready);
|
|
449
|
+
row.lastChild.textContent = ready ? "ready" : step;
|
|
450
|
+
});
|
|
451
|
+
} finally {
|
|
452
|
+
clearTimeout(show);
|
|
453
|
+
}
|
|
454
|
+
}
|
|
455
|
+
|
|
412
456
|
/* -------------------------------- signed in -------------------------------- */
|
|
413
457
|
|
|
414
458
|
/**
|
|
@@ -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
|
-
|
|
80
|
-
|
|
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);
|
|
@@ -97,6 +80,12 @@ export function sortHome(items, staff, humans, live = [], now = new Date()) {
|
|
|
97
80
|
? "answered"
|
|
98
81
|
: "waiting";
|
|
99
82
|
}
|
|
83
|
+
if (place.place === "needs") {
|
|
84
|
+
/* On nobody in particular, such as a pull request nobody was assigned: the first person's,
|
|
85
|
+
as the staff are told "something that fits nobody's area goes to" them. */
|
|
86
|
+
entry.for = whoFor(item, humans);
|
|
87
|
+
if (!entry.for.length && humans[0]?.github) entry.for = [humans[0].github];
|
|
88
|
+
}
|
|
100
89
|
out[place.place].push(entry);
|
|
101
90
|
}
|
|
102
91
|
|
|
@@ -143,6 +132,24 @@ export function placeOf(item, owner, people, markers) {
|
|
|
143
132
|
};
|
|
144
133
|
}
|
|
145
134
|
|
|
135
|
+
/**
|
|
136
|
+
* The people an ask is on, by login: whoever it is assigned to, and whoever's label it carries.
|
|
137
|
+
* Empty means nobody in particular, such as a pull request nobody was asked to look at.
|
|
138
|
+
*/
|
|
139
|
+
export function whoFor(item, humans) {
|
|
140
|
+
const labels = new Set((item.labels ?? []).map(lower));
|
|
141
|
+
const assigned = new Set((item.assignees ?? []).map(lower));
|
|
142
|
+
return humans
|
|
143
|
+
.filter((h) => (h.github && assigned.has(lower(h.github))) || (h.marker && labels.has(lower(h.marker))))
|
|
144
|
+
.map((h) => h.github);
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
/** Whether an ask is for this login: it is on them, or on nobody in particular. */
|
|
148
|
+
export function isFor(entry, login) {
|
|
149
|
+
if (!login || !entry.for?.length) return true;
|
|
150
|
+
return entry.for.some((g) => lower(g) === lower(login));
|
|
151
|
+
}
|
|
152
|
+
|
|
146
153
|
function kindOf(labels) {
|
|
147
154
|
const found = KINDS.find((k) => labels.includes(k));
|
|
148
155
|
if (found) return found;
|
|
@@ -13,6 +13,8 @@
|
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
15
|
const PATHS = {
|
|
16
|
+
"plug":
|
|
17
|
+
"<path d=\"M12 22v-5\" /> <path d=\"M9 8V2\" /> <path d=\"M15 8V2\" /> <path d=\"M18 8v5a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V8Z\" />",
|
|
16
18
|
"search":
|
|
17
19
|
"<circle cx=\"11\" cy=\"11\" r=\"8\" /> <path d=\"m21 21-4.3-4.3\" />",
|
|
18
20
|
"lightbulb":
|
|
@@ -81,6 +83,8 @@ const PATHS = {
|
|
|
81
83
|
"<path d=\"m21.44 11.05-9.19 9.19a6 6 0 0 1-8.49-8.49l8.57-8.57A4 4 0 1 1 18 8.84l-8.59 8.57a2 2 0 0 1-2.83-2.83l8.49-8.48\" />",
|
|
82
84
|
"person":
|
|
83
85
|
"<circle cx=\"12\" cy=\"8\" r=\"5\" /> <path d=\"M20 21a8 8 0 0 0-16 0\" />",
|
|
86
|
+
"clock":
|
|
87
|
+
"<circle cx=\"12\" cy=\"12\" r=\"10\" /> <path d=\"M12 6v6l4 2\" />",
|
|
84
88
|
"play":
|
|
85
89
|
"<path d=\"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z\" />",
|
|
86
90
|
// The pair for the lightbox's zoom controls. `dash` above is the other half.
|
|
@@ -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(
|