@parallelworks/tandem-web 0.165.0 → 0.166.0
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/components/icons.js +2 -3
- package/lib/notificationRead.js +22 -0
- package/lib/notifications.js +66 -57
- package/package.json +1 -1
- package/routes/_workspace/notifications2.js +261 -218
package/components/icons.js
CHANGED
|
@@ -250,6 +250,5 @@ var ue = f(i.AddUserIcon), de = f(i.RemoveUserIcon), fe = f(i.ArchiveIcon), pe =
|
|
|
250
250
|
i.CommitIcon;
|
|
251
251
|
var _e = f(i.ReleaseIcon), ve = f(i.MegaphoneIcon), ye = f(i.SwapIcon), be = f(i.TrashIcon);
|
|
252
252
|
i.EyeIcon;
|
|
253
|
-
var xe = f(i.SuccessIcon), Se = f(i.CancelIcon), Ce = f(i.AgentIcon);
|
|
254
|
-
|
|
255
|
-
export { p as AddIcon, ue as AddUserIcon, Ce as AgentIcon, J as AlertIcon, fe as ArchiveIcon, ce as AreaIcon, h as AttachmentIcon, m as BoardIcon, g as BranchIcon, A as BucketIcon, _ as CalendarIcon, Se as CancelIcon, k as ChartIcon, y as CheckIcon, b as ChevronDownIcon, x as ChevronRightIcon, v as ClockIcon, S as CloseIcon, j as CloudIcon, le as CodeHostIcon, C as CommentIcon, ie as CycleIcon, w as DownloadIcon, $ as EditIcon, se as EstimateIcon, E as ExpandIcon, D as FileTextIcon, O as FolderIcon, M as GridIcon, N as HistoryIcon, P as InboxIcon, F as KeyIcon, L as LibraryIcon, he as LinkIcon, R as ListViewIcon, z as MailIcon, ve as MegaphoneIcon, B as MigrationIcon, I as MinimizeIcon, V as NotificationIcon, ee as PriorityIcon, U as ProjectIcon, W as PullRequestIcon, _e as ReleaseIcon, de as RemoveUserIcon, me as RenameIcon, G as RepositoryIcon, pe as RestoreIcon, K as SearchIcon, te as SettingsIcon, q as ShieldIcon, Y as ShrinkIcon, ae as SidePanelIcon, c as StatusIcon, xe as SuccessIcon, ye as SwapIcon, X as TagIcon, oe as TimelineIcon, be as TrashIcon, H as TriageIcon, ge as UnlinkIcon, T as UploadIcon, Z as UserIcon, Q as UsersIcon, ne as WebhookIcon, re as WorkerIcon, u as usePriorityNames };
|
|
253
|
+
var xe = f(i.SuccessIcon), Se = f(i.CancelIcon), Ce = f(i.AgentIcon), we = f(i.ArrowRightIcon);
|
|
254
|
+
export { p as AddIcon, ue as AddUserIcon, Ce as AgentIcon, J as AlertIcon, fe as ArchiveIcon, ce as AreaIcon, we as ArrowRightIcon, h as AttachmentIcon, m as BoardIcon, g as BranchIcon, A as BucketIcon, _ as CalendarIcon, Se as CancelIcon, k as ChartIcon, y as CheckIcon, b as ChevronDownIcon, x as ChevronRightIcon, v as ClockIcon, S as CloseIcon, j as CloudIcon, le as CodeHostIcon, C as CommentIcon, ie as CycleIcon, w as DownloadIcon, $ as EditIcon, se as EstimateIcon, E as ExpandIcon, D as FileTextIcon, O as FolderIcon, M as GridIcon, N as HistoryIcon, P as InboxIcon, F as KeyIcon, L as LibraryIcon, he as LinkIcon, R as ListViewIcon, z as MailIcon, ve as MegaphoneIcon, B as MigrationIcon, I as MinimizeIcon, V as NotificationIcon, ee as PriorityIcon, U as ProjectIcon, W as PullRequestIcon, _e as ReleaseIcon, de as RemoveUserIcon, me as RenameIcon, G as RepositoryIcon, pe as RestoreIcon, K as SearchIcon, te as SettingsIcon, q as ShieldIcon, Y as ShrinkIcon, ae as SidePanelIcon, c as StatusIcon, xe as SuccessIcon, ye as SwapIcon, X as TagIcon, oe as TimelineIcon, be as TrashIcon, H as TriageIcon, ge as UnlinkIcon, T as UploadIcon, Z as UserIcon, Q as UsersIcon, ne as WebhookIcon, re as WorkerIcon, u as usePriorityNames };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
// src/lib/notificationRead.ts
|
|
2
|
+
function e(e, t, n, r) {
|
|
3
|
+
let i = 0, a = e.notifications.map((e) => {
|
|
4
|
+
if (t && !t.includes(e.id)) return e;
|
|
5
|
+
if (n && !e.readAt) return i--, {
|
|
6
|
+
...e,
|
|
7
|
+
readAt: r
|
|
8
|
+
};
|
|
9
|
+
if (!n && e.readAt) {
|
|
10
|
+
i++;
|
|
11
|
+
let { readAt: t, ...n } = e;
|
|
12
|
+
return n;
|
|
13
|
+
}
|
|
14
|
+
return e;
|
|
15
|
+
});
|
|
16
|
+
return {
|
|
17
|
+
...e,
|
|
18
|
+
notifications: a,
|
|
19
|
+
unread: n && !t ? 0 : Math.max(0, e.unread + i)
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
export { e as markRead };
|
package/lib/notifications.js
CHANGED
|
@@ -1,75 +1,84 @@
|
|
|
1
1
|
import { basePath as e } from "./base.js";
|
|
2
2
|
import { api as t, unwrap as n } from "../api/client.js";
|
|
3
3
|
import { notificationsQuery as r, pushSettingsQuery as i } from "../api/queries.js";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
4
|
+
import { markRead as a } from "./notificationRead.js";
|
|
5
|
+
import { useCallback as o, useEffect as s, useRef as c, useState as l } from "react";
|
|
6
|
+
import { useTranslations as u } from "use-intl";
|
|
7
|
+
import { useMutation as d, useQuery as f, useQueryClient as p } from "@tanstack/react-query";
|
|
7
8
|
// src/lib/notifications.ts
|
|
8
|
-
function
|
|
9
|
-
let
|
|
10
|
-
|
|
9
|
+
async function m(e, t, n, i) {
|
|
10
|
+
let { queryKey: o } = r(t);
|
|
11
|
+
await e.cancelQueries({ queryKey: o });
|
|
12
|
+
let s = (/* @__PURE__ */ new Date()).toISOString();
|
|
13
|
+
e.setQueryData(o, (e) => e && a(e, n, i, s));
|
|
14
|
+
}
|
|
15
|
+
function h(e) {
|
|
16
|
+
let i = p();
|
|
17
|
+
return d({
|
|
11
18
|
mutationFn: async (r) => {
|
|
12
19
|
n(await t.POST("/api/v1/notifications/read", { body: {
|
|
13
20
|
workspace: e,
|
|
14
21
|
...r && { ids: r }
|
|
15
|
-
} })), await
|
|
22
|
+
} })), await x(r);
|
|
16
23
|
},
|
|
24
|
+
onMutate: (t) => m(i, e, t, !0),
|
|
17
25
|
onSettled: () => i.invalidateQueries({ queryKey: r(e).queryKey })
|
|
18
26
|
});
|
|
19
27
|
}
|
|
20
|
-
function
|
|
21
|
-
let i =
|
|
22
|
-
return
|
|
28
|
+
function g(e) {
|
|
29
|
+
let i = p();
|
|
30
|
+
return d({
|
|
23
31
|
mutationFn: async (r) => n(await t.POST("/api/v1/notifications/unread", { body: {
|
|
24
32
|
workspace: e,
|
|
25
33
|
ids: r
|
|
26
34
|
} })),
|
|
35
|
+
onMutate: (t) => m(i, e, t, !1),
|
|
27
36
|
onSettled: () => i.invalidateQueries({ queryKey: r(e).queryKey })
|
|
28
37
|
});
|
|
29
38
|
}
|
|
30
|
-
function
|
|
31
|
-
let i =
|
|
32
|
-
return
|
|
39
|
+
function _(e) {
|
|
40
|
+
let i = p();
|
|
41
|
+
return d({
|
|
33
42
|
mutationFn: async (r) => {
|
|
34
43
|
n(await t.POST("/api/v1/notifications/archive", { body: {
|
|
35
44
|
workspace: e,
|
|
36
45
|
...r && { ids: r }
|
|
37
|
-
} })), r && await
|
|
46
|
+
} })), r && await x(r);
|
|
38
47
|
},
|
|
39
48
|
onSettled: () => i.invalidateQueries({ queryKey: r(e).queryKey })
|
|
40
49
|
});
|
|
41
50
|
}
|
|
42
|
-
function
|
|
43
|
-
let { data: n } =
|
|
44
|
-
|
|
51
|
+
function v(e, t) {
|
|
52
|
+
let { data: n } = f(r(e)), { mutate: i } = h(e), a = c(/* @__PURE__ */ new Set()), o = t.toUpperCase(), l = (n?.notifications ?? []).filter((e) => !e.readAt && e.identifier.toUpperCase() === o && !a.current.has(e.id)).map((e) => e.id).join(",");
|
|
53
|
+
s(() => {
|
|
45
54
|
if (!l) return;
|
|
46
55
|
let e = l.split(",");
|
|
47
56
|
for (let t of e) a.current.add(t);
|
|
48
57
|
i(e);
|
|
49
58
|
}, [l, i]);
|
|
50
59
|
}
|
|
51
|
-
var
|
|
52
|
-
async function
|
|
53
|
-
if ("serviceWorker" in navigator) return navigator.serviceWorker.getRegistration(
|
|
60
|
+
var y = () => `${e}/`;
|
|
61
|
+
async function b() {
|
|
62
|
+
if ("serviceWorker" in navigator) return navigator.serviceWorker.getRegistration(y());
|
|
54
63
|
}
|
|
55
|
-
async function
|
|
56
|
-
let t = await
|
|
64
|
+
async function x(e) {
|
|
65
|
+
let t = await b();
|
|
57
66
|
for (let n of await t?.getNotifications() ?? []) (!e || e.includes(n.tag)) && n.close();
|
|
58
67
|
}
|
|
59
|
-
var
|
|
60
|
-
function
|
|
68
|
+
var S = () => typeof window < "u" && "serviceWorker" in navigator && "PushManager" in window && "Notification" in window;
|
|
69
|
+
function C(e) {
|
|
61
70
|
let t = e.replace(/-/g, "+").replace(/_/g, "/");
|
|
62
71
|
return Uint8Array.from(atob(t + "=".repeat((4 - t.length % 4) % 4)), (e) => e.charCodeAt(0));
|
|
63
72
|
}
|
|
64
|
-
function
|
|
73
|
+
function w(e, t) {
|
|
65
74
|
let n = e.options.applicationServerKey;
|
|
66
75
|
if (!n) return !1;
|
|
67
76
|
let r = new Uint8Array(n);
|
|
68
77
|
return r.length === t.length && r.every((e, n) => e === t[n]);
|
|
69
78
|
}
|
|
70
|
-
function
|
|
71
|
-
let e =
|
|
72
|
-
return
|
|
79
|
+
function T() {
|
|
80
|
+
let e = u("notifications.push");
|
|
81
|
+
return o(() => ({
|
|
73
82
|
title: e.raw("title"),
|
|
74
83
|
decision_requested: e.raw("decision_requested"),
|
|
75
84
|
assigned: e.raw("assigned"),
|
|
@@ -83,64 +92,64 @@ function C() {
|
|
|
83
92
|
fallback: e.raw("fallback")
|
|
84
93
|
}), [e]);
|
|
85
94
|
}
|
|
86
|
-
async function
|
|
87
|
-
await navigator.serviceWorker.register(`${e}/sw.js`, { scope:
|
|
95
|
+
async function E(r, i) {
|
|
96
|
+
await navigator.serviceWorker.register(`${e}/sw.js`, { scope: y() });
|
|
88
97
|
let a = await navigator.serviceWorker.ready;
|
|
89
98
|
a.active?.postMessage({
|
|
90
99
|
type: "messages",
|
|
91
100
|
messages: i
|
|
92
101
|
});
|
|
93
|
-
let o =
|
|
94
|
-
s && !
|
|
102
|
+
let o = C(r), s = await a.pushManager.getSubscription();
|
|
103
|
+
s && !w(s, o) && (await s.unsubscribe(), s = null), s ??= await a.pushManager.subscribe({
|
|
95
104
|
userVisibleOnly: !0,
|
|
96
105
|
applicationServerKey: o
|
|
97
106
|
}), n(await t.POST("/api/v1/push/subscriptions", { body: { endpoint: s.endpoint } }));
|
|
98
107
|
}
|
|
99
|
-
function
|
|
100
|
-
let { data: e } =
|
|
101
|
-
if (!
|
|
108
|
+
function D() {
|
|
109
|
+
let { data: e } = f(i), n = T(), [r, a] = l("off"), [c, u] = l(!1), d = o(async () => {
|
|
110
|
+
if (!S()) return a("unsupported");
|
|
102
111
|
if (!e) return;
|
|
103
|
-
if (!e.enabled) return
|
|
104
|
-
if (Notification.permission === "denied") return
|
|
105
|
-
let t = await (await
|
|
106
|
-
|
|
112
|
+
if (!e.enabled) return a("unavailable");
|
|
113
|
+
if (Notification.permission === "denied") return a("denied");
|
|
114
|
+
let t = await (await b())?.pushManager.getSubscription();
|
|
115
|
+
a(t && Notification.permission === "granted" ? "on" : "off");
|
|
107
116
|
}, [e]);
|
|
108
|
-
return
|
|
109
|
-
|
|
110
|
-
}, [
|
|
117
|
+
return s(() => {
|
|
118
|
+
d();
|
|
119
|
+
}, [d]), {
|
|
111
120
|
state: r,
|
|
112
|
-
pending:
|
|
113
|
-
enable:
|
|
121
|
+
pending: c,
|
|
122
|
+
enable: o(async () => {
|
|
114
123
|
if (e?.publicKey) {
|
|
115
124
|
u(!0);
|
|
116
125
|
try {
|
|
117
|
-
await Notification.requestPermission() === "granted" && await
|
|
126
|
+
await Notification.requestPermission() === "granted" && await E(e.publicKey, n());
|
|
118
127
|
} finally {
|
|
119
|
-
u(!1), await
|
|
128
|
+
u(!1), await d();
|
|
120
129
|
}
|
|
121
130
|
}
|
|
122
131
|
}, [
|
|
123
132
|
e,
|
|
124
133
|
n,
|
|
125
|
-
|
|
134
|
+
d
|
|
126
135
|
]),
|
|
127
|
-
disable:
|
|
136
|
+
disable: o(async () => {
|
|
128
137
|
u(!0);
|
|
129
138
|
try {
|
|
130
|
-
let e = await (await
|
|
139
|
+
let e = await (await b())?.pushManager.getSubscription();
|
|
131
140
|
e && (await t.DELETE("/api/v1/push/subscriptions", { params: { query: { endpoint: e.endpoint } } }), await e.unsubscribe());
|
|
132
141
|
} finally {
|
|
133
|
-
u(!1), await
|
|
142
|
+
u(!1), await d();
|
|
134
143
|
}
|
|
135
|
-
}, [
|
|
144
|
+
}, [d])
|
|
136
145
|
};
|
|
137
146
|
}
|
|
138
|
-
function
|
|
139
|
-
let { data: e } =
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
n && await n.pushManager.getSubscription() && await
|
|
147
|
+
function O() {
|
|
148
|
+
let { data: e } = f(i), t = T();
|
|
149
|
+
s(() => {
|
|
150
|
+
S() && e?.enabled && e.publicKey && Notification.permission === "granted" && b().then(async (n) => {
|
|
151
|
+
n && await n.pushManager.getSubscription() && await E(e.publicKey, t());
|
|
143
152
|
}).catch(() => {});
|
|
144
153
|
}, [e, t]);
|
|
145
154
|
}
|
|
146
|
-
export {
|
|
155
|
+
export { _ as useArchiveNotifications, D as usePush, O as usePushSync, v as useReadIssueNotifications, h as useReadNotifications, g as useUnreadNotifications };
|
package/package.json
CHANGED
|
@@ -4,23 +4,23 @@ import { Route as r } from "./notifications.js";
|
|
|
4
4
|
import { issueDecisionsQuery as i, issueQuery as a, notificationsQuery as o, teamsQuery as s } from "../../api/queries.js";
|
|
5
5
|
import { parseApproval as c } from "../../lib/approval.js";
|
|
6
6
|
import { copyItem as l, useLinkItems as u } from "../../lib/menus.js";
|
|
7
|
-
import { ArchiveIcon as d,
|
|
8
|
-
import { usePeople as
|
|
9
|
-
import { PersonHoverCard as
|
|
10
|
-
import { Editor as
|
|
11
|
-
import { DecisionCard as
|
|
7
|
+
import { ArchiveIcon as d, ArrowRightIcon as f, CheckIcon as p, CodeHostIcon as m, CommentIcon as h, FileTextIcon as g, InboxIcon as _, PriorityIcon as v, ProjectIcon as y, StatusIcon as b, UserIcon as x, usePriorityNames as S } from "../../components/icons.js";
|
|
8
|
+
import { usePeople as C } from "../../lib/people.js";
|
|
9
|
+
import { PersonHoverCard as w } from "../../components/PersonHoverCard.js";
|
|
10
|
+
import { Editor as T } from "../../components/Editor.js";
|
|
11
|
+
import { DecisionCard as E } from "../../components/AgentWork.js";
|
|
12
12
|
import { useShortcuts as ee } from "../../lib/shortcuts.js";
|
|
13
13
|
import { useArchiveNotifications as te, useReadNotifications as ne, useUnreadNotifications as re } from "../../lib/notifications.js";
|
|
14
|
-
import { plainText as
|
|
15
|
-
import { Avatar as
|
|
16
|
-
import { useEffect as ie, useMemo as
|
|
17
|
-
import { useTranslations as
|
|
18
|
-
import { Fragment as
|
|
19
|
-
import { useQuery as
|
|
20
|
-
import { ListFilterMenu as
|
|
14
|
+
import { plainText as D } from "../../lib/plainText.js";
|
|
15
|
+
import { Avatar as O, Button as k, Card as A, EmptyState as j, IconButton as M, RelativeTime as N, buttonClasses as P, menuDivider as F, useOpenMenu as I } from "@parallelworks/ui";
|
|
16
|
+
import { useEffect as ie, useMemo as L, useRef as ae, useState as oe } from "react";
|
|
17
|
+
import { useTranslations as R } from "use-intl";
|
|
18
|
+
import { Fragment as z, jsx as B, jsxs as V } from "react/jsx-runtime";
|
|
19
|
+
import { useQuery as H, useSuspenseQuery as se } from "@tanstack/react-query";
|
|
20
|
+
import { ListFilterMenu as ce, useListView as U } from "@parallelworks/ui/list";
|
|
21
21
|
// src/routes/$workspace/notifications.tsx?tsr-split=component
|
|
22
|
-
var
|
|
23
|
-
function
|
|
22
|
+
var W = (...e) => e.filter(Boolean).join(" ");
|
|
23
|
+
function le(e, t) {
|
|
24
24
|
let n = /* @__PURE__ */ new Map();
|
|
25
25
|
for (let r of t) {
|
|
26
26
|
let t = r.projectId ? "project" : r.documentId ? "doc" : "issue", i = r.projectId ? `project:${r.projectId}` : r.documentId ? `doc:${r.documentId}` : r.identifier, a = n.get(i);
|
|
@@ -40,7 +40,7 @@ function H(e, t) {
|
|
|
40
40
|
}
|
|
41
41
|
return [...n.values()];
|
|
42
42
|
}
|
|
43
|
-
var
|
|
43
|
+
var G = {
|
|
44
44
|
decisions: ["decision_requested"],
|
|
45
45
|
assigned: ["assigned"],
|
|
46
46
|
comments: ["commented"],
|
|
@@ -49,9 +49,9 @@ var U = {
|
|
|
49
49
|
updates: ["update_posted"],
|
|
50
50
|
reminders: ["reminder"],
|
|
51
51
|
mentions: ["mentioned"]
|
|
52
|
-
},
|
|
53
|
-
function
|
|
54
|
-
let n =
|
|
52
|
+
}, K = (e) => e.reason === "reminder" && e.excerpt ? /* @__PURE__ */ new Date(`${e.excerpt}T00:00:00`) : /* @__PURE__ */ new Date(0), q = (e) => e.slice(0, e.lastIndexOf("-"));
|
|
53
|
+
function ue(e, t) {
|
|
54
|
+
let n = R("notifications"), r = L(() => {
|
|
55
55
|
let e = [{
|
|
56
56
|
key: "state",
|
|
57
57
|
label: n("show"),
|
|
@@ -63,11 +63,11 @@ function ce(e, t) {
|
|
|
63
63
|
}, {
|
|
64
64
|
key: "kind",
|
|
65
65
|
label: n("kind"),
|
|
66
|
-
options: Object.keys(
|
|
66
|
+
options: Object.keys(G).map((e) => ({
|
|
67
67
|
value: e,
|
|
68
68
|
label: n(`kinds.${e}`)
|
|
69
69
|
})),
|
|
70
|
-
matches: (e, t) => t.some((t) =>
|
|
70
|
+
matches: (e, t) => t.some((t) => G[t].includes(e.reason))
|
|
71
71
|
}], r = t.filter((e) => !e.archivedAt);
|
|
72
72
|
return r.length > 1 && e.push({
|
|
73
73
|
key: "team",
|
|
@@ -76,21 +76,21 @@ function ce(e, t) {
|
|
|
76
76
|
value: e.key,
|
|
77
77
|
label: e.name
|
|
78
78
|
})),
|
|
79
|
-
matches: (e, t) => !!e.identifier && t.includes(
|
|
79
|
+
matches: (e, t) => !!e.identifier && t.includes(q(e.identifier))
|
|
80
80
|
}), e;
|
|
81
81
|
}, [n, t]);
|
|
82
|
-
return
|
|
82
|
+
return U({
|
|
83
83
|
storageKey: `notifications:${e}`,
|
|
84
84
|
columns: [],
|
|
85
85
|
facets: r
|
|
86
86
|
});
|
|
87
87
|
}
|
|
88
|
-
function
|
|
89
|
-
let { workspace: t } = r.useParams(), { issue: i } = r.useSearch(), a =
|
|
88
|
+
function J() {
|
|
89
|
+
let { workspace: t } = r.useParams(), { issue: i } = r.useSearch(), a = R("notifications"), c = n(), { data: { notifications: l, unread: u } } = se(o(t));
|
|
90
90
|
e(u > 0 ? `${a("title")} (${u})` : a("title"));
|
|
91
|
-
let
|
|
92
|
-
let e = l.filter((e) => (x.length === 0 || x.some((t) =>
|
|
93
|
-
return
|
|
91
|
+
let f = ne(t), m = re(t), h = te(t), { data: g = [] } = H(s(t)), v = ue(t, g), y = v.activeFilterCount > 0, b = (v.filters.state ?? []).includes("unread"), x = v.filters.kind ?? [], S = v.filters.team ?? [], C = L(() => {
|
|
92
|
+
let e = l.filter((e) => (x.length === 0 || x.some((t) => G[t]?.includes(e.reason))) && (S.length === 0 || !!e.identifier && S.includes(q(e.identifier))));
|
|
93
|
+
return le(t, e).filter((e) => !b || e.unread.length > 0 || e.key === i);
|
|
94
94
|
}, [
|
|
95
95
|
t,
|
|
96
96
|
l,
|
|
@@ -98,144 +98,144 @@ function K() {
|
|
|
98
98
|
x,
|
|
99
99
|
S,
|
|
100
100
|
i
|
|
101
|
-
]), w = C.findIndex((e) => e.key === i),
|
|
101
|
+
]), w = C.findIndex((e) => e.key === i), T = w >= 0 ? C[w] : void 0, [E, D] = oe(/* @__PURE__ */ new Set()), O = ae(null), A = L(() => C.filter((e) => E.has(e.key)), [C, E]), N = (e) => {
|
|
102
102
|
c({
|
|
103
103
|
to: "/$workspace/notifications",
|
|
104
104
|
params: { workspace: t },
|
|
105
105
|
search: e ? { issue: e.key } : {},
|
|
106
106
|
replace: !0
|
|
107
|
-
}), e && e.unread.length > 0 &&
|
|
108
|
-
},
|
|
107
|
+
}), e && e.unread.length > 0 && f.mutate(e.unread);
|
|
108
|
+
}, P = (e) => {
|
|
109
109
|
let t = e.flatMap((e) => e.unread);
|
|
110
|
-
t.length > 0 ?
|
|
111
|
-
},
|
|
112
|
-
if (
|
|
110
|
+
t.length > 0 ? f.mutate(t) : m.mutate(e.flatMap((e) => e.items.map((e) => e.id)));
|
|
111
|
+
}, F = (e) => {
|
|
112
|
+
if (h.mutate(e.flatMap((e) => e.items.map((e) => e.id))), D(/* @__PURE__ */ new Set()), T && e.includes(T)) {
|
|
113
113
|
let t = C.filter((t) => !e.includes(t));
|
|
114
|
-
|
|
114
|
+
N(t[t.findIndex((e) => C.indexOf(e) > w)] ?? t.at(-1));
|
|
115
115
|
}
|
|
116
|
-
},
|
|
116
|
+
}, I = (e) => c({ to: e.href }), U = A.length > 0 ? A : T ? [T] : [], K = (e) => D((t) => {
|
|
117
117
|
let n = new Set(t);
|
|
118
118
|
return n.has(e.key) ? n.delete(e.key) : n.add(e.key), n;
|
|
119
|
-
}),
|
|
119
|
+
}), J = (e, t) => {
|
|
120
120
|
let [n, r] = e < t ? [e, t] : [t, e];
|
|
121
|
-
|
|
122
|
-
},
|
|
121
|
+
D(new Set(C.slice(n, r + 1).map((e) => e.key)));
|
|
122
|
+
}, Y = (e, t) => {
|
|
123
123
|
let n = C.indexOf(t);
|
|
124
|
-
e.metaKey || e.ctrlKey ? (
|
|
125
|
-
},
|
|
124
|
+
e.metaKey || e.ctrlKey ? (K(t), O.current = n) : e.shiftKey ? J(O.current ?? (w >= 0 ? w : n), n) : (D(/* @__PURE__ */ new Set()), O.current = n, N(t));
|
|
125
|
+
}, X = (e, t) => {
|
|
126
126
|
let n = Math.min(Math.max(w + e, 0), C.length - 1);
|
|
127
|
-
t && ((
|
|
127
|
+
t && ((O.current === null || E.size === 0) && (O.current = Math.max(w, 0)), J(O.current, n)), N(C[n]);
|
|
128
128
|
};
|
|
129
129
|
ee({
|
|
130
|
-
j: () =>
|
|
131
|
-
k: () =>
|
|
132
|
-
J: () =>
|
|
133
|
-
K: () =>
|
|
134
|
-
ArrowDown: (e) =>
|
|
135
|
-
ArrowUp: (e) =>
|
|
130
|
+
j: () => X(1, !1),
|
|
131
|
+
k: () => X(-1, !1),
|
|
132
|
+
J: () => X(1, !0),
|
|
133
|
+
K: () => X(-1, !0),
|
|
134
|
+
ArrowDown: (e) => X(1, e.shiftKey),
|
|
135
|
+
ArrowUp: (e) => X(-1, e.shiftKey),
|
|
136
136
|
x: () => {
|
|
137
|
-
|
|
137
|
+
T && (K(T), O.current = w);
|
|
138
138
|
},
|
|
139
|
-
Enter: () =>
|
|
140
|
-
e: () =>
|
|
141
|
-
u: () =>
|
|
142
|
-
Escape: () =>
|
|
139
|
+
Enter: () => T && I(T),
|
|
140
|
+
e: () => U.length > 0 && F(U),
|
|
141
|
+
u: () => U.length > 0 && P(U),
|
|
142
|
+
Escape: () => E.size > 0 ? D(/* @__PURE__ */ new Set()) : N(void 0)
|
|
143
143
|
}), ie(() => {
|
|
144
|
-
document.getElementById(`inbox-${
|
|
145
|
-
}, [
|
|
146
|
-
let
|
|
147
|
-
select:
|
|
148
|
-
toggleRead:
|
|
149
|
-
archiveGroups:
|
|
150
|
-
openIssue:
|
|
151
|
-
clickRow:
|
|
152
|
-
targetsOf: (e) =>
|
|
144
|
+
document.getElementById(`inbox-${T?.key}`)?.scrollIntoView({ block: "nearest" });
|
|
145
|
+
}, [T]);
|
|
146
|
+
let Z = {
|
|
147
|
+
select: N,
|
|
148
|
+
toggleRead: P,
|
|
149
|
+
archiveGroups: F,
|
|
150
|
+
openIssue: I,
|
|
151
|
+
clickRow: Y,
|
|
152
|
+
targetsOf: (e) => E.has(e.key) ? A : (D(/* @__PURE__ */ new Set()), [e])
|
|
153
153
|
};
|
|
154
|
-
return /* @__PURE__ */
|
|
154
|
+
return /* @__PURE__ */ V("div", {
|
|
155
155
|
className: "flex h-full flex-col",
|
|
156
156
|
children: [
|
|
157
|
-
/* @__PURE__ */
|
|
157
|
+
/* @__PURE__ */ V("header", {
|
|
158
158
|
className: "@container flex min-h-12 shrink-0 flex-wrap items-center gap-2 border-b border-border px-4 py-2 md:px-5",
|
|
159
159
|
children: [
|
|
160
|
-
/* @__PURE__ */
|
|
160
|
+
/* @__PURE__ */ B("h1", {
|
|
161
161
|
className: "text-sm font-semibold",
|
|
162
162
|
children: a("title")
|
|
163
163
|
}),
|
|
164
|
-
/* @__PURE__ */
|
|
164
|
+
/* @__PURE__ */ B("span", {
|
|
165
165
|
className: "min-w-0 flex-1 truncate text-xs text-muted-foreground",
|
|
166
166
|
children: a("unreadCount", { count: u })
|
|
167
167
|
}),
|
|
168
|
-
/* @__PURE__ */
|
|
169
|
-
u > 0 && /* @__PURE__ */
|
|
168
|
+
/* @__PURE__ */ B(ce, { view: v }),
|
|
169
|
+
u > 0 && /* @__PURE__ */ V(z, { children: [/* @__PURE__ */ B(k, {
|
|
170
170
|
type: "button",
|
|
171
171
|
size: "sm",
|
|
172
|
-
loading:
|
|
173
|
-
onClick: () =>
|
|
172
|
+
loading: f.isPending,
|
|
173
|
+
onClick: () => f.mutate(void 0),
|
|
174
174
|
className: "@max-3xl:hidden",
|
|
175
175
|
children: a("markAllRead")
|
|
176
|
-
}), /* @__PURE__ */
|
|
177
|
-
icon: /* @__PURE__ */
|
|
176
|
+
}), /* @__PURE__ */ B(M, {
|
|
177
|
+
icon: /* @__PURE__ */ B(p, {}),
|
|
178
178
|
label: a("markAllRead"),
|
|
179
179
|
size: "sm",
|
|
180
|
-
disabled:
|
|
181
|
-
onClick: () =>
|
|
180
|
+
disabled: f.isPending,
|
|
181
|
+
onClick: () => f.mutate(void 0),
|
|
182
182
|
className: "@3xl:hidden"
|
|
183
183
|
})] }),
|
|
184
|
-
C.some((e) => e.unread.length === 0) && /* @__PURE__ */
|
|
184
|
+
C.some((e) => e.unread.length === 0) && /* @__PURE__ */ V(z, { children: [/* @__PURE__ */ B(k, {
|
|
185
185
|
type: "button",
|
|
186
186
|
size: "sm",
|
|
187
|
-
loading:
|
|
188
|
-
onClick: () =>
|
|
187
|
+
loading: h.isPending,
|
|
188
|
+
onClick: () => h.mutate(void 0),
|
|
189
189
|
className: "@max-3xl:hidden",
|
|
190
190
|
children: a("archiveRead")
|
|
191
|
-
}), /* @__PURE__ */
|
|
192
|
-
icon: /* @__PURE__ */
|
|
191
|
+
}), /* @__PURE__ */ B(M, {
|
|
192
|
+
icon: /* @__PURE__ */ B(d, {}),
|
|
193
193
|
label: a("archiveRead"),
|
|
194
194
|
size: "sm",
|
|
195
|
-
disabled:
|
|
196
|
-
onClick: () =>
|
|
195
|
+
disabled: h.isPending,
|
|
196
|
+
onClick: () => h.mutate(void 0),
|
|
197
197
|
className: "@3xl:hidden"
|
|
198
198
|
})] })
|
|
199
199
|
]
|
|
200
200
|
}),
|
|
201
|
-
|
|
201
|
+
A.length > 0 && /* @__PURE__ */ V("div", {
|
|
202
202
|
className: "flex min-h-9 shrink-0 flex-wrap items-center gap-x-3 gap-y-1 border-b border-border bg-human-soft px-4 py-1 text-xs md:px-5",
|
|
203
203
|
children: [
|
|
204
|
-
/* @__PURE__ */
|
|
204
|
+
/* @__PURE__ */ B("span", {
|
|
205
205
|
className: "font-medium text-human",
|
|
206
|
-
children: a("selected", { count:
|
|
206
|
+
children: a("selected", { count: A.length })
|
|
207
207
|
}),
|
|
208
|
-
|
|
208
|
+
A.length < C.length && /* @__PURE__ */ B("button", {
|
|
209
209
|
type: "button",
|
|
210
|
-
onClick: () =>
|
|
210
|
+
onClick: () => D(new Set(C.map((e) => e.key))),
|
|
211
211
|
className: "hover:underline",
|
|
212
212
|
children: a("selectAll", { count: C.length })
|
|
213
213
|
}),
|
|
214
|
-
/* @__PURE__ */
|
|
214
|
+
/* @__PURE__ */ V("div", {
|
|
215
215
|
className: "ml-auto flex items-center gap-1.5",
|
|
216
216
|
children: [
|
|
217
|
-
/* @__PURE__ */
|
|
217
|
+
/* @__PURE__ */ B(k, {
|
|
218
218
|
type: "button",
|
|
219
219
|
size: "sm",
|
|
220
|
-
onClick: () =>
|
|
221
|
-
disabled:
|
|
220
|
+
onClick: () => f.mutate(A.flatMap((e) => e.unread)),
|
|
221
|
+
disabled: A.every((e) => e.unread.length === 0),
|
|
222
222
|
children: a("markRead")
|
|
223
223
|
}),
|
|
224
|
-
/* @__PURE__ */
|
|
224
|
+
/* @__PURE__ */ B(k, {
|
|
225
225
|
type: "button",
|
|
226
226
|
size: "sm",
|
|
227
|
-
onClick: () =>
|
|
227
|
+
onClick: () => m.mutate(A.flatMap((e) => e.items.map((e) => e.id))),
|
|
228
228
|
children: a("markUnread")
|
|
229
229
|
}),
|
|
230
|
-
/* @__PURE__ */
|
|
230
|
+
/* @__PURE__ */ B(k, {
|
|
231
231
|
type: "button",
|
|
232
232
|
size: "sm",
|
|
233
|
-
onClick: () =>
|
|
233
|
+
onClick: () => F(A),
|
|
234
234
|
children: a("archive")
|
|
235
235
|
}),
|
|
236
|
-
/* @__PURE__ */
|
|
236
|
+
/* @__PURE__ */ B("button", {
|
|
237
237
|
type: "button",
|
|
238
|
-
onClick: () =>
|
|
238
|
+
onClick: () => D(/* @__PURE__ */ new Set()),
|
|
239
239
|
className: "shrink-0 px-1 hover:underline",
|
|
240
240
|
children: a("clear")
|
|
241
241
|
})
|
|
@@ -243,43 +243,43 @@ function K() {
|
|
|
243
243
|
})
|
|
244
244
|
]
|
|
245
245
|
}),
|
|
246
|
-
C.length === 0 ? /* @__PURE__ */
|
|
246
|
+
C.length === 0 ? /* @__PURE__ */ B("div", {
|
|
247
247
|
className: "min-h-0 flex-1 overflow-y-auto p-6",
|
|
248
|
-
children: y ? /* @__PURE__ */
|
|
249
|
-
icon: /* @__PURE__ */
|
|
248
|
+
children: y ? /* @__PURE__ */ B(j, {
|
|
249
|
+
icon: /* @__PURE__ */ B(_, {}),
|
|
250
250
|
title: a("noneMatch"),
|
|
251
|
-
action: /* @__PURE__ */
|
|
251
|
+
action: /* @__PURE__ */ B(k, {
|
|
252
252
|
type: "button",
|
|
253
253
|
size: "sm",
|
|
254
254
|
onClick: v.clearFilters,
|
|
255
255
|
children: a("showEverything")
|
|
256
256
|
})
|
|
257
|
-
}) : /* @__PURE__ */
|
|
258
|
-
icon: /* @__PURE__ */
|
|
257
|
+
}) : /* @__PURE__ */ B(j, {
|
|
258
|
+
icon: /* @__PURE__ */ B(_, {}),
|
|
259
259
|
title: a("emptyTitle"),
|
|
260
260
|
description: a("emptyDescription")
|
|
261
261
|
})
|
|
262
|
-
}) : /* @__PURE__ */
|
|
262
|
+
}) : /* @__PURE__ */ V("div", {
|
|
263
263
|
className: "flex min-h-0 flex-1",
|
|
264
|
-
children: [/* @__PURE__ */
|
|
264
|
+
children: [/* @__PURE__ */ B("ul", {
|
|
265
265
|
"aria-label": a("title"),
|
|
266
|
-
className:
|
|
267
|
-
children: C.map((e) => /* @__PURE__ */
|
|
266
|
+
className: W("min-h-0 min-w-0 flex-1 flex-col overflow-y-auto px-2 py-2 md:flex md:max-w-md md:border-r md:border-border", T ? "hidden" : "flex"),
|
|
267
|
+
children: C.map((e) => /* @__PURE__ */ B(de, {
|
|
268
268
|
workspace: t,
|
|
269
269
|
group: e,
|
|
270
|
-
selected: e ===
|
|
271
|
-
picked:
|
|
272
|
-
actions:
|
|
270
|
+
selected: e === T,
|
|
271
|
+
picked: E.has(e.key),
|
|
272
|
+
actions: Z
|
|
273
273
|
}, e.key))
|
|
274
|
-
}), /* @__PURE__ */
|
|
275
|
-
className:
|
|
276
|
-
children:
|
|
274
|
+
}), /* @__PURE__ */ B("div", {
|
|
275
|
+
className: W("min-w-0 flex-1 overflow-y-auto md:block", T ? "block" : "hidden"),
|
|
276
|
+
children: T ? /* @__PURE__ */ B(Q, {
|
|
277
277
|
workspace: t,
|
|
278
|
-
group:
|
|
279
|
-
actions:
|
|
280
|
-
}) : /* @__PURE__ */
|
|
278
|
+
group: T,
|
|
279
|
+
actions: Z
|
|
280
|
+
}) : /* @__PURE__ */ B("div", {
|
|
281
281
|
className: "px-6 py-24",
|
|
282
|
-
children: /* @__PURE__ */
|
|
282
|
+
children: /* @__PURE__ */ B(j, {
|
|
283
283
|
title: a("noneSelected"),
|
|
284
284
|
description: a("shortcuts")
|
|
285
285
|
})
|
|
@@ -289,8 +289,8 @@ function K() {
|
|
|
289
289
|
]
|
|
290
290
|
});
|
|
291
291
|
}
|
|
292
|
-
function
|
|
293
|
-
let t =
|
|
292
|
+
function Y(e) {
|
|
293
|
+
let t = R("notifications"), n = u();
|
|
294
294
|
return (r) => {
|
|
295
295
|
let [i] = r;
|
|
296
296
|
return [
|
|
@@ -305,22 +305,22 @@ function q(e) {
|
|
|
305
305
|
onClick: () => e.archiveGroups(r)
|
|
306
306
|
},
|
|
307
307
|
...r.length === 1 && i ? [
|
|
308
|
-
|
|
308
|
+
F,
|
|
309
309
|
...n(i.href),
|
|
310
310
|
...i.identifier ? [l(t("copyId"), i.identifier)] : []
|
|
311
311
|
] : []
|
|
312
312
|
];
|
|
313
313
|
};
|
|
314
314
|
}
|
|
315
|
-
function
|
|
316
|
-
let { actorName: t } =
|
|
315
|
+
function X(e) {
|
|
316
|
+
let { actorName: t } = C(e);
|
|
317
317
|
return (e) => e.actor.kind === "agent" && e.agentName ? e.agentName : t(e.actor);
|
|
318
318
|
}
|
|
319
|
-
function
|
|
320
|
-
let o =
|
|
321
|
-
return /* @__PURE__ */
|
|
319
|
+
function de({ workspace: e, group: n, selected: r, picked: i, actions: a }) {
|
|
320
|
+
let o = R("notifications"), { avatarOf: s } = C(e), c = X(e), l = I(), u = Y(a), d = n.items[0], f = c(d), p = n.unread.length > 0;
|
|
321
|
+
return /* @__PURE__ */ B("li", {
|
|
322
322
|
id: `inbox-${n.key}`,
|
|
323
|
-
children: /* @__PURE__ */
|
|
323
|
+
children: /* @__PURE__ */ V(t, {
|
|
324
324
|
to: "/$workspace/notifications",
|
|
325
325
|
params: { workspace: e },
|
|
326
326
|
search: { issue: n.key },
|
|
@@ -330,89 +330,132 @@ function le({ workspace: e, group: n, selected: r, picked: i, actions: a }) {
|
|
|
330
330
|
},
|
|
331
331
|
onContextMenu: (e) => l(e, u(a.targetsOf(n))),
|
|
332
332
|
"aria-current": r || void 0,
|
|
333
|
-
className:
|
|
333
|
+
className: W("relative flex gap-3 px-2 py-2.5 select-none", i ? "bg-human-soft" : W("rounded-md hover:bg-muted", r && "bg-muted")),
|
|
334
334
|
children: [
|
|
335
|
-
i && /* @__PURE__ */
|
|
335
|
+
i && /* @__PURE__ */ V(z, { children: [/* @__PURE__ */ B("span", {
|
|
336
336
|
className: "absolute inset-y-0 left-0 w-0.5 bg-human",
|
|
337
337
|
"aria-hidden": !0
|
|
338
|
-
}), /* @__PURE__ */
|
|
338
|
+
}), /* @__PURE__ */ B("span", {
|
|
339
339
|
className: "sr-only",
|
|
340
340
|
children: o("picked")
|
|
341
341
|
})] }),
|
|
342
|
-
/* @__PURE__ */
|
|
342
|
+
/* @__PURE__ */ B("span", {
|
|
343
343
|
className: "flex w-2 shrink-0 justify-center pt-2.5",
|
|
344
|
-
children: p && /* @__PURE__ */
|
|
344
|
+
children: p && /* @__PURE__ */ B("span", {
|
|
345
345
|
role: "img",
|
|
346
346
|
"aria-label": o("unread"),
|
|
347
347
|
className: "size-2 rounded-full bg-primary"
|
|
348
348
|
})
|
|
349
349
|
}),
|
|
350
|
-
/* @__PURE__ */
|
|
351
|
-
className:
|
|
352
|
-
children: /* @__PURE__ */
|
|
350
|
+
/* @__PURE__ */ B("span", {
|
|
351
|
+
className: W("h-fit shrink-0 rounded-full", i && "ring-1 ring-human/40"),
|
|
352
|
+
children: /* @__PURE__ */ B(fe, {
|
|
353
|
+
notification: d,
|
|
353
354
|
name: f,
|
|
354
|
-
src: s(d.actor.kind, d.actor.handle)
|
|
355
|
-
size: "sm",
|
|
356
|
-
decorative: !0
|
|
355
|
+
src: s(d.actor.kind, d.actor.handle)
|
|
357
356
|
})
|
|
358
357
|
}),
|
|
359
|
-
/* @__PURE__ */
|
|
358
|
+
/* @__PURE__ */ V("span", {
|
|
360
359
|
className: "min-w-0 flex-1",
|
|
361
|
-
children: [/* @__PURE__ */
|
|
360
|
+
children: [/* @__PURE__ */ V("span", {
|
|
362
361
|
className: "flex items-baseline gap-2 text-sm",
|
|
363
|
-
children: [
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
format: "compact",
|
|
372
|
-
exact: "medium",
|
|
373
|
-
className: "shrink-0 text-xs text-muted-foreground"
|
|
374
|
-
})
|
|
375
|
-
]
|
|
376
|
-
}), /* @__PURE__ */ R("span", {
|
|
362
|
+
children: [/* @__PURE__ */ B($, {
|
|
363
|
+
group: n,
|
|
364
|
+
strong: p
|
|
365
|
+
}), /* @__PURE__ */ B("span", {
|
|
366
|
+
className: W("flex-1 truncate", p ? "font-medium text-foreground" : "text-muted-foreground"),
|
|
367
|
+
children: n.issueTitle
|
|
368
|
+
})]
|
|
369
|
+
}), /* @__PURE__ */ V("span", {
|
|
377
370
|
className: "mt-0.5 flex gap-2 text-xs text-muted-foreground",
|
|
378
|
-
children: [/* @__PURE__ */
|
|
371
|
+
children: [/* @__PURE__ */ V("span", {
|
|
379
372
|
className: "flex-1 truncate",
|
|
380
373
|
children: [o(d.reason, {
|
|
381
374
|
actor: f,
|
|
382
375
|
agent: d.agentName ?? f,
|
|
383
|
-
date:
|
|
384
|
-
}), d.excerpt && d.reason !== "reminder" && /* @__PURE__ */
|
|
385
|
-
}), n.items.length > 1 && /* @__PURE__ */
|
|
376
|
+
date: K(d)
|
|
377
|
+
}), d.excerpt && d.reason !== "reminder" && /* @__PURE__ */ V(z, { children: [": ", /* @__PURE__ */ B(he, { text: d.excerpt })] })]
|
|
378
|
+
}), n.items.length > 1 && /* @__PURE__ */ B("span", {
|
|
386
379
|
className: "shrink-0",
|
|
387
380
|
children: o("more", { count: n.items.length - 1 })
|
|
388
381
|
})]
|
|
389
382
|
})]
|
|
383
|
+
}),
|
|
384
|
+
/* @__PURE__ */ V("span", {
|
|
385
|
+
className: "flex shrink-0 flex-col items-end gap-1 pt-0.5",
|
|
386
|
+
children: [d.status && /* @__PURE__ */ V("span", {
|
|
387
|
+
className: "flex h-4 items-center",
|
|
388
|
+
children: [/* @__PURE__ */ B(b, {
|
|
389
|
+
category: d.status.category,
|
|
390
|
+
step: d.status.step
|
|
391
|
+
}), /* @__PURE__ */ B("span", {
|
|
392
|
+
className: "sr-only",
|
|
393
|
+
children: d.status.name
|
|
394
|
+
})]
|
|
395
|
+
}), /* @__PURE__ */ B(N, {
|
|
396
|
+
value: d.createdAt,
|
|
397
|
+
format: "compact",
|
|
398
|
+
exact: "medium",
|
|
399
|
+
className: "text-xs text-muted-foreground"
|
|
400
|
+
})]
|
|
390
401
|
})
|
|
391
402
|
]
|
|
392
403
|
})
|
|
393
404
|
});
|
|
394
405
|
}
|
|
395
|
-
function
|
|
396
|
-
|
|
397
|
-
|
|
406
|
+
function Z(e) {
|
|
407
|
+
switch (e.reason) {
|
|
408
|
+
case "assigned": return /* @__PURE__ */ B(x, {});
|
|
409
|
+
case "commented":
|
|
410
|
+
case "mentioned": return /* @__PURE__ */ B(h, {});
|
|
411
|
+
case "status_changed": return e.status?.category === "completed" && e.excerpt === e.status.name ? /* @__PURE__ */ B(p, { className: "text-status-completed" }) : /* @__PURE__ */ B(f, {});
|
|
412
|
+
default: return null;
|
|
413
|
+
}
|
|
414
|
+
}
|
|
415
|
+
function fe({ notification: e, name: t, src: n }) {
|
|
416
|
+
let r = e.actor.kind === "connector" ? e.actor.handle.split(":")[0] : void 0, i = Z(e);
|
|
417
|
+
return /* @__PURE__ */ V("span", {
|
|
418
|
+
className: "relative flex",
|
|
419
|
+
children: [r === "github" || r === "gitlab" ? /* @__PURE__ */ B("span", {
|
|
420
|
+
className: "flex size-5 items-center justify-center rounded-full bg-muted text-foreground",
|
|
421
|
+
children: /* @__PURE__ */ B(m, {
|
|
422
|
+
provider: r,
|
|
423
|
+
className: "size-3.5"
|
|
424
|
+
})
|
|
425
|
+
}) : /* @__PURE__ */ B(O, {
|
|
426
|
+
name: t,
|
|
427
|
+
src: n,
|
|
428
|
+
kind: e.actor.kind === "agent" ? "agent" : "person",
|
|
429
|
+
size: "sm",
|
|
430
|
+
decorative: !0
|
|
431
|
+
}), i && /* @__PURE__ */ B("span", {
|
|
432
|
+
"aria-hidden": !0,
|
|
433
|
+
className: "absolute -right-1.5 -bottom-1.5 flex size-3.5 items-center justify-center rounded-full border border-border bg-card text-muted-foreground [&_svg]:size-2.5",
|
|
434
|
+
children: i
|
|
435
|
+
})]
|
|
436
|
+
});
|
|
437
|
+
}
|
|
438
|
+
function pe({ workspace: e, identifier: t }) {
|
|
439
|
+
let { data: n } = H(a(e, t)), r = S(), { nameOf: i, avatarOf: o } = C(e);
|
|
440
|
+
return n ? /* @__PURE__ */ V("section", {
|
|
398
441
|
className: "mt-5 rounded-lg border border-border px-4 py-3",
|
|
399
|
-
children: [/* @__PURE__ */
|
|
442
|
+
children: [/* @__PURE__ */ V("div", {
|
|
400
443
|
className: "flex flex-wrap items-center gap-x-4 gap-y-1 text-xs text-muted-foreground",
|
|
401
444
|
children: [
|
|
402
|
-
/* @__PURE__ */
|
|
445
|
+
/* @__PURE__ */ V("span", {
|
|
403
446
|
className: "inline-flex items-center gap-1.5",
|
|
404
|
-
children: [/* @__PURE__ */
|
|
447
|
+
children: [/* @__PURE__ */ B(b, {
|
|
405
448
|
category: n.status.category,
|
|
406
449
|
step: n.status.step
|
|
407
450
|
}), n.status.name]
|
|
408
451
|
}),
|
|
409
|
-
n.priority > 0 && /* @__PURE__ */
|
|
452
|
+
n.priority > 0 && /* @__PURE__ */ V("span", {
|
|
410
453
|
className: "inline-flex items-center gap-1.5",
|
|
411
|
-
children: [/* @__PURE__ */
|
|
454
|
+
children: [/* @__PURE__ */ B(v, { priority: n.priority }), r[n.priority]]
|
|
412
455
|
}),
|
|
413
|
-
n.assignees.map((e) => /* @__PURE__ */
|
|
456
|
+
n.assignees.map((e) => /* @__PURE__ */ V("span", {
|
|
414
457
|
className: "inline-flex items-center gap-1.5",
|
|
415
|
-
children: [/* @__PURE__ */
|
|
458
|
+
children: [/* @__PURE__ */ B(O, {
|
|
416
459
|
name: i(e.kind, e.handle),
|
|
417
460
|
src: o(e.kind, e.handle),
|
|
418
461
|
size: "xs",
|
|
@@ -420,57 +463,57 @@ function Y({ workspace: e, identifier: t }) {
|
|
|
420
463
|
}), i(e.kind, e.handle)]
|
|
421
464
|
}, `${e.kind}:${e.handle}`))
|
|
422
465
|
]
|
|
423
|
-
}), n.body.trim() && /* @__PURE__ */
|
|
466
|
+
}), n.body.trim() && /* @__PURE__ */ B("div", {
|
|
424
467
|
className: "mt-3 max-h-72 overflow-y-auto text-sm",
|
|
425
|
-
children: /* @__PURE__ */
|
|
468
|
+
children: /* @__PURE__ */ B(T, {
|
|
426
469
|
value: n.body,
|
|
427
470
|
editable: !1
|
|
428
471
|
})
|
|
429
472
|
})]
|
|
430
473
|
}) : null;
|
|
431
474
|
}
|
|
432
|
-
function
|
|
433
|
-
let i =
|
|
434
|
-
return /* @__PURE__ */
|
|
475
|
+
function Q({ workspace: e, group: n, actions: r }) {
|
|
476
|
+
let i = R("notifications"), { avatarOf: a } = C(e), o = X(e), s = I(), c = Y(r);
|
|
477
|
+
return /* @__PURE__ */ V("article", {
|
|
435
478
|
className: "w-full px-4 py-5 md:px-8",
|
|
436
479
|
onContextMenu: (e) => s(e, c([n])),
|
|
437
480
|
children: [
|
|
438
|
-
/* @__PURE__ */
|
|
481
|
+
/* @__PURE__ */ B("button", {
|
|
439
482
|
type: "button",
|
|
440
483
|
onClick: () => r.select(void 0),
|
|
441
484
|
className: "mb-3 text-xs text-muted-foreground hover:text-foreground md:hidden",
|
|
442
485
|
children: i("back")
|
|
443
486
|
}),
|
|
444
|
-
/* @__PURE__ */
|
|
487
|
+
/* @__PURE__ */ B("p", {
|
|
445
488
|
className: "text-xs text-muted-foreground",
|
|
446
|
-
children: /* @__PURE__ */
|
|
489
|
+
children: /* @__PURE__ */ B($, { group: n })
|
|
447
490
|
}),
|
|
448
|
-
/* @__PURE__ */
|
|
491
|
+
/* @__PURE__ */ B("h2", {
|
|
449
492
|
className: "mt-0.5 text-sm font-semibold",
|
|
450
|
-
children: /* @__PURE__ */
|
|
493
|
+
children: /* @__PURE__ */ B(t, {
|
|
451
494
|
to: n.href,
|
|
452
495
|
className: "hover:underline",
|
|
453
496
|
children: n.issueTitle
|
|
454
497
|
})
|
|
455
498
|
}),
|
|
456
|
-
/* @__PURE__ */
|
|
499
|
+
/* @__PURE__ */ V("div", {
|
|
457
500
|
className: "mt-3 flex flex-wrap gap-2",
|
|
458
501
|
children: [
|
|
459
|
-
/* @__PURE__ */
|
|
502
|
+
/* @__PURE__ */ B(t, {
|
|
460
503
|
to: n.href,
|
|
461
|
-
className:
|
|
504
|
+
className: P({
|
|
462
505
|
variant: "primary",
|
|
463
506
|
size: "sm"
|
|
464
507
|
}),
|
|
465
508
|
children: i(n.kind === "project" ? "openProject" : n.kind === "doc" ? "openDoc" : "openIssue")
|
|
466
509
|
}),
|
|
467
|
-
/* @__PURE__ */
|
|
510
|
+
/* @__PURE__ */ B(k, {
|
|
468
511
|
type: "button",
|
|
469
512
|
size: "sm",
|
|
470
513
|
onClick: () => r.toggleRead([n]),
|
|
471
514
|
children: n.unread.length > 0 ? i("markRead") : i("markUnread")
|
|
472
515
|
}),
|
|
473
|
-
/* @__PURE__ */
|
|
516
|
+
/* @__PURE__ */ B(k, {
|
|
474
517
|
type: "button",
|
|
475
518
|
size: "sm",
|
|
476
519
|
onClick: () => r.archiveGroups([n]),
|
|
@@ -478,52 +521,52 @@ function ue({ workspace: e, group: n, actions: r }) {
|
|
|
478
521
|
})
|
|
479
522
|
]
|
|
480
523
|
}),
|
|
481
|
-
n.identifier && /* @__PURE__ */
|
|
524
|
+
n.identifier && /* @__PURE__ */ V(z, { children: [/* @__PURE__ */ B(pe, {
|
|
482
525
|
workspace: e,
|
|
483
526
|
identifier: n.identifier
|
|
484
|
-
}), /* @__PURE__ */
|
|
527
|
+
}), /* @__PURE__ */ B(ge, {
|
|
485
528
|
workspace: e,
|
|
486
529
|
identifier: n.identifier
|
|
487
530
|
})] }),
|
|
488
|
-
/* @__PURE__ */
|
|
531
|
+
/* @__PURE__ */ B(A, {
|
|
489
532
|
size: "fill",
|
|
490
533
|
padding: "none",
|
|
491
534
|
divided: !0,
|
|
492
535
|
interactive: !1,
|
|
493
|
-
render: /* @__PURE__ */
|
|
536
|
+
render: /* @__PURE__ */ B("ol", {}),
|
|
494
537
|
className: "mt-5 overflow-hidden",
|
|
495
538
|
children: n.items.map((t) => {
|
|
496
539
|
let n = o(t);
|
|
497
|
-
return /* @__PURE__ */
|
|
540
|
+
return /* @__PURE__ */ V("li", {
|
|
498
541
|
className: "flex gap-3 px-3 py-3",
|
|
499
|
-
children: [/* @__PURE__ */
|
|
542
|
+
children: [/* @__PURE__ */ B(w, {
|
|
500
543
|
workspace: e,
|
|
501
544
|
kind: t.actor.kind,
|
|
502
545
|
handle: t.actor.handle,
|
|
503
546
|
className: "inline-flex shrink-0 self-start",
|
|
504
|
-
children: /* @__PURE__ */
|
|
547
|
+
children: /* @__PURE__ */ B(O, {
|
|
505
548
|
name: n,
|
|
506
549
|
src: a(t.actor.kind, t.actor.handle),
|
|
507
550
|
size: "sm"
|
|
508
551
|
})
|
|
509
|
-
}), /* @__PURE__ */
|
|
552
|
+
}), /* @__PURE__ */ V("div", {
|
|
510
553
|
className: "min-w-0 flex-1",
|
|
511
|
-
children: [/* @__PURE__ */
|
|
554
|
+
children: [/* @__PURE__ */ V("p", {
|
|
512
555
|
className: "flex items-baseline gap-2 text-sm",
|
|
513
|
-
children: [/* @__PURE__ */
|
|
514
|
-
className:
|
|
556
|
+
children: [/* @__PURE__ */ B("span", {
|
|
557
|
+
className: W("flex-1", !t.readAt && "font-medium"),
|
|
515
558
|
children: i(t.reason, {
|
|
516
559
|
actor: n,
|
|
517
560
|
agent: t.agentName ?? n,
|
|
518
|
-
date:
|
|
561
|
+
date: K(t)
|
|
519
562
|
})
|
|
520
|
-
}), /* @__PURE__ */
|
|
563
|
+
}), /* @__PURE__ */ B(N, {
|
|
521
564
|
value: t.createdAt,
|
|
522
565
|
format: "compact",
|
|
523
566
|
exact: "medium",
|
|
524
567
|
className: "text-xs text-muted-foreground"
|
|
525
568
|
})]
|
|
526
|
-
}), t.excerpt && t.reason !== "reminder" && /* @__PURE__ */
|
|
569
|
+
}), t.excerpt && t.reason !== "reminder" && /* @__PURE__ */ B(me, { text: t.excerpt })]
|
|
527
570
|
})]
|
|
528
571
|
}, t.id);
|
|
529
572
|
})
|
|
@@ -531,58 +574,58 @@ function ue({ workspace: e, group: n, actions: r }) {
|
|
|
531
574
|
]
|
|
532
575
|
});
|
|
533
576
|
}
|
|
534
|
-
function
|
|
535
|
-
let t =
|
|
536
|
-
return n ? /* @__PURE__ */
|
|
577
|
+
function me({ text: e }) {
|
|
578
|
+
let t = R("agentWork"), n = c(e);
|
|
579
|
+
return n ? /* @__PURE__ */ V("div", {
|
|
537
580
|
className: "mt-1 min-w-0 text-sm text-muted-foreground",
|
|
538
581
|
children: [
|
|
539
|
-
/* @__PURE__ */
|
|
540
|
-
/* @__PURE__ */
|
|
582
|
+
/* @__PURE__ */ B("p", { children: n.agent ? t("approveCommandFor", { agent: n.agent }) : t("approveCommand") }),
|
|
583
|
+
/* @__PURE__ */ B("code", {
|
|
541
584
|
className: "mt-1 block rounded-md bg-muted px-2 py-1 font-mono text-xs break-all whitespace-pre-wrap text-foreground",
|
|
542
585
|
children: n.command
|
|
543
586
|
}),
|
|
544
|
-
n.reason && /* @__PURE__ */
|
|
587
|
+
n.reason && /* @__PURE__ */ B("p", {
|
|
545
588
|
className: "mt-1",
|
|
546
589
|
children: n.reason
|
|
547
590
|
})
|
|
548
591
|
]
|
|
549
|
-
}) : /* @__PURE__ */
|
|
592
|
+
}) : /* @__PURE__ */ B("div", {
|
|
550
593
|
className: "mt-1 min-w-0 text-sm text-muted-foreground",
|
|
551
|
-
children: /* @__PURE__ */
|
|
594
|
+
children: /* @__PURE__ */ B(T, {
|
|
552
595
|
value: e.replace(/<!--[\s\S]*?(-->|$)/g, "").trim(),
|
|
553
596
|
editable: !1
|
|
554
597
|
})
|
|
555
598
|
});
|
|
556
599
|
}
|
|
557
|
-
function
|
|
600
|
+
function he({ text: e }) {
|
|
558
601
|
let t = c(e);
|
|
559
|
-
return t ? /* @__PURE__ */
|
|
602
|
+
return t ? /* @__PURE__ */ B("code", {
|
|
560
603
|
className: "font-mono",
|
|
561
604
|
children: t.command
|
|
562
|
-
}) :
|
|
605
|
+
}) : D(e);
|
|
563
606
|
}
|
|
564
|
-
function
|
|
565
|
-
let n =
|
|
566
|
-
return a.length === 0 ? null : /* @__PURE__ */
|
|
607
|
+
function ge({ workspace: e, identifier: t }) {
|
|
608
|
+
let n = R("notifications"), { data: r = [] } = H(i(e, t)), a = r.filter((e) => !e.answer && !e.canceled);
|
|
609
|
+
return a.length === 0 ? null : /* @__PURE__ */ V("section", {
|
|
567
610
|
"aria-label": n("waitingOnYou"),
|
|
568
611
|
className: "mt-5 space-y-3",
|
|
569
|
-
children: [/* @__PURE__ */
|
|
612
|
+
children: [/* @__PURE__ */ B("h3", {
|
|
570
613
|
className: "text-xs font-medium text-muted-foreground",
|
|
571
614
|
children: n("waitingOnYou")
|
|
572
|
-
}), a.map((t) => /* @__PURE__ */
|
|
615
|
+
}), a.map((t) => /* @__PURE__ */ B(E, {
|
|
573
616
|
workspace: e,
|
|
574
617
|
decision: t
|
|
575
618
|
}, t.id))]
|
|
576
619
|
});
|
|
577
620
|
}
|
|
578
|
-
function $({ group: e }) {
|
|
579
|
-
let
|
|
580
|
-
return e.identifier ? /* @__PURE__ */
|
|
581
|
-
className: "shrink-0 text-xs
|
|
621
|
+
function $({ group: e, strong: t = !1 }) {
|
|
622
|
+
let n = R("notifications"), r = t ? "font-medium text-foreground" : "text-muted-foreground";
|
|
623
|
+
return e.identifier ? /* @__PURE__ */ B("span", {
|
|
624
|
+
className: W("shrink-0 text-xs", r),
|
|
582
625
|
children: e.identifier
|
|
583
|
-
}) : /* @__PURE__ */
|
|
584
|
-
className: "inline-flex shrink-0 items-center gap-1 text-xs
|
|
585
|
-
children: [e.kind === "doc" ? /* @__PURE__ */
|
|
626
|
+
}) : /* @__PURE__ */ V("span", {
|
|
627
|
+
className: W("inline-flex shrink-0 items-center gap-1 text-xs", r),
|
|
628
|
+
children: [e.kind === "doc" ? /* @__PURE__ */ B(g, { className: "size-3" }) : /* @__PURE__ */ B(y, { className: "size-3" }), n(e.kind === "doc" ? "aboutDoc" : "aboutProject")]
|
|
586
629
|
});
|
|
587
630
|
}
|
|
588
|
-
export {
|
|
631
|
+
export { J as component };
|