forge-cw 0.1.27 → 0.1.29
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/modules/mod-today/dist/banner.js +219 -239
- package/modules/mod-today/dist/server.js +289 -20
- package/modules/mod-today/dist/view.js +347 -114
- package/package.json +1 -1
|
@@ -5,7 +5,6 @@ import { definePanel } from "@forge-dev/sdk";
|
|
|
5
5
|
var errorMessage = (e) => e instanceof Error ? e.message : String(e);
|
|
6
6
|
var STARTS = ["issue", "request", "review"];
|
|
7
7
|
var startsTask = (kind) => STARTS.includes(kind);
|
|
8
|
-
var inAccount = (items, account) => account ? items.filter((i) => i.account === account) : items;
|
|
9
8
|
function opFor(item, project) {
|
|
10
9
|
if (item.kind === "to-task") return item.targetSession ? "send" : null;
|
|
11
10
|
if (item.kind === "research") return "research";
|
|
@@ -17,7 +16,11 @@ function projectsFor({ names, owners }, account) {
|
|
|
17
16
|
}
|
|
18
17
|
var failedLine = (error) => `Last reading failed: ${error}`;
|
|
19
18
|
var loadFailedLine = (error) => `Can't load Today: ${error}`;
|
|
20
|
-
var
|
|
19
|
+
var GH_SIGNED_OUT = "GitHub: gh is not signed in (run gh auth login)";
|
|
20
|
+
function tidyNotes(notes) {
|
|
21
|
+
return [...new Set(notes.map((n) => /^github\b[^:]*:/i.test(n) && /gh auth login|GH_TOKEN/i.test(n) ? GH_SIGNED_OUT : n))];
|
|
22
|
+
}
|
|
23
|
+
var notesLine = (notes) => notes?.length ? tidyNotes(notes).join(" \xB7 ") : null;
|
|
21
24
|
var SOURCE_NAME = { slack: "Slack", linear: "Linear", reader: "Reader" };
|
|
22
25
|
function sourcesLabel(sources) {
|
|
23
26
|
const names = ["slack", "linear", "reader"].filter((s) => sources.includes(s)).map((s) => SOURCE_NAME[s]);
|
|
@@ -32,7 +35,45 @@ function groupProblems(problems) {
|
|
|
32
35
|
}
|
|
33
36
|
var groupLine = (g) => `${g.account} \xB7 ${g.label} did not respond`;
|
|
34
37
|
var problemsLabel = (n) => `\u26A0 ${n} account problem${n === 1 ? "" : "s"}`;
|
|
35
|
-
|
|
38
|
+
function titleFor(i) {
|
|
39
|
+
if (!i.issueKey) return i.title;
|
|
40
|
+
const key = i.issueKey.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
41
|
+
const rest = i.title.replace(new RegExp(`^\\s*\\[?${key}\\]?\\s*[:\\-\u2013\u2014]?\\s*`, "i"), "");
|
|
42
|
+
return rest.trim() ? rest : i.title;
|
|
43
|
+
}
|
|
44
|
+
var SOURCE_NAMES = { linear: "Linear", slack: "Slack", github: "GitHub" };
|
|
45
|
+
function whoOf(i) {
|
|
46
|
+
const who = i.who.trim();
|
|
47
|
+
return !who || who.toLowerCase() === SOURCE_NAMES[i.source].toLowerCase() ? null : who;
|
|
48
|
+
}
|
|
49
|
+
var FIRST_READING_NOTE = "First reading \u2014 what you have open is under Pending.";
|
|
50
|
+
function newsList(items) {
|
|
51
|
+
const waiting = (i) => i.state === "proposed" || i.state === "failed" ? 0 : 1;
|
|
52
|
+
return items.filter((i) => i.state !== "dismissed").sort((a, b) => waiting(a) - waiting(b) || Date.parse(b.when) - Date.parse(a.when));
|
|
53
|
+
}
|
|
54
|
+
function ageShort(iso, now = /* @__PURE__ */ new Date()) {
|
|
55
|
+
const min = Math.max(0, Math.round((now.getTime() - Date.parse(iso)) / 6e4));
|
|
56
|
+
if (Number.isNaN(min)) return "";
|
|
57
|
+
if (min < 1) return "now";
|
|
58
|
+
if (min < 60) return `${min}m`;
|
|
59
|
+
if (min < 48 * 60) return `${Math.round(min / 60)}h`;
|
|
60
|
+
return `${Math.round(min / 1440)}d`;
|
|
61
|
+
}
|
|
62
|
+
var safeHref = (link) => /^https?:\/\//i.test(link) ? link : void 0;
|
|
63
|
+
var isOpenNews = (i) => i.state === "proposed" || i.state === "failed";
|
|
64
|
+
function bannerSummary(news, pending) {
|
|
65
|
+
return { fresh: news.filter(isOpenNews).length, pending: pending.length, ci: pending.filter((p) => p.kind === "ci").length, slack: pending.filter((p) => p.kind === "reply").length };
|
|
66
|
+
}
|
|
67
|
+
function summaryText(s) {
|
|
68
|
+
const urgent = [s.ci ? `${s.ci} CI` : "", s.slack ? `${s.slack} Slack` : ""].filter(Boolean).join(" \xB7 ");
|
|
69
|
+
return `${s.fresh} new \xB7 ${s.pending} pending${urgent ? ` (${urgent})` : ""}`;
|
|
70
|
+
}
|
|
71
|
+
function urgentRows(news, pending, max = 3) {
|
|
72
|
+
const open = newsList(news).filter(isOpenNews);
|
|
73
|
+
const urgent = [...pending.filter((p) => p.kind === "ci"), ...pending.filter((p) => p.kind === "reply")];
|
|
74
|
+
const first = urgent.slice(0, open.length ? Math.max(1, max - 1) : max).map((item) => ({ kind: "pending", item }));
|
|
75
|
+
return [...first, ...open.slice(0, max - first.length).map((item) => ({ kind: "news", item }))];
|
|
76
|
+
}
|
|
36
77
|
|
|
37
78
|
// src/rows.tsx
|
|
38
79
|
import { useCallback, useEffect, useRef, useState } from "preact/hooks";
|
|
@@ -50,25 +91,6 @@ function AccountChip({ account }) {
|
|
|
50
91
|
const token = accountToken(account);
|
|
51
92
|
return /* @__PURE__ */ jsx("span", { title: `Account ${account}`, style: { fontSize: "10.5px", fontWeight: 600, padding: "2px 7px", borderRadius: "6px", whiteSpace: "nowrap", color: `var(${token})`, background: soft(token, 15) }, children: account });
|
|
52
93
|
}
|
|
53
|
-
var FILTER_KEY = "today.account";
|
|
54
|
-
function useAccountFilter() {
|
|
55
|
-
const [account, setAccount] = useState(() => {
|
|
56
|
-
try {
|
|
57
|
-
return localStorage.getItem(FILTER_KEY) ?? "";
|
|
58
|
-
} catch {
|
|
59
|
-
return "";
|
|
60
|
-
}
|
|
61
|
-
});
|
|
62
|
-
const choose = (a) => {
|
|
63
|
-
setAccount(a);
|
|
64
|
-
try {
|
|
65
|
-
if (a) localStorage.setItem(FILTER_KEY, a);
|
|
66
|
-
else localStorage.removeItem(FILTER_KEY);
|
|
67
|
-
} catch {
|
|
68
|
-
}
|
|
69
|
-
};
|
|
70
|
-
return [account, choose];
|
|
71
|
-
}
|
|
72
94
|
function useDigest(forge, path = "/digest") {
|
|
73
95
|
const [reply, setReply] = useState(null);
|
|
74
96
|
const [error, setError] = useState(null);
|
|
@@ -131,6 +153,15 @@ function useActing(forge, date, reload, hurry = () => {
|
|
|
131
153
|
const act = (item, op, project) => run(async () => {
|
|
132
154
|
if (date) await forge.action(op, { date, id: item.id, ...project ? { project } : {} });
|
|
133
155
|
});
|
|
156
|
+
const startPending = (item, project) => run(async () => {
|
|
157
|
+
await forge.action("pending-start", { id: item.id, ...project ? { project } : {} });
|
|
158
|
+
});
|
|
159
|
+
const researchPending = (item) => run(async () => {
|
|
160
|
+
await forge.action("pending-research", { id: item.id });
|
|
161
|
+
});
|
|
162
|
+
const hidePending = (item) => run(async () => {
|
|
163
|
+
await forge.action("pending-hide", { id: item.id });
|
|
164
|
+
});
|
|
134
165
|
const refresh = async () => {
|
|
135
166
|
if (reading.current) return;
|
|
136
167
|
reading.current = true;
|
|
@@ -155,7 +186,7 @@ function useActing(forge, date, reload, hurry = () => {
|
|
|
155
186
|
const s = await forge.action("reconnect", { account });
|
|
156
187
|
if (s) forge.openSession(s.project, s.sessionDir);
|
|
157
188
|
});
|
|
158
|
-
return { busy, refreshing, retrying, retry, reconnect, run, act, refresh };
|
|
189
|
+
return { busy, refreshing, retrying, retry, reconnect, run, act, refresh, startPending, researchPending, hidePending };
|
|
159
190
|
}
|
|
160
191
|
function dayOf(date) {
|
|
161
192
|
const [y, m, d] = date.split("-").map(Number);
|
|
@@ -170,29 +201,20 @@ function dayLabel(now, date) {
|
|
|
170
201
|
return `${part} \xB7 your ${now.toLocaleDateString("en-US", { weekday: "long" })} ${now.getDate()}`;
|
|
171
202
|
}
|
|
172
203
|
var shortDay = (now, date) => !date || isToday(date, now) ? "Today" : dayLabel(now, date);
|
|
173
|
-
function foldedNow(folded, items) {
|
|
174
|
-
return folded || !items.some((i) => i.state === "proposed" || i.state === "failed");
|
|
175
|
-
}
|
|
176
204
|
var clock = (d) => d.toLocaleTimeString("en-US", { hour: "numeric", minute: "2-digit" });
|
|
205
|
+
function windowTime(at, read) {
|
|
206
|
+
if (at.toDateString() === read.toDateString()) return clock(at);
|
|
207
|
+
const yesterday = new Date(read.getTime() - 864e5).toDateString() === at.toDateString();
|
|
208
|
+
return `${yesterday ? "yesterday" : at.toLocaleDateString("en-US", { month: "short", day: "numeric" })} ${clock(at)}`;
|
|
209
|
+
}
|
|
177
210
|
function readLine(d) {
|
|
178
211
|
const read = new Date(d.readAt);
|
|
179
|
-
|
|
180
|
-
const same = read.toDateString() === since.toDateString();
|
|
181
|
-
const day = new Date(read.getTime() - 864e5).toDateString() === since.toDateString() ? "yesterday " : `${since.toLocaleDateString("en-US", { month: "short", day: "numeric" })} `;
|
|
182
|
-
return `Read at ${clock(read)} \xB7 Linear, Slack and GitHub since ${same ? "" : day}${clock(since)}`;
|
|
183
|
-
}
|
|
184
|
-
function ago(iso, now = /* @__PURE__ */ new Date()) {
|
|
185
|
-
const t = new Date(iso);
|
|
186
|
-
const min = Math.round((now.getTime() - t.getTime()) / 6e4);
|
|
187
|
-
if (min < 1) return "just now";
|
|
188
|
-
if (min < 60) return `${min} min ago`;
|
|
189
|
-
if (min < 24 * 60) return `${Math.round(min / 60)} h ago`;
|
|
190
|
-
return t.toLocaleDateString("en-US", { month: "short", day: "numeric" }) + " " + clock(t);
|
|
212
|
+
return `Read at ${clock(read)} \xB7 changes since ${windowTime(new Date(d.windowStart ?? d.since), read)}`;
|
|
191
213
|
}
|
|
192
214
|
var SOURCE_LABEL = { linear: "Linear", slack: "Slack", github: "GitHub" };
|
|
193
215
|
var SOURCE_TINT = { linear: "#5e6ad2 22%", slack: "#e01e5a 18%", github: "#8b949e 24%" };
|
|
194
216
|
function SourceIcon({ source }) {
|
|
195
|
-
return /* @__PURE__ */ jsx("div", { title: SOURCE_LABEL[source], style: { width: "
|
|
217
|
+
return /* @__PURE__ */ jsx("div", { title: SOURCE_LABEL[source], style: { width: "22px", height: "22px", borderRadius: "6px", display: "grid", placeItems: "center", flexShrink: 0, background: `color-mix(in srgb, ${SOURCE_TINT[source]}, transparent)` }, children: source === "github" ? /* @__PURE__ */ jsx("svg", { width: "12", height: "12", viewBox: "0 0 16 16", "aria-hidden": "true", children: /* @__PURE__ */ jsx("path", { fill: "currentColor", style: { color: "var(--ink)" }, d: "M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82a7.6 7.6 0 0 1 4 0c1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.01 8.01 0 0 0 16 8c0-4.42-3.58-8-8-8z" }) }) : source === "linear" ? /* @__PURE__ */ jsx("svg", { width: "12", height: "12", viewBox: "0 0 100 100", "aria-hidden": "true", children: /* @__PURE__ */ jsx("path", { fill: "#8c94f0", d: "M1.2 61.5 38.5 98.8C19.8 95.6 4.4 80.2 1.2 61.5zM0 46.9 53.1 100c3.4-.2 6.8-.8 10-1.6L1.6 36.9C.8 40.1.2 43.5 0 46.9zM4.9 27 73 95.1c2.6-1.1 5.1-2.5 7.4-4L8.9 19.6c-1.5 2.3-2.9 4.8-4 7.4zM14.4 13.8C23.4 5.3 35.5 0 48.9 0 76 0 100 24 100 51.1c0 13.4-5.3 25.5-13.8 34.5z" }) }) : /* @__PURE__ */ jsx("svg", { width: "12", height: "12", viewBox: "0 0 24 24", "aria-hidden": "true", children: /* @__PURE__ */ jsxs("g", { fill: "none", "stroke-width": "2.6", "stroke-linecap": "round", children: [
|
|
196
218
|
/* @__PURE__ */ jsx("path", { stroke: "#36c5f0", d: "M9 3.5v6" }),
|
|
197
219
|
/* @__PURE__ */ jsx("path", { stroke: "#2eb67d", d: "M20.5 9h-6" }),
|
|
198
220
|
/* @__PURE__ */ jsx("path", { stroke: "#ecb22e", d: "M15 20.5v-6" }),
|
|
@@ -244,70 +266,122 @@ function outcome(item) {
|
|
|
244
266
|
where ? ` \xB7 ${where}` : ""
|
|
245
267
|
] });
|
|
246
268
|
}
|
|
269
|
+
var sourceOf = (p) => SOURCE_LABEL[p.source];
|
|
270
|
+
var mono = { fontFamily: "var(--mono, ui-monospace, monospace)", fontSize: "11.5px", color: "var(--ink-2)", fontWeight: 500 };
|
|
271
|
+
function Line({ source, keyText, title, account, when, primary, children, dim }) {
|
|
272
|
+
const [open, setOpen] = useState(false);
|
|
273
|
+
return /* @__PURE__ */ jsxs("div", { style: { borderRadius: "9px", background: open ? soft("--ink", 3) : "transparent", border: `1px solid ${open ? "var(--hair)" : "transparent"}`, opacity: dim ? 0.55 : 1, transition: "background .2s var(--ease)" }, children: [
|
|
274
|
+
/* @__PURE__ */ jsxs("div", { style: { display: "flex", alignItems: "center", gap: "8px", padding: "4px 6px", minHeight: "30px" }, children: [
|
|
275
|
+
/* @__PURE__ */ jsxs("button", { type: "button", "aria-expanded": open, onClick: () => setOpen(!open), style: { flex: 1, minWidth: 0, display: "flex", alignItems: "center", gap: "8px", font: "inherit", fontSize: "12.5px", textAlign: "left", padding: 0, border: 0, background: "none", color: "var(--ink)", cursor: "pointer" }, children: [
|
|
276
|
+
/* @__PURE__ */ jsx(SourceIcon, { source }),
|
|
277
|
+
/* @__PURE__ */ jsx("span", { style: { minWidth: 0, overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap", fontWeight: 530 }, children: title }),
|
|
278
|
+
keyText && /* @__PURE__ */ jsx("span", { style: { ...mono, flexShrink: 0, marginLeft: "auto" }, children: keyText })
|
|
279
|
+
] }),
|
|
280
|
+
account && /* @__PURE__ */ jsx("span", { style: { flexShrink: 0 }, children: /* @__PURE__ */ jsx(AccountChip, { account }) }),
|
|
281
|
+
/* @__PURE__ */ jsx("span", { title: when, style: { fontSize: "11px", color: "var(--ink-3)", minWidth: "26px", textAlign: "right" }, children: ageShort(when) }),
|
|
282
|
+
primary && /* @__PURE__ */ jsx("span", { style: { display: "flex", alignItems: "center", gap: "6px", flexShrink: 0 }, children: primary })
|
|
283
|
+
] }),
|
|
284
|
+
open && /* @__PURE__ */ jsx("div", { style: { padding: "2px 8px 9px 36px", display: "flex", flexDirection: "column", gap: "7px", fontSize: "11.5px", color: "var(--ink-2)" }, children })
|
|
285
|
+
] });
|
|
286
|
+
}
|
|
287
|
+
var Quote = ({ text }) => /* @__PURE__ */ jsxs("div", { style: { fontSize: "12px", borderLeft: "2px solid var(--hair-2)", paddingLeft: "8px", fontStyle: "italic" }, children: [
|
|
288
|
+
"\u201C",
|
|
289
|
+
text,
|
|
290
|
+
"\u201D"
|
|
291
|
+
] });
|
|
292
|
+
function OpenLink({ href, label }) {
|
|
293
|
+
const safe = safeHref(href);
|
|
294
|
+
return safe ? /* @__PURE__ */ jsxs("a", { href: safe, target: "_blank", rel: "noopener noreferrer", style: { color: "var(--ink-2)", textDecoration: "none", borderBottom: "1px dotted var(--ink-3)" }, children: [
|
|
295
|
+
label,
|
|
296
|
+
" \u2197"
|
|
297
|
+
] }) : null;
|
|
298
|
+
}
|
|
299
|
+
var Actions = ({ children }) => /* @__PURE__ */ jsx("div", { style: { display: "flex", alignItems: "center", gap: "8px", flexWrap: "wrap" }, children });
|
|
247
300
|
var Row = ({ item, projects = EMPTY_PROJECTS, acting, forge }) => {
|
|
248
301
|
const [project, setProject] = useState(item.project ?? "");
|
|
249
302
|
const open = item.state === "proposed" || item.state === "failed";
|
|
250
303
|
const needsProject = startsTask(item.kind) && !item.project;
|
|
251
304
|
const op = opFor(item, project);
|
|
252
305
|
const where = item.source === "slack" ? "in" : "on";
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
/* @__PURE__ */
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
] }),
|
|
306
|
+
const s = item.startedSession;
|
|
307
|
+
const go = /* @__PURE__ */ jsx(Btn, { label: item.state === "failed" ? "Retry" : KIND[item.kind].verb, disabled: acting.busy || !op, onClick: () => op && acting.act(item, op, needsProject ? project : void 0) });
|
|
308
|
+
const primary = open ? needsProject ? null : go : item.state === "done" ? s ? /* @__PURE__ */ jsx(Btn, { label: "Open session", onClick: () => forge.openSession(s.project, s.sessionDir) }) : /* @__PURE__ */ jsx("span", { style: { fontSize: "11.5px", color: "var(--green)" }, children: item.kind === "to-task" ? "Sent" : "Done" }) : null;
|
|
309
|
+
return /* @__PURE__ */ jsxs(Line, { source: item.source, keyText: item.issueKey, title: titleFor(item), account: item.account, when: item.when, primary, children: [
|
|
310
|
+
/* @__PURE__ */ jsxs("div", { style: { display: "flex", alignItems: "center", gap: "6px", flexWrap: "wrap" }, children: [
|
|
311
|
+
/* @__PURE__ */ jsx(KindPill, { kind: item.kind }),
|
|
312
|
+
whoOf(item) && /* @__PURE__ */ jsx(Avatar, { who: item.who }),
|
|
313
|
+
/* @__PURE__ */ jsx("span", { children: whoOf(item) ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
314
|
+
item.who,
|
|
315
|
+
" ",
|
|
316
|
+
where,
|
|
317
|
+
" ",
|
|
318
|
+
strong(item.where)
|
|
319
|
+
] }) : strong(item.where) }),
|
|
320
|
+
item.kind === "to-task" && item.targetSession && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
269
321
|
/* @__PURE__ */ jsx(Sep, {}),
|
|
270
|
-
/* @__PURE__ */
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
322
|
+
/* @__PURE__ */ jsxs("span", { children: [
|
|
323
|
+
"goes to ",
|
|
324
|
+
strong(item.targetSession.sessionDir)
|
|
325
|
+
] })
|
|
326
|
+
] }),
|
|
327
|
+
item.project && item.kind !== "to-task" && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
275
328
|
/* @__PURE__ */ jsx(Sep, {}),
|
|
276
|
-
/* @__PURE__ */ jsxs("
|
|
277
|
-
"
|
|
278
|
-
|
|
279
|
-
" \u2197"
|
|
280
|
-
] }),
|
|
281
|
-
item.kind === "to-task" && item.targetSession && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
282
|
-
/* @__PURE__ */ jsx(Sep, {}),
|
|
283
|
-
/* @__PURE__ */ jsxs("span", { children: [
|
|
284
|
-
"goes to ",
|
|
285
|
-
strong(item.targetSession.sessionDir)
|
|
286
|
-
] })
|
|
287
|
-
] }),
|
|
288
|
-
item.project && item.kind !== "to-task" && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
289
|
-
/* @__PURE__ */ jsx(Sep, {}),
|
|
290
|
-
/* @__PURE__ */ jsxs("span", { children: [
|
|
291
|
-
"project ",
|
|
292
|
-
strong(item.project)
|
|
293
|
-
] })
|
|
329
|
+
/* @__PURE__ */ jsxs("span", { children: [
|
|
330
|
+
"project ",
|
|
331
|
+
strong(item.project)
|
|
294
332
|
] })
|
|
333
|
+
] })
|
|
334
|
+
] }),
|
|
335
|
+
item.quote && /* @__PURE__ */ jsx(Quote, { text: item.quote }),
|
|
336
|
+
item.error && /* @__PURE__ */ jsx("div", { style: { color: "var(--red)" }, children: item.error }),
|
|
337
|
+
item.state === "done" && outcome(item),
|
|
338
|
+
/* @__PURE__ */ jsxs(Actions, { children: [
|
|
339
|
+
open && needsProject && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
340
|
+
/* @__PURE__ */ jsx(ProjectPicker, { projects: projectsFor(projects, item.account), value: project, onChange: setProject }),
|
|
341
|
+
go
|
|
295
342
|
] }),
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
343
|
+
/* @__PURE__ */ jsx(OpenLink, { href: item.link, label: `Open in ${sourceOf(item)}` }),
|
|
344
|
+
open && /* @__PURE__ */ jsx(Btn, { label: "Dismiss", style: ghostStyle, disabled: acting.busy, onClick: () => acting.act(item, "dismiss") })
|
|
345
|
+
] })
|
|
346
|
+
] });
|
|
347
|
+
};
|
|
348
|
+
var PENDING_TOKEN = { ci: "--red", review: "--blue", issue: "--green", reply: "--purple" };
|
|
349
|
+
var PendingRow = ({ item, projects = EMPTY_PROJECTS, acting, forge }) => {
|
|
350
|
+
const [project, setProject] = useState(item.project ?? "");
|
|
351
|
+
const token = PENDING_TOKEN[item.kind];
|
|
352
|
+
const target = item.project ?? project;
|
|
353
|
+
const slack = item.kind === "reply";
|
|
354
|
+
const start = /* @__PURE__ */ jsx(Btn, { label: item.kind === "review" ? "Review" : "Start", disabled: acting.busy || !target, onClick: () => acting.startPending(item, item.project ? void 0 : project) });
|
|
355
|
+
const primary = item.targetSession ? /* @__PURE__ */ jsx(Btn, { label: "Open task", onClick: () => forge.openSession(item.targetSession.project, item.targetSession.sessionDir) }) : item.project ? start : null;
|
|
356
|
+
return /* @__PURE__ */ jsxs(Line, { source: item.source, keyText: item.issueKey, title: titleFor(item), account: item.account, when: item.when, primary, children: [
|
|
357
|
+
/* @__PURE__ */ jsxs("div", { style: { display: "flex", alignItems: "center", gap: "6px", flexWrap: "wrap" }, children: [
|
|
358
|
+
/* @__PURE__ */ jsx("span", { style: { fontSize: "10.5px", fontWeight: 600, padding: "2px 7px", borderRadius: "6px", whiteSpace: "nowrap", color: `var(${token})`, background: soft(token, 15) }, children: slack ? "Waiting on you" : item.kind === "ci" ? "CI failing" : item.kind === "review" ? "Review requested" : item.state }),
|
|
359
|
+
slack ? /* @__PURE__ */ jsxs("span", { children: [
|
|
360
|
+
item.who,
|
|
361
|
+
" in ",
|
|
362
|
+
strong(item.where ?? "")
|
|
363
|
+
] }) : /* @__PURE__ */ jsxs("span", { children: [
|
|
364
|
+
item.repo ? strong(item.repo) : null,
|
|
365
|
+
item.repo && item.state ? " \xB7 " : "",
|
|
366
|
+
item.state
|
|
300
367
|
] }),
|
|
301
|
-
item.
|
|
368
|
+
item.project && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
369
|
+
/* @__PURE__ */ jsx(Sep, {}),
|
|
370
|
+
/* @__PURE__ */ jsxs("span", { children: [
|
|
371
|
+
"project ",
|
|
372
|
+
strong(item.project)
|
|
373
|
+
] })
|
|
374
|
+
] })
|
|
302
375
|
] }),
|
|
303
|
-
/* @__PURE__ */
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
item.
|
|
376
|
+
item.quote && /* @__PURE__ */ jsx(Quote, { text: item.quote }),
|
|
377
|
+
/* @__PURE__ */ jsxs(Actions, { children: [
|
|
378
|
+
!item.targetSession && !item.project && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
379
|
+
/* @__PURE__ */ jsx(ProjectPicker, { projects: projectsFor(projects, item.account), value: project, onChange: setProject }),
|
|
380
|
+
start
|
|
381
|
+
] }),
|
|
382
|
+
/* @__PURE__ */ jsx(OpenLink, { href: item.link, label: `Open in ${sourceOf(item)}` }),
|
|
383
|
+
slack && !item.targetSession && /* @__PURE__ */ jsx(Btn, { label: "Research", style: ghostStyle, disabled: acting.busy, onClick: () => acting.researchPending(item) }),
|
|
384
|
+
/* @__PURE__ */ jsx(Btn, { label: "Hide", style: ghostStyle, disabled: acting.busy, onClick: () => acting.hidePending(item) })
|
|
311
385
|
] })
|
|
312
386
|
] });
|
|
313
387
|
};
|
|
@@ -316,6 +390,8 @@ var READING_CSS = `
|
|
|
316
390
|
@keyframes today-pulse { 0%, 100% { opacity: .55 } 50% { opacity: 1 } }
|
|
317
391
|
.today-spin { animation: today-spin .8s linear infinite }
|
|
318
392
|
.today-pulse { animation: today-pulse 1.4s ease-in-out infinite }
|
|
393
|
+
.today-cols { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: 24px; align-items: start }
|
|
394
|
+
@media (max-width: 900px) { .today-cols { grid-template-columns: minmax(0, 1fr) } }
|
|
319
395
|
@media (prefers-reduced-motion: reduce) { .today-spin, .today-pulse { animation: none } }`;
|
|
320
396
|
function useReadingStyles() {
|
|
321
397
|
if (typeof document !== "undefined" && !document.getElementById("today-reading-css")) {
|
|
@@ -341,71 +417,30 @@ function ReadingLine({ reading }) {
|
|
|
341
417
|
accounts.length > 0 && /* @__PURE__ */ jsx("span", { children: "\u2026" })
|
|
342
418
|
] });
|
|
343
419
|
}
|
|
344
|
-
function SkeletonRows() {
|
|
345
|
-
useReadingStyles();
|
|
346
|
-
return /* @__PURE__ */ jsx("div", { "aria-hidden": "true", style: { display: "flex", flexDirection: "column", gap: "6px" }, children: [0, 1, 2].map((n) => /* @__PURE__ */ jsxs("div", { class: "today-pulse", style: { display: "flex", alignItems: "center", gap: "12px", padding: "10px 12px", borderRadius: "10px", background: "var(--elev)", border: "1px solid var(--hair)", animationDelay: `${n * 0.15}s` }, children: [
|
|
347
|
-
/* @__PURE__ */ jsx("div", { style: { width: "30px", height: "30px", borderRadius: "8px", background: "var(--hair)" } }),
|
|
348
|
-
/* @__PURE__ */ jsxs("div", { style: { flex: 1, display: "flex", flexDirection: "column", gap: "6px" }, children: [
|
|
349
|
-
/* @__PURE__ */ jsx("div", { style: { height: "9px", width: `${70 - n * 12}%`, borderRadius: "5px", background: "var(--hair)" } }),
|
|
350
|
-
/* @__PURE__ */ jsx("div", { style: { height: "8px", width: "35%", borderRadius: "5px", background: "var(--hair)" } })
|
|
351
|
-
] })
|
|
352
|
-
] }, n)) });
|
|
353
|
-
}
|
|
354
|
-
function ProblemRow({ group, acting, details = false }) {
|
|
355
|
-
const mine = acting.retrying === group.account;
|
|
356
|
-
return /* @__PURE__ */ jsxs("div", { role: "alert", title: group.reasons.join("\n"), style: { padding: "7px 10px", borderRadius: "10px", fontSize: "12px", color: "var(--ink-2)", background: soft("--orange", 10), border: `1px solid ${soft("--orange", 35)}` }, children: [
|
|
357
|
-
/* @__PURE__ */ jsxs("div", { style: { display: "flex", alignItems: "center", gap: "10px" }, children: [
|
|
358
|
-
/* @__PURE__ */ jsx("span", { style: { color: "var(--orange)" }, children: "\u26A0" }),
|
|
359
|
-
/* @__PURE__ */ jsx("span", { style: { minWidth: 0, overflowWrap: "anywhere" }, children: groupLine(group) }),
|
|
360
|
-
/* @__PURE__ */ jsxs("span", { style: { marginLeft: "auto", display: "flex", gap: "8px", flexShrink: 0 }, children: [
|
|
361
|
-
/* @__PURE__ */ jsx(Btn, { label: mine ? "Reading\u2026" : "Retry", disabled: acting.busy, onClick: () => acting.retry(group.account) }),
|
|
362
|
-
/* @__PURE__ */ jsx(Btn, { label: "Reconnect", style: ghostStyle, disabled: acting.busy, onClick: () => acting.reconnect(group.account) })
|
|
363
|
-
] })
|
|
364
|
-
] }),
|
|
365
|
-
details && /* @__PURE__ */ jsx("ul", { style: { margin: "6px 0 0 22px", padding: 0, color: "var(--ink-3)", fontSize: "11.5px" }, children: group.reasons.map((r) => /* @__PURE__ */ jsx("li", { children: r }, r)) })
|
|
366
|
-
] });
|
|
367
|
-
}
|
|
368
420
|
|
|
369
421
|
// src/banner.tsx
|
|
370
422
|
import { Fragment as Fragment2, jsx as jsx2, jsxs as jsxs2 } from "preact/jsx-runtime";
|
|
371
|
-
var pill = { display: "flex", alignItems: "center", gap: "6px", fontSize: "11.5px", color: "var(--ink-2)", padding: "3px 9px", borderRadius: "20px", background: "var(--elev)", border: "1px solid var(--hair)" };
|
|
372
|
-
function Count({ token, n, label }) {
|
|
373
|
-
if (n === 0) return null;
|
|
374
|
-
return /* @__PURE__ */ jsxs2("span", { style: pill, children: [
|
|
375
|
-
/* @__PURE__ */ jsx2("i", { style: { width: "7px", height: "7px", borderRadius: "50%", background: `var(${token})` } }),
|
|
376
|
-
n,
|
|
377
|
-
" ",
|
|
378
|
-
label
|
|
379
|
-
] });
|
|
380
|
-
}
|
|
381
|
-
function FilterChip({ label, n, on, token, onClick }) {
|
|
382
|
-
const tint = token ?? "--blue";
|
|
383
|
-
return /* @__PURE__ */ jsxs2("button", { type: "button", "aria-pressed": on, onClick, style: { ...pill, font: "inherit", fontSize: "11.5px", cursor: "pointer", color: on ? "var(--ink)" : "var(--ink-2)", borderColor: on ? `var(${tint})` : "var(--hair)", background: on ? soft(tint, 15) : "var(--elev)" }, children: [
|
|
384
|
-
token && /* @__PURE__ */ jsx2("i", { style: { width: "7px", height: "7px", borderRadius: "50%", background: `var(${token})` } }),
|
|
385
|
-
label,
|
|
386
|
-
" \xB7 ",
|
|
387
|
-
n
|
|
388
|
-
] });
|
|
389
|
-
}
|
|
390
|
-
var live = (items) => items.filter((i) => i.state !== "dismissed");
|
|
391
|
-
var done = (items, pick) => items.filter((i) => i.state === "done" && pick(i.kind)).length;
|
|
392
423
|
function shell(children) {
|
|
393
|
-
return /* @__PURE__ */ jsx2("div", { style: { position: "relative", borderRadius: "
|
|
424
|
+
return /* @__PURE__ */ jsx2("div", { style: { position: "relative", borderRadius: "14px", padding: "1px", background: `linear-gradient(135deg, ${soft("--blue", 55)}, ${soft("--purple", 40)} 45%, var(--hair) 80%)`, boxShadow: `0 8px 30px ${soft("--blue", 8)}` }, children: /* @__PURE__ */ jsx2("div", { style: { borderRadius: "13px", background: "radial-gradient(120% 140% at 0% 0%, color-mix(in srgb, var(--blue) 12%, var(--card)) 0%, var(--card) 55%)" }, children }) });
|
|
394
425
|
}
|
|
395
|
-
function Strip({ title, children, actions }) {
|
|
426
|
+
function Strip({ title, children, actions, below }) {
|
|
396
427
|
return shell(
|
|
397
|
-
/* @__PURE__ */ jsxs2(
|
|
398
|
-
/* @__PURE__ */
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
428
|
+
/* @__PURE__ */ jsxs2(Fragment2, { children: [
|
|
429
|
+
/* @__PURE__ */ jsxs2("div", { style: { display: "flex", alignItems: "center", gap: "10px", padding: "8px 14px", fontSize: "12.5px", color: "var(--ink-2)", flexWrap: "wrap" }, children: [
|
|
430
|
+
/* @__PURE__ */ jsx2("span", { style: { color: "var(--orange)" }, children: "\u2600\uFE0E" }),
|
|
431
|
+
/* @__PURE__ */ jsx2("b", { style: { color: "var(--ink)", fontWeight: 600 }, children: title }),
|
|
432
|
+
children,
|
|
433
|
+
/* @__PURE__ */ jsx2("span", { style: { marginLeft: "auto", display: "flex", gap: "8px" }, children: actions })
|
|
434
|
+
] }),
|
|
435
|
+
below && /* @__PURE__ */ jsx2("div", { style: { padding: "0 10px 8px" }, children: below })
|
|
402
436
|
] })
|
|
403
437
|
);
|
|
404
438
|
}
|
|
439
|
+
var small = { ...ghostStyle, border: "1px solid var(--hair-2)", fontSize: "11.5px", padding: "2px 8px", color: "var(--ink)" };
|
|
440
|
+
var linkStyle = { font: "inherit", fontSize: "inherit", padding: 0, border: 0, background: "none", cursor: "pointer" };
|
|
405
441
|
function Banner({ forge }) {
|
|
406
442
|
const { reply, error, reload, hurry } = useDigest(forge);
|
|
407
443
|
const projects = useProjects(forge);
|
|
408
|
-
const [chosen, choose] = useAccountFilter();
|
|
409
444
|
const digest = reply?.digest;
|
|
410
445
|
const acting = useActing(forge, digest?.date, reload, hurry);
|
|
411
446
|
const reading = reply?.reading;
|
|
@@ -415,109 +450,54 @@ function Banner({ forge }) {
|
|
|
415
450
|
"\xB7 ",
|
|
416
451
|
text
|
|
417
452
|
] });
|
|
418
|
-
const notes = notesLine(digest?.notes);
|
|
419
|
-
const note = notes && /* @__PURE__ */ jsxs2("span", { style: { color: "var(--ink-3)" }, children: [
|
|
420
|
-
"\xB7 ",
|
|
421
|
-
notes
|
|
422
|
-
] });
|
|
423
|
-
const problems = groupProblems(digest?.problems ?? []);
|
|
424
|
-
const problemRows = problems.length > 0 && /* @__PURE__ */ jsx2("div", { style: { display: "flex", flexDirection: "column", gap: "6px", marginBottom: "8px" }, children: problems.map((g) => /* @__PURE__ */ jsx2(ProblemRow, { group: g, acting }, g.account)) });
|
|
425
|
-
const problemsLink = problems.length > 0 && /* @__PURE__ */ jsxs2("button", { type: "button", onClick: () => forge.openPage(), style: { font: "inherit", fontSize: "inherit", padding: 0, border: 0, background: "none", cursor: "pointer", color: "var(--orange)" }, children: [
|
|
426
|
-
"\xB7 ",
|
|
427
|
-
problemsLabel(problems.length)
|
|
428
|
-
] });
|
|
429
453
|
if (!reply && !error) return null;
|
|
430
454
|
if (reply && !reply.enabled) {
|
|
431
455
|
return /* @__PURE__ */ jsx2(Strip, { title: "Today", actions: /* @__PURE__ */ jsx2(Btn, { label: "Turn on", style: primaryStyle, disabled: acting.busy, onClick: () => acting.run(() => forge.action("enable")) }), children: /* @__PURE__ */ jsx2("span", { children: "\xB7 Linear, Slack and GitHub each morning" }) });
|
|
432
456
|
}
|
|
433
|
-
if (reply && isReading &&
|
|
434
|
-
return
|
|
435
|
-
/* @__PURE__ */ jsxs2("div", { style: { padding: "14px 18px", display: "flex", flexDirection: "column", gap: "12px" }, children: [
|
|
436
|
-
/* @__PURE__ */ jsxs2("div", { style: { display: "flex", alignItems: "center", gap: "10px" }, children: [
|
|
437
|
-
/* @__PURE__ */ jsx2("span", { style: { color: "var(--orange)" }, children: "\u2600\uFE0E" }),
|
|
438
|
-
/* @__PURE__ */ jsx2(ReadingLine, { reading }),
|
|
439
|
-
/* @__PURE__ */ jsx2("span", { style: { marginLeft: "auto" }, children: refreshBtn })
|
|
440
|
-
] }),
|
|
441
|
-
!digest && /* @__PURE__ */ jsx2(SkeletonRows, {}),
|
|
442
|
-
problemRows
|
|
443
|
-
] })
|
|
444
|
-
);
|
|
457
|
+
if (reply && isReading && !digest) {
|
|
458
|
+
return /* @__PURE__ */ jsx2(Strip, { title: "Today", actions: refreshBtn, children: /* @__PURE__ */ jsx2(ReadingLine, { reading }) });
|
|
445
459
|
}
|
|
446
|
-
if (!reply || !digest
|
|
447
|
-
return /* @__PURE__ */
|
|
448
|
-
!reply ? failure(loadFailedLine(error)) : digest?.error ? failure(failedLine(digest.error)) : digest && /* @__PURE__ */ jsxs2("span", { children: [
|
|
449
|
-
"\xB7 nothing new since ",
|
|
450
|
-
clock(new Date(digest.readAt))
|
|
451
|
-
] }),
|
|
452
|
-
problemsLink,
|
|
453
|
-
note
|
|
454
|
-
] });
|
|
460
|
+
if (!reply || !digest) {
|
|
461
|
+
return /* @__PURE__ */ jsx2(Strip, { title: "Not read yet", actions: refreshBtn, children: error ? failure(loadFailedLine(error)) : /* @__PURE__ */ jsx2("span", { children: "\xB7 use Refresh to read now" }) });
|
|
455
462
|
}
|
|
456
|
-
const
|
|
457
|
-
const
|
|
458
|
-
const
|
|
459
|
-
const
|
|
460
|
-
const
|
|
461
|
-
const
|
|
462
|
-
const
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
/* @__PURE__ */ jsx2(
|
|
467
|
-
|
|
468
|
-
/* @__PURE__ */
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
463
|
+
const pending = reply.pending ?? [];
|
|
464
|
+
const summary = bannerSummary(digest.items, pending);
|
|
465
|
+
const rows = urgentRows(digest.items, pending);
|
|
466
|
+
const problems = groupProblems(digest.problems ?? []);
|
|
467
|
+
const notes = notesLine(digest.notes);
|
|
468
|
+
const status = [isReading ? null : readLine(digest), reply.firstReading ? FIRST_READING_NOTE : null, notes].filter(Boolean).join(" \xB7 ");
|
|
469
|
+
const statusLine = /* @__PURE__ */ jsxs2("div", { style: { display: "flex", alignItems: "center", gap: "8px", fontSize: "11.5px", color: "var(--ink-3)", padding: "2px 6px 0", minWidth: 0 }, children: [
|
|
470
|
+
isReading ? /* @__PURE__ */ jsx2(ReadingLine, { reading }) : /* @__PURE__ */ jsx2("span", { title: status, style: { minWidth: 0, flexShrink: 1, overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }, children: status }),
|
|
471
|
+
digest.error && /* @__PURE__ */ jsx2("span", { style: { color: "var(--red)" }, children: failedLine(digest.error) }),
|
|
472
|
+
problems.length === 1 && /* @__PURE__ */ jsxs2("span", { role: "alert", title: problems[0].reasons.join("\n"), style: { display: "inline-flex", alignItems: "center", gap: "6px", color: "var(--ink-2)" }, children: [
|
|
473
|
+
/* @__PURE__ */ jsx2("span", { style: { color: "var(--orange)" }, children: "\u26A0" }),
|
|
474
|
+
groupLine(problems[0]),
|
|
475
|
+
/* @__PURE__ */ jsx2(Btn, { label: acting.retrying === problems[0].account ? "Reading\u2026" : "Retry", style: small, disabled: acting.busy, onClick: () => acting.retry(problems[0].account) }),
|
|
476
|
+
/* @__PURE__ */ jsx2(Btn, { label: "Reconnect", style: { ...small, ...ghostStyle, padding: "2px 8px" }, disabled: acting.busy, onClick: () => acting.reconnect(problems[0].account) })
|
|
477
|
+
] }),
|
|
478
|
+
problems.length > 1 && /* @__PURE__ */ jsxs2("button", { type: "button", onClick: () => forge.openPage(), style: { ...linkStyle, color: "var(--orange)" }, children: [
|
|
479
|
+
problemsLabel(problems.length),
|
|
480
|
+
" \xB7 Fix on Today \u2192"
|
|
481
|
+
] })
|
|
482
|
+
] });
|
|
483
|
+
return /* @__PURE__ */ jsxs2(
|
|
484
|
+
Strip,
|
|
485
|
+
{
|
|
486
|
+
title: shortDay(/* @__PURE__ */ new Date(), digest.date),
|
|
487
|
+
actions: refreshBtn,
|
|
488
|
+
below: /* @__PURE__ */ jsxs2("div", { style: { display: "flex", flexDirection: "column", gap: "2px" }, children: [
|
|
489
|
+
rows.map((r) => r.kind === "pending" ? /* @__PURE__ */ jsx2(PendingRow, { item: r.item, projects, acting, forge }, r.item.id) : /* @__PURE__ */ jsx2(Row, { item: r.item, projects, acting, forge }, r.item.id)),
|
|
490
|
+
statusLine
|
|
476
491
|
] }),
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
const waiting = seen(items).filter((i) => i.state === "proposed" || i.state === "failed");
|
|
483
|
-
const ready = waiting.filter((i) => opFor(i)).length;
|
|
484
|
-
const acceptAll = () => acting.run(() => forge.action("accept-all", { date: digest.date, ...account ? { account } : {} }));
|
|
485
|
-
return shell(
|
|
486
|
-
/* @__PURE__ */ jsxs2("div", { style: { padding: "16px 18px 12px" }, children: [
|
|
487
|
-
/* @__PURE__ */ jsxs2("div", { style: { display: "flex", alignItems: "center", gap: "12px" }, children: [
|
|
488
|
-
/* @__PURE__ */ jsx2("div", { style: { width: "34px", height: "34px", borderRadius: "10px", display: "grid", placeItems: "center", background: "linear-gradient(160deg, #ffb340, #ff7a1a)", boxShadow: "0 4px 14px rgba(255, 140, 30, .35)", fontSize: "17px" }, children: "\u2600\uFE0E" }),
|
|
489
|
-
/* @__PURE__ */ jsxs2("div", { children: [
|
|
490
|
-
/* @__PURE__ */ jsx2("h3", { style: { margin: 0, fontSize: "15px", fontWeight: 650, letterSpacing: "-.01em" }, children: dayLabel(/* @__PURE__ */ new Date(), digest.date) }),
|
|
491
|
-
/* @__PURE__ */ jsx2("div", { style: { color: "var(--ink-2)", fontSize: "12px", marginTop: "1px" }, children: isReading ? /* @__PURE__ */ jsx2(ReadingLine, { reading }) : readLine(digest) })
|
|
492
|
+
children: [
|
|
493
|
+
/* @__PURE__ */ jsxs2("span", { children: [
|
|
494
|
+
"\xB7 ",
|
|
495
|
+
summaryText(summary),
|
|
496
|
+
" \xB7"
|
|
492
497
|
] }),
|
|
493
|
-
/* @__PURE__ */
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
ready > 0 && /* @__PURE__ */ jsx2(Btn, { label: `Accept ${ready === 1 ? "it" : `the ${ready}`}`, style: primaryStyle, disabled: acting.busy, onClick: acceptAll })
|
|
497
|
-
] })
|
|
498
|
-
] }),
|
|
499
|
-
accounts.length > 1 && /* @__PURE__ */ jsxs2("div", { role: "group", "aria-label": "Account", style: { display: "flex", gap: "6px", marginTop: "12px", flexWrap: "wrap" }, children: [
|
|
500
|
-
/* @__PURE__ */ jsx2(FilterChip, { label: "All", n: live(items).length, on: !account, onClick: () => choose("") }),
|
|
501
|
-
accounts.map((a) => /* @__PURE__ */ jsx2(FilterChip, { label: a, token: accountToken(a), n: inAccount(live(items), a).length, on: account === a, onClick: () => choose(a) }, a))
|
|
502
|
-
] }),
|
|
503
|
-
/* @__PURE__ */ jsxs2("div", { style: { display: "flex", gap: "6px", margin: "14px 0 10px", flexWrap: "wrap" }, children: [
|
|
504
|
-
/* @__PURE__ */ jsx2(Count, { token: "--orange", n: shown.filter((i) => i.kind === "to-task").length, label: "for open tasks" }),
|
|
505
|
-
/* @__PURE__ */ jsx2(Count, { token: "--green", n: shown.filter((i) => i.kind === "issue" || i.kind === "request").length, label: "new tasks" }),
|
|
506
|
-
/* @__PURE__ */ jsx2(Count, { token: "--blue", n: shown.filter((i) => i.kind === "review").length, label: "to review" }),
|
|
507
|
-
/* @__PURE__ */ jsx2(Count, { token: "--purple", n: shown.filter((i) => i.kind === "research").length, label: "researching" }),
|
|
508
|
-
/* @__PURE__ */ jsxs2("span", { style: { ...pill, marginLeft: "auto", borderColor: "transparent", background: "none", color: "var(--ink-3)" }, children: [
|
|
509
|
-
seen(items).length,
|
|
510
|
-
" read \xB7 ",
|
|
511
|
-
seen(items).length - shown.length,
|
|
512
|
-
" dismissed"
|
|
513
|
-
] })
|
|
514
|
-
] }),
|
|
515
|
-
digest.error && /* @__PURE__ */ jsx2("div", { style: { marginBottom: "8px", fontSize: "11.5px", color: "var(--red)" }, children: failedLine(digest.error) }),
|
|
516
|
-
notes && /* @__PURE__ */ jsx2("div", { style: { marginBottom: "8px", fontSize: "11.5px", color: "var(--ink-3)" }, children: notes }),
|
|
517
|
-
problemRows,
|
|
518
|
-
/* @__PURE__ */ jsx2("div", { style: { display: "flex", flexDirection: "column", gap: "6px" }, children: shown.map((i) => /* @__PURE__ */ jsx2(Row, { item: i, projects, acting, forge }, i.id)) }),
|
|
519
|
-
/* @__PURE__ */ jsx2("div", { style: { marginTop: "10px", fontSize: "11.5px", color: "var(--ink-3)" }, children: "Research starts on its own (limited per day). The rest waits for your ok." })
|
|
520
|
-
] })
|
|
498
|
+
/* @__PURE__ */ jsx2("button", { type: "button", onClick: () => forge.openPage(), style: { ...linkStyle, fontWeight: 600, color: "var(--blue)" }, children: "Open Today \u2192" })
|
|
499
|
+
]
|
|
500
|
+
}
|
|
521
501
|
);
|
|
522
502
|
}
|
|
523
503
|
var banner_default = definePanel({ id: "banner", title: "Today", component: Banner });
|