@parallelworks/tandem-web 0.171.3 → 0.173.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.
@@ -944,6 +944,7 @@ var e = {
944
944
  titleChanged: "<actor>{name}</actor> changed the title to “{title}”",
945
945
  bodyChanged: "<actor>{name}</actor> edited the description",
946
946
  statusChanged: "<actor>{name}</actor> moved to <icon></icon> {status}",
947
+ statusChangedByPullRequest: "Moved to <icon></icon> {status} by PR {ref}",
947
948
  autoClosed: "Closed after {days} days with no activity",
948
949
  archived: "Archived after it closed",
949
950
  priorityRemoved: "<actor>{name}</actor> removed the priority",
@@ -1748,7 +1749,10 @@ var e = {
1748
1749
  moveDown: "Move {name} down",
1749
1750
  delete: "Delete status",
1750
1751
  deleteTitle: "Delete “{name}”?",
1751
- deleteDescription: "Issues with this status will move to {target}."
1752
+ deleteDescription: "Issues with this status will move to {target}.",
1753
+ reviewBadge: "Review",
1754
+ markReview: "Mark as review",
1755
+ unmarkReview: "Unmark review"
1752
1756
  },
1753
1757
  relations: {
1754
1758
  label: "Sub-issues and relations",
@@ -944,6 +944,7 @@ var e = {
944
944
  titleChanged: "<actor>{name}</actor> cambió el título a “{title}”",
945
945
  bodyChanged: "<actor>{name}</actor> editó la descripción",
946
946
  statusChanged: "<actor>{name}</actor> la movió a <icon></icon> {status}",
947
+ statusChangedByPullRequest: "Movida a <icon></icon> {status} por el PR {ref}",
947
948
  autoClosed: "Cerrada tras {days} días sin actividad",
948
949
  archived: "Archivada después de cerrarse",
949
950
  priorityRemoved: "<actor>{name}</actor> quitó la prioridad",
@@ -1748,7 +1749,10 @@ var e = {
1748
1749
  moveDown: "Bajar {name}",
1749
1750
  delete: "Eliminar estado",
1750
1751
  deleteTitle: "¿Eliminar “{name}”?",
1751
- deleteDescription: "Las incidencias con este estado pasarán a {target}."
1752
+ deleteDescription: "Las incidencias con este estado pasarán a {target}.",
1753
+ reviewBadge: "Revisión",
1754
+ markReview: "Marcar como revisión",
1755
+ unmarkReview: "Quitar revisión"
1752
1756
  },
1753
1757
  relations: {
1754
1758
  label: "Subincidencias y relaciones",
@@ -944,6 +944,7 @@ var e = {
944
944
  titleChanged: "<actor>{name}</actor> がタイトルを「{title}」に変更しました",
945
945
  bodyChanged: "<actor>{name}</actor> が説明を編集しました",
946
946
  statusChanged: "<actor>{name}</actor> が <icon></icon> {status} に移動しました",
947
+ statusChangedByPullRequest: "PR {ref} により <icon></icon> {status} に移動しました",
947
948
  autoClosed: "{days} 日間アクティビティがなかったためクローズされました",
948
949
  archived: "クローズ後にアーカイブされました",
949
950
  priorityRemoved: "<actor>{name}</actor> が優先度を削除しました",
@@ -1748,7 +1749,10 @@ var e = {
1748
1749
  moveDown: "{name} を下に移動",
1749
1750
  delete: "ステータスを削除",
1750
1751
  deleteTitle: "「{name}」を削除しますか?",
1751
- deleteDescription: "このステータスの課題は {target} に移動します。"
1752
+ deleteDescription: "このステータスの課題は {target} に移動します。",
1753
+ reviewBadge: "レビュー",
1754
+ markReview: "レビューにする",
1755
+ unmarkReview: "レビューを解除"
1752
1756
  },
1753
1757
  relations: {
1754
1758
  label: "サブ課題と関連",
@@ -944,6 +944,7 @@ var e = {
944
944
  titleChanged: "<actor>{name}</actor>이(가) 제목을 “{title}”(으)로 변경함",
945
945
  bodyChanged: "<actor>{name}</actor>이(가) 설명을 편집함",
946
946
  statusChanged: "<actor>{name}</actor>이(가) <icon></icon> {status}(으)로 옮김",
947
+ statusChangedByPullRequest: "PR {ref}에 의해 <icon></icon> {status}(으)로 옮겨짐",
947
948
  autoClosed: "{days}일 동안 활동이 없어 종료됨",
948
949
  archived: "종료 후 보관됨",
949
950
  priorityRemoved: "<actor>{name}</actor>이(가) 우선순위를 제거함",
@@ -1748,7 +1749,10 @@ var e = {
1748
1749
  moveDown: "{name} 아래로 이동",
1749
1750
  delete: "상태 삭제",
1750
1751
  deleteTitle: "“{name}”을(를) 삭제하시겠습니까?",
1751
- deleteDescription: "이 상태의 이슈는 {target}(으)로 이동합니다."
1752
+ deleteDescription: "이 상태의 이슈는 {target}(으)로 이동합니다.",
1753
+ reviewBadge: "리뷰",
1754
+ markReview: "리뷰로 표시",
1755
+ unmarkReview: "리뷰 표시 해제"
1752
1756
  },
1753
1757
  relations: {
1754
1758
  label: "하위 이슈 및 관계",
@@ -944,6 +944,7 @@ var e = {
944
944
  titleChanged: "<actor>{name}</actor> 将标题改为“{title}”",
945
945
  bodyChanged: "<actor>{name}</actor> 编辑了描述",
946
946
  statusChanged: "<actor>{name}</actor> 移到了 <icon></icon> {status}",
947
+ statusChangedByPullRequest: "由 PR {ref} 移到了 <icon></icon> {status}",
947
948
  autoClosed: "{days} 天无活动后自动关闭",
948
949
  archived: "关闭后已归档",
949
950
  priorityRemoved: "<actor>{name}</actor> 移除了优先级",
@@ -1748,7 +1749,10 @@ var e = {
1748
1749
  moveDown: "下移 {name}",
1749
1750
  delete: "删除状态",
1750
1751
  deleteTitle: "删除“{name}”?",
1751
- deleteDescription: "处于此状态的议题将移至 {target}。"
1752
+ deleteDescription: "处于此状态的议题将移至 {target}。",
1753
+ reviewBadge: "评审",
1754
+ markReview: "标记为评审",
1755
+ unmarkReview: "取消评审标记"
1752
1756
  },
1753
1757
  relations: {
1754
1758
  label: "子议题和关联",
@@ -66,7 +66,16 @@ function p({ workspace: p, event: m }) {
66
66
  case "issue.created": return E("created");
67
67
  case "issue.title_changed": return E("titleChanged", { title: String(w.to) });
68
68
  case "issue.body_changed": return E("bodyChanged");
69
- case "issue.status_changed": return w.reason === "inactive" ? E("autoClosed", { days: String(w.days) }) : E("statusChanged", { status: w.to.name });
69
+ case "issue.status_changed":
70
+ if (w.reason === "inactive") return E("autoClosed", { days: String(w.days) });
71
+ if (w.pullRequest) {
72
+ let e = w.pullRequest;
73
+ return E("statusChangedByPullRequest", {
74
+ status: w.to.name,
75
+ ref: `${e.provider === "gitlab" ? "!" : "#"}${e.number}`
76
+ });
77
+ }
78
+ return E("statusChanged", { status: w.to.name });
70
79
  case "issue.archived": return m.actor.kind === "system" ? E("archived") : E("archivedBy");
71
80
  case "issue.restored": return E("restored");
72
81
  case "issue.priority_changed": return Number(w.to) === 0 ? E("priorityRemoved") : E("priorityChanged", { priority: b[Number(w.to)] ?? "" });
@@ -47,7 +47,8 @@ function C({ workspace: C, teamKey: w, isAdmin: T }) {
47
47
  params: B(n.id),
48
48
  body: {
49
49
  ...n.name !== void 0 && { name: n.name },
50
- ...n.position !== void 0 && { position: n.position }
50
+ ...n.position !== void 0 && { position: n.position },
51
+ ...n.review !== void 0 && { review: n.review }
51
52
  }
52
53
  })),
53
54
  onMutate: j.clear,
@@ -125,9 +126,12 @@ function C({ workspace: C, teamKey: w, isAdmin: T }) {
125
126
  children: k("cancel")
126
127
  })
127
128
  ]
128
- }) : /* @__PURE__ */ g("span", {
129
+ }) : /* @__PURE__ */ _("span", {
129
130
  className: "min-w-0 flex-1 truncate",
130
- children: e.name
131
+ children: [e.name, e.review && /* @__PURE__ */ g("span", {
132
+ className: "ml-2 text-xs text-muted-foreground",
133
+ children: D("reviewBadge")
134
+ })]
131
135
  }),
132
136
  T && M !== e.id && /* @__PURE__ */ _("span", {
133
137
  className: "flex items-center gap-1",
@@ -162,6 +166,16 @@ function C({ workspace: C, teamKey: w, isAdmin: T }) {
162
166
  className: "px-1 text-xs text-muted-foreground hover:text-foreground",
163
167
  children: D("rename")
164
168
  }),
169
+ e.category === "started" && /* @__PURE__ */ g("button", {
170
+ type: "button",
171
+ onClick: () => U.mutate({
172
+ id: e.id,
173
+ review: !e.review
174
+ }),
175
+ disabled: U.isPending,
176
+ className: "px-1 text-xs text-muted-foreground hover:text-foreground",
177
+ children: e.review ? D("unmarkReview") : D("markReview")
178
+ }),
165
179
  e.category !== "triage" && /* @__PURE__ */ g("button", {
166
180
  type: "button",
167
181
  onClick: () => J(e),
@@ -0,0 +1,33 @@
1
+ import { useCanTriage as e } from "../lib/roles.js";
2
+ import { useTriageDecision as t } from "../lib/triage.js";
3
+ import { Button as n } from "@parallelworks/ui";
4
+ import { useErrorMessage as r } from "@parallelworks/problem/react";
5
+ import { useTranslations as i } from "use-intl";
6
+ import { Fragment as a, jsx as o, jsxs as s } from "react/jsx-runtime";
7
+ // src/components/TriageButtons.tsx
8
+ function c({ workspace: r, issue: c, onDecided: u }) {
9
+ let d = i("triage"), f = e(r, c.teamId), p = t(r, c, u);
10
+ if (!f || !c.triage) return null;
11
+ let m = (e) => /* @__PURE__ */ o(n, {
12
+ variant: e === "accept" ? "primary" : "outline",
13
+ size: "sm",
14
+ title: d(e === "accept" ? "acceptHelp" : "declineHelp"),
15
+ loading: p.isPending && p.variables === e,
16
+ disabled: p.isPending,
17
+ onClick: () => p.mutate(e),
18
+ children: d(e)
19
+ });
20
+ return /* @__PURE__ */ s(a, { children: [
21
+ m("accept"),
22
+ m("decline"),
23
+ p.error && /* @__PURE__ */ o(l, { error: p.error })
24
+ ] });
25
+ }
26
+ function l({ error: e }) {
27
+ let t = r();
28
+ return /* @__PURE__ */ o("p", {
29
+ className: "basis-full text-xs text-danger",
30
+ children: t(e)
31
+ });
32
+ }
33
+ export { c as TriageButtons };
package/lib/triage.js CHANGED
@@ -19,4 +19,23 @@ function c(n) {
19
19
  onSettled: () => o.invalidateQueries({ queryKey: s })
20
20
  });
21
21
  }
22
- export { o as triageQuery, s as triageSearch, c as useVisitTriage };
22
+ function l(n, r, o) {
23
+ let s = a();
24
+ return i({
25
+ mutationFn: async (i) => t(await e.POST("/api/v1/workspaces/{workspace}/issues/{identifier}/triage", {
26
+ params: { path: {
27
+ workspace: n,
28
+ identifier: r.identifier
29
+ } },
30
+ body: { decision: i }
31
+ })),
32
+ onSuccess: () => {
33
+ o?.(r), s.invalidateQueries({ queryKey: [
34
+ "workspace",
35
+ n,
36
+ "issues"
37
+ ] });
38
+ }
39
+ });
40
+ }
41
+ export { o as triageQuery, s as triageSearch, l as useTriageDecision, c as useVisitTriage };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@parallelworks/tandem-web",
3
- "version": "0.171.3",
3
+ "version": "0.173.0",
4
4
  "description": "Tandem's pages, for a host app to render in its own",
5
5
  "license": "UNLICENSED",
6
6
  "type": "module",
package/pages/triage.js CHANGED
@@ -4,30 +4,31 @@ import { ActorAvatar as a } from "../components/ActorAvatar.js";
4
4
  import { Editor as o } from "../components/Editor.js";
5
5
  import { EntityIcon as s } from "../components/EntityIcon.js";
6
6
  import { PriorityIcon as c, StatusIcon as l, TriageIcon as u, usePriorityNames as d } from "../components/icons.js";
7
- import { actorAvatar as f } from "../lib/avatar.js";
8
- import { usePageTitle as p } from "../lib/pageTitle.js";
9
- import { usePeople as m } from "../lib/people.js";
10
- import { useCanTriage as h } from "../lib/roles.js";
11
- import { Link as g, useNavigate as _ } from "../lib/router.js";
12
- import { useShortcuts as v } from "../lib/shortcuts.js";
13
- import { useTime as y } from "../lib/time.js";
14
- import { triageQuery as b, useVisitTriage as ee } from "../lib/triage.js";
15
- import { hasOpened as x } from "../lib/triageSeen.js";
16
- import { Avatar as S, Button as C, EmptyState as w, RelativeTime as T, Tooltip as E, buttonClasses as D, toast as O } from "@parallelworks/ui";
17
- import { useParams as k, useSearch as A } from "@tanstack/react-router";
18
- import { useCallback as j, useEffect as M, useRef as N, useState as P } from "react";
19
- import { useErrorMessage as F } from "@parallelworks/problem/react";
20
- import { useTranslations as I } from "use-intl";
21
- import { Fragment as L, jsx as R, jsxs as z } from "react/jsx-runtime";
22
- import { useMutation as te, useQuery as B, useQueryClient as V, useSuspenseQuery as H } from "@tanstack/react-query";
7
+ import { TriageButtons as f } from "../components/TriageButtons.js";
8
+ import { actorAvatar as p } from "../lib/avatar.js";
9
+ import { usePageTitle as m } from "../lib/pageTitle.js";
10
+ import { usePeople as h } from "../lib/people.js";
11
+ import { useCanTriage as g } from "../lib/roles.js";
12
+ import { Link as _, useNavigate as v } from "../lib/router.js";
13
+ import { useShortcuts as y } from "../lib/shortcuts.js";
14
+ import { useTime as b } from "../lib/time.js";
15
+ import { triageQuery as x, useVisitTriage as S } from "../lib/triage.js";
16
+ import { hasOpened as C } from "../lib/triageSeen.js";
17
+ import { Avatar as w, Button as T, EmptyState as E, RelativeTime as D, Tooltip as O, buttonClasses as k, toast as A } from "@parallelworks/ui";
18
+ import { useParams as j, useSearch as M } from "@tanstack/react-router";
19
+ import { useCallback as N, useEffect as P, useRef as F, useState as I } from "react";
20
+ import { useErrorMessage as L } from "@parallelworks/problem/react";
21
+ import { useTranslations as R } from "use-intl";
22
+ import { jsx as z, jsxs as B } from "react/jsx-runtime";
23
+ import { useMutation as ee, useQuery as V, useQueryClient as te, useSuspenseQuery as H } from "@tanstack/react-query";
23
24
  // src/pages/triage.tsx
24
25
  function U() {
25
- let n = I("triage"), { workspace: r, key: a } = k({ strict: !1 }), { issue: o } = A({ strict: !1 }), { data: s } = H(b(r, a));
26
- p(n("title"));
27
- let c = s.issues, l = F(), d = V(), [f, m] = P(/* @__PURE__ */ new Set()), [h, g] = P(/* @__PURE__ */ new Set()), y = j((e, t) => {
28
- m((n) => n.has(e) === t ? n : t ? new Set(n).add(e) : G(n, e));
29
- }, []), S = c.filter((e) => f.has(e.id)), T = S.filter((e) => h.has(e.id)), E = _(), D = c.findIndex((e) => e.identifier === o?.toUpperCase()), L = N(null), U = c[D], { data: K } = B(i(r)), { mutate: q } = ee(r), J = N(/* @__PURE__ */ new Set());
30
- M(() => {
26
+ let n = R("triage"), { workspace: r, key: a } = j({ strict: !1 }), { issue: o } = M({ strict: !1 }), { data: s } = H(x(r, a));
27
+ m(n("title"));
28
+ let c = s.issues, l = L(), d = te(), [f, p] = I(/* @__PURE__ */ new Set()), [h, g] = I(/* @__PURE__ */ new Set()), _ = N((e, t) => {
29
+ p((n) => n.has(e) === t ? n : t ? new Set(n).add(e) : G(n, e));
30
+ }, []), b = c.filter((e) => f.has(e.id)), w = b.filter((e) => h.has(e.id)), D = v(), O = c.findIndex((e) => e.identifier === o?.toUpperCase()), k = F(null), U = c[O], { data: K } = V(i(r)), { mutate: q } = S(r), J = F(/* @__PURE__ */ new Set());
31
+ P(() => {
31
32
  U && K && !K.includes(U.id) && !J.current.has(U.id) && (J.current.add(U.id), q({
32
33
  id: U.id,
33
34
  identifier: U.identifier
@@ -37,7 +38,7 @@ function U() {
37
38
  K,
38
39
  q
39
40
  ]);
40
- let Y = (e) => E({
41
+ let Y = (e) => D({
41
42
  to: ".",
42
43
  search: e ? { issue: e.identifier.toLowerCase() } : {},
43
44
  replace: !0
@@ -48,16 +49,16 @@ function U() {
48
49
  g(new Set(c.slice(n, r + 1).filter((e) => f.has(e.id)).map((e) => e.id)));
49
50
  }, ie = (e, t) => {
50
51
  let n = c[t];
51
- n && (e.metaKey || e.ctrlKey ? (e.preventDefault(), X(n), L.current = t) : e.shiftKey && (e.preventDefault(), Z(L.current ?? (D >= 0 ? D : t), t)));
52
+ n && (e.metaKey || e.ctrlKey ? (e.preventDefault(), X(n), k.current = t) : e.shiftKey && (e.preventDefault(), Z(k.current ?? (O >= 0 ? O : t), t)));
52
53
  }, Q = (e, t) => {
53
54
  if (c.length === 0) return;
54
- let n = D < 0 ? 0 : Math.min(Math.max(D + e, 0), c.length - 1);
55
- t && ((L.current === null || h.size === 0) && (L.current = Math.max(D, 0)), Z(L.current, n)), Y(c[n]);
55
+ let n = O < 0 ? 0 : Math.min(Math.max(O + e, 0), c.length - 1);
56
+ t && ((k.current === null || h.size === 0) && (k.current = Math.max(O, 0)), Z(k.current, n)), Y(c[n]);
56
57
  }, ae = (e) => {
57
58
  let t = c.findIndex((t) => t.id === e.id);
58
59
  e.id === U?.id && Y(c[t + 1] ?? c[t - 1]);
59
60
  };
60
- v({
61
+ y({
61
62
  j: () => Q(1, !1),
62
63
  k: () => Q(-1, !1),
63
64
  J: () => Q(1, !0),
@@ -65,9 +66,9 @@ function U() {
65
66
  ArrowDown: (e) => Q(1, e.shiftKey),
66
67
  ArrowUp: (e) => Q(-1, e.shiftKey),
67
68
  x: () => {
68
- U && (X(U), L.current = D);
69
+ U && (X(U), k.current = O);
69
70
  },
70
- Enter: () => U && E({
71
+ Enter: () => U && D({
71
72
  to: "/$workspace/issues/$identifier",
72
73
  params: {
73
74
  workspace: r,
@@ -77,12 +78,12 @@ function U() {
77
78
  "Mod+a": () => g(new Set(c.map((e) => e.id))),
78
79
  "Shift+Mod+a": () => g(/* @__PURE__ */ new Set()),
79
80
  Escape: () => h.size > 0 ? g(/* @__PURE__ */ new Set()) : Y(void 0)
80
- }), M(() => {
81
+ }), P(() => {
81
82
  let e = U && document.getElementById(`triage-${U.id}`);
82
83
  e && (e.scrollIntoView({ block: "nearest" }), e.parentElement?.contains(document.activeElement) && e.querySelector("a")?.focus({ preventScroll: !0 }));
83
84
  }, [U]);
84
- let $ = te({
85
- mutationFn: async (n) => (await Promise.allSettled(T.map(async (i) => t(await e.POST("/api/v1/workspaces/{workspace}/issues/{identifier}/triage", {
85
+ let $ = ee({
86
+ mutationFn: async (n) => (await Promise.allSettled(w.map(async (i) => t(await e.POST("/api/v1/workspaces/{workspace}/issues/{identifier}/triage", {
86
87
  params: { path: {
87
88
  workspace: r,
88
89
  identifier: i.identifier
@@ -92,11 +93,11 @@ function U() {
92
93
  onSuccess: (e) => {
93
94
  if (U && h.has(U.id)) {
94
95
  let e = (e) => !h.has(e.id);
95
- Y(c.slice(D + 1).find(e) ?? c.slice(0, D).findLast(e));
96
+ Y(c.slice(O + 1).find(e) ?? c.slice(0, O).findLast(e));
96
97
  }
97
98
  g(/* @__PURE__ */ new Set());
98
99
  let t = e[0];
99
- t && O.error(n("bulkFailed", {
100
+ t && A.error(n("bulkFailed", {
100
101
  count: e.length,
101
102
  reason: l(t.reason)
102
103
  }));
@@ -107,90 +108,90 @@ function U() {
107
108
  "issues"
108
109
  ] })
109
110
  });
110
- return /* @__PURE__ */ z("div", {
111
+ return /* @__PURE__ */ B("div", {
111
112
  className: "flex h-full flex-col",
112
- children: [/* @__PURE__ */ z("header", {
113
+ children: [/* @__PURE__ */ B("header", {
113
114
  className: "flex h-12 shrink-0 items-center gap-3 border-b border-border px-4 md:px-5",
114
115
  children: [
115
- /* @__PURE__ */ R("h1", {
116
+ /* @__PURE__ */ z("h1", {
116
117
  className: "text-sm font-semibold",
117
118
  children: n("title")
118
119
  }),
119
- /* @__PURE__ */ R("span", {
120
+ /* @__PURE__ */ z("span", {
120
121
  className: "text-xs text-muted-foreground tabular-nums",
121
122
  children: c.length
122
123
  }),
123
- T.length > 0 && /* @__PURE__ */ z("div", {
124
+ w.length > 0 && /* @__PURE__ */ B("div", {
124
125
  className: "ml-auto flex items-center gap-2",
125
126
  children: [
126
- /* @__PURE__ */ R("span", {
127
+ /* @__PURE__ */ z("span", {
127
128
  className: "text-xs font-medium text-human",
128
- children: n("selected", { count: T.length })
129
+ children: n("selected", { count: w.length })
129
130
  }),
130
- T.length < S.length && /* @__PURE__ */ R("button", {
131
+ w.length < b.length && /* @__PURE__ */ z("button", {
131
132
  type: "button",
132
- onClick: () => g(new Set(S.map((e) => e.id))),
133
+ onClick: () => g(new Set(b.map((e) => e.id))),
133
134
  className: "text-xs hover:underline",
134
135
  children: n("selectAll")
135
136
  }),
136
- /* @__PURE__ */ R("button", {
137
+ /* @__PURE__ */ z("button", {
137
138
  type: "button",
138
139
  onClick: () => g(/* @__PURE__ */ new Set()),
139
140
  className: "text-xs hover:underline",
140
141
  children: n("clear")
141
142
  }),
142
- /* @__PURE__ */ R(C, {
143
+ /* @__PURE__ */ z(T, {
143
144
  variant: "outline",
144
145
  size: "sm",
145
146
  title: n("declineHelp"),
146
147
  loading: $.isPending && $.variables === "decline",
147
148
  disabled: $.isPending,
148
149
  onClick: () => $.mutate("decline"),
149
- children: n("declineCount", { count: T.length })
150
+ children: n("declineCount", { count: w.length })
150
151
  }),
151
- /* @__PURE__ */ R(C, {
152
+ /* @__PURE__ */ z(T, {
152
153
  variant: "primary",
153
154
  size: "sm",
154
155
  title: n("acceptHelp"),
155
156
  loading: $.isPending && $.variables === "accept",
156
157
  disabled: $.isPending,
157
158
  onClick: () => $.mutate("accept"),
158
- children: n("acceptCount", { count: T.length })
159
+ children: n("acceptCount", { count: w.length })
159
160
  })
160
161
  ]
161
162
  })
162
163
  ]
163
- }), c.length === 0 ? /* @__PURE__ */ R("div", {
164
+ }), c.length === 0 ? /* @__PURE__ */ z("div", {
164
165
  className: "min-h-0 flex-1 overflow-y-auto p-6",
165
- children: /* @__PURE__ */ R(w, {
166
- icon: /* @__PURE__ */ R(u, {}),
166
+ children: /* @__PURE__ */ z(E, {
167
+ icon: /* @__PURE__ */ z(u, {}),
167
168
  title: n("empty"),
168
169
  description: n("emptyDescription")
169
170
  })
170
- }) : /* @__PURE__ */ z("div", {
171
+ }) : /* @__PURE__ */ B("div", {
171
172
  className: "flex min-h-0 flex-1",
172
- children: [/* @__PURE__ */ R("ul", {
173
+ children: [/* @__PURE__ */ z("ul", {
173
174
  "aria-label": n("title"),
174
175
  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", U ? "hidden" : "flex"),
175
- children: c.map((e, t) => /* @__PURE__ */ R(ne, {
176
+ children: c.map((e, t) => /* @__PURE__ */ z(ne, {
176
177
  workspace: r,
177
178
  issue: e,
178
- onEligible: y,
179
+ onEligible: _,
179
180
  picked: h.has(e.id) && f.has(e.id),
180
- current: t === D,
181
- opened: x(e.id, { data: K }),
181
+ current: t === O,
182
+ opened: C(e.id, { data: K }),
182
183
  onClick: (e) => ie(e, t)
183
184
  }, e.id))
184
- }), /* @__PURE__ */ R("div", {
185
+ }), /* @__PURE__ */ z("div", {
185
186
  className: W("min-w-0 flex-1 overflow-y-auto md:block", U ? "block" : "hidden"),
186
- children: U ? /* @__PURE__ */ R(re, {
187
+ children: U ? /* @__PURE__ */ z(re, {
187
188
  workspace: r,
188
189
  issue: U,
189
190
  onBack: () => Y(void 0),
190
191
  onDecided: ae
191
- }, U.id) : /* @__PURE__ */ R("div", {
192
+ }, U.id) : /* @__PURE__ */ z("div", {
192
193
  className: "px-6 py-24",
193
- children: /* @__PURE__ */ R(w, {
194
+ children: /* @__PURE__ */ z(E, {
194
195
  title: n("noneSelected"),
195
196
  description: n("shortcuts")
196
197
  })
@@ -205,17 +206,17 @@ function G(e, t) {
205
206
  return n.delete(t), n;
206
207
  }
207
208
  function ne({ workspace: e, issue: t, onEligible: n, picked: r, current: i, opened: o, onClick: s }) {
208
- let c = I("triage"), { actorName: u, avatarOf: d } = m(e), f = h(e, t.teamId);
209
- M(() => n(t.id, f), [
209
+ let c = R("triage"), { actorName: u, avatarOf: d } = h(e), f = g(e, t.teamId);
210
+ P(() => n(t.id, f), [
210
211
  n,
211
212
  t.id,
212
213
  f
213
214
  ]);
214
215
  let p = t.creator;
215
- return /* @__PURE__ */ R("li", {
216
+ return /* @__PURE__ */ z("li", {
216
217
  id: `triage-${t.id}`,
217
218
  "data-picked": r || void 0,
218
- children: /* @__PURE__ */ z(g, {
219
+ children: /* @__PURE__ */ B(_, {
219
220
  to: ".",
220
221
  search: { issue: t.identifier.toLowerCase() },
221
222
  replace: !0,
@@ -223,42 +224,42 @@ function ne({ workspace: e, issue: t, onEligible: n, picked: r, current: i, open
223
224
  "aria-current": i || void 0,
224
225
  className: W("flex gap-3 px-2 py-2.5 select-none", r ? "bg-human-soft" : W("rounded-md", i ? "bg-muted" : "hover:bg-muted")),
225
226
  children: [
226
- /* @__PURE__ */ R("span", {
227
+ /* @__PURE__ */ z("span", {
227
228
  className: W("h-fit shrink-0 rounded-full", r && "ring-1 ring-human/40"),
228
- children: /* @__PURE__ */ R(a, {
229
+ children: /* @__PURE__ */ z(a, {
229
230
  actor: p,
230
231
  name: u(p),
231
232
  src: d(p.kind, p.handle)
232
233
  })
233
234
  }),
234
- /* @__PURE__ */ z("span", {
235
+ /* @__PURE__ */ B("span", {
235
236
  className: "min-w-0 flex-1",
236
- children: [/* @__PURE__ */ z("span", {
237
+ children: [/* @__PURE__ */ B("span", {
237
238
  className: "flex items-baseline gap-2 text-sm",
238
- children: [/* @__PURE__ */ R("span", {
239
+ children: [/* @__PURE__ */ z("span", {
239
240
  className: W("shrink-0 text-xs tabular-nums", o ? "text-muted-foreground" : "font-medium text-foreground"),
240
241
  children: t.identifier
241
- }), /* @__PURE__ */ R("span", {
242
+ }), /* @__PURE__ */ z("span", {
242
243
  className: W("min-w-0 flex-1 truncate", o ? "text-muted-foreground" : "font-medium text-foreground"),
243
244
  children: t.title
244
245
  })]
245
- }), /* @__PURE__ */ R("span", {
246
+ }), /* @__PURE__ */ z("span", {
246
247
  className: "mt-0.5 block truncate text-xs text-muted-foreground",
247
248
  children: c("from", { name: u(p) })
248
249
  })]
249
250
  }),
250
- /* @__PURE__ */ z("span", {
251
+ /* @__PURE__ */ B("span", {
251
252
  className: "flex shrink-0 flex-col items-end gap-1 pt-0.5",
252
- children: [/* @__PURE__ */ z("span", {
253
+ children: [/* @__PURE__ */ B("span", {
253
254
  className: "flex h-4 items-center",
254
- children: [/* @__PURE__ */ R(l, {
255
+ children: [/* @__PURE__ */ z(l, {
255
256
  category: t.status.category,
256
257
  step: t.status.step
257
- }), /* @__PURE__ */ R("span", {
258
+ }), /* @__PURE__ */ z("span", {
258
259
  className: "sr-only",
259
260
  children: t.status.name
260
261
  })]
261
- }), /* @__PURE__ */ R(T, {
262
+ }), /* @__PURE__ */ z(D, {
262
263
  value: t.createdAt,
263
264
  format: "compact",
264
265
  exact: "medium",
@@ -269,154 +270,123 @@ function ne({ workspace: e, issue: t, onEligible: n, picked: r, current: i, open
269
270
  })
270
271
  });
271
272
  }
272
- function re({ workspace: i, issue: a, onBack: u, onDecided: p }) {
273
- let _ = I("triage"), v = y(), b = F(), ee = V(), x = d(), { data: w } = H(r(i)), { data: T } = B(n(i, a.identifier)), O = T ?? a, { actorName: k, avatarOf: A } = m(i), j = w.find((e) => e.id === O.teamId), M = h(i, O.teamId), N = te({
274
- mutationFn: async (n) => t(await e.POST("/api/v1/workspaces/{workspace}/issues/{identifier}/triage", {
275
- params: { path: {
276
- workspace: i,
277
- identifier: O.identifier
278
- } },
279
- body: { decision: n }
280
- })),
281
- onSuccess: () => {
282
- p(a), ee.invalidateQueries({ queryKey: [
283
- "workspace",
284
- i,
285
- "issues"
286
- ] });
287
- }
288
- }), P = O.creator;
289
- return /* @__PURE__ */ z("article", {
273
+ function re({ workspace: e, issue: t, onBack: i, onDecided: a }) {
274
+ let u = R("triage"), m = b(), g = d(), { data: v } = H(r(e)), { data: y } = V(n(e, t.identifier)), x = y ?? t, { actorName: S, avatarOf: C } = h(e), T = v.find((e) => e.id === x.teamId), E = x.creator;
275
+ return /* @__PURE__ */ B("article", {
290
276
  className: "mx-auto w-full max-w-3xl px-4 py-5 md:px-8",
291
277
  children: [
292
- /* @__PURE__ */ R("button", {
278
+ /* @__PURE__ */ z("button", {
293
279
  type: "button",
294
- onClick: u,
280
+ onClick: i,
295
281
  className: "mb-3 text-xs text-muted-foreground hover:text-foreground md:hidden",
296
- children: _("back")
282
+ children: u("back")
297
283
  }),
298
- /* @__PURE__ */ z("p", {
284
+ /* @__PURE__ */ B("p", {
299
285
  className: "flex items-center gap-1.5 text-xs text-muted-foreground",
300
286
  children: [
301
- j && /* @__PURE__ */ R(s, {
302
- icon: j.icon,
303
- name: j.name,
287
+ T && /* @__PURE__ */ z(s, {
288
+ icon: T.icon,
289
+ name: T.name,
304
290
  className: "size-3.5"
305
291
  }),
306
- /* @__PURE__ */ R("span", {
292
+ /* @__PURE__ */ z("span", {
307
293
  className: "tabular-nums",
308
- children: O.identifier
294
+ children: x.identifier
309
295
  }),
310
- /* @__PURE__ */ R("span", {
296
+ /* @__PURE__ */ z("span", {
311
297
  "aria-hidden": "true",
312
298
  children: "·"
313
299
  }),
314
- /* @__PURE__ */ R(S, {
315
- ...f(P.kind),
316
- name: k(P),
317
- src: A(P.kind, P.handle),
300
+ /* @__PURE__ */ z(w, {
301
+ ...p(E.kind),
302
+ name: S(E),
303
+ src: C(E.kind, E.handle),
318
304
  size: "xs"
319
305
  }),
320
- /* @__PURE__ */ R("span", {
306
+ /* @__PURE__ */ z("span", {
321
307
  className: "truncate",
322
- children: _("from", { name: k(P) })
308
+ children: u("from", { name: S(E) })
323
309
  }),
324
- /* @__PURE__ */ R("span", {
310
+ /* @__PURE__ */ z("span", {
325
311
  "aria-hidden": "true",
326
312
  children: "·"
327
313
  }),
328
- /* @__PURE__ */ R(E, {
329
- content: v.full(O.createdAt),
330
- children: /* @__PURE__ */ R("time", {
331
- dateTime: O.createdAt,
332
- children: v.relative(O.createdAt)
314
+ /* @__PURE__ */ z(O, {
315
+ content: m.full(x.createdAt),
316
+ children: /* @__PURE__ */ z("time", {
317
+ dateTime: x.createdAt,
318
+ children: m.relative(x.createdAt)
333
319
  })
334
320
  })
335
321
  ]
336
322
  }),
337
- /* @__PURE__ */ R("h2", {
323
+ /* @__PURE__ */ z("h2", {
338
324
  className: "mt-1 text-xl font-semibold text-balance",
339
- children: /* @__PURE__ */ R(g, {
325
+ children: /* @__PURE__ */ z(_, {
340
326
  to: "/$workspace/issues/$identifier",
341
327
  params: {
342
- workspace: i,
343
- identifier: O.identifier
328
+ workspace: e,
329
+ identifier: x.identifier
344
330
  },
345
331
  className: "hover:underline",
346
- children: O.title
332
+ children: x.title
347
333
  })
348
334
  }),
349
- /* @__PURE__ */ z("div", {
335
+ /* @__PURE__ */ B("div", {
350
336
  className: "mt-4 flex flex-wrap items-center gap-2",
351
- children: [M && /* @__PURE__ */ z(L, { children: [/* @__PURE__ */ R(C, {
352
- variant: "primary",
353
- size: "sm",
354
- title: _("acceptHelp"),
355
- loading: N.isPending && N.variables === "accept",
356
- disabled: N.isPending,
357
- onClick: () => N.mutate("accept"),
358
- children: _("accept")
359
- }), /* @__PURE__ */ R(C, {
360
- variant: "outline",
361
- size: "sm",
362
- title: _("declineHelp"),
363
- loading: N.isPending && N.variables === "decline",
364
- disabled: N.isPending,
365
- onClick: () => N.mutate("decline"),
366
- children: _("decline")
367
- })] }), /* @__PURE__ */ R(g, {
337
+ children: [/* @__PURE__ */ z(f, {
338
+ workspace: e,
339
+ issue: x,
340
+ onDecided: () => a(t)
341
+ }), /* @__PURE__ */ z(_, {
368
342
  to: "/$workspace/issues/$identifier",
369
343
  params: {
370
- workspace: i,
371
- identifier: O.identifier
344
+ workspace: e,
345
+ identifier: x.identifier
372
346
  },
373
- className: D({
347
+ className: k({
374
348
  size: "sm",
375
349
  variant: "ghost"
376
350
  }),
377
- children: _("openIssue")
351
+ children: u("openIssue")
378
352
  })]
379
353
  }),
380
- N.error && /* @__PURE__ */ R("p", {
381
- className: "mt-2 text-xs text-danger",
382
- children: b(N.error)
383
- }),
384
- /* @__PURE__ */ R("p", {
354
+ /* @__PURE__ */ z("p", {
385
355
  className: "mt-3 text-xs text-muted-foreground",
386
- children: _("duplicateHint")
356
+ children: u("duplicateHint")
387
357
  }),
388
- /* @__PURE__ */ z("div", {
358
+ /* @__PURE__ */ B("div", {
389
359
  className: "mt-5 flex flex-wrap items-center gap-x-4 gap-y-1 border-y border-border py-2.5 text-xs text-muted-foreground",
390
360
  children: [
391
- /* @__PURE__ */ z("span", {
361
+ /* @__PURE__ */ B("span", {
392
362
  className: "inline-flex items-center gap-1.5",
393
- children: [/* @__PURE__ */ R(l, {
394
- category: O.status.category,
395
- step: O.status.step
396
- }), O.status.name]
363
+ children: [/* @__PURE__ */ z(l, {
364
+ category: x.status.category,
365
+ step: x.status.step
366
+ }), x.status.name]
397
367
  }),
398
- /* @__PURE__ */ z("span", {
368
+ /* @__PURE__ */ B("span", {
399
369
  className: "inline-flex items-center gap-1.5",
400
- children: [/* @__PURE__ */ R(c, { priority: O.priority }), x[O.priority]]
370
+ children: [/* @__PURE__ */ z(c, { priority: x.priority }), g[x.priority]]
401
371
  }),
402
- O.labels.map((e) => /* @__PURE__ */ z("span", {
372
+ x.labels.map((e) => /* @__PURE__ */ B("span", {
403
373
  className: "inline-flex items-center gap-1.5",
404
- children: [/* @__PURE__ */ R("span", {
374
+ children: [/* @__PURE__ */ z("span", {
405
375
  className: "size-2 rounded-full",
406
376
  style: { background: e.color }
407
377
  }), e.name]
408
378
  }, e.id))
409
379
  ]
410
380
  }),
411
- O.body.trim() ? /* @__PURE__ */ R("div", {
381
+ x.body.trim() ? /* @__PURE__ */ z("div", {
412
382
  className: "mt-5 text-sm",
413
- children: /* @__PURE__ */ R(o, {
414
- value: O.body,
383
+ children: /* @__PURE__ */ z(o, {
384
+ value: x.body,
415
385
  editable: !1
416
386
  })
417
- }) : /* @__PURE__ */ R("p", {
387
+ }) : /* @__PURE__ */ z("p", {
418
388
  className: "mt-5 text-sm text-muted-foreground",
419
- children: _("noDescription")
389
+ children: u("noDescription")
420
390
  })
421
391
  ]
422
392
  });
@@ -4,24 +4,25 @@ import { DecisionCard as a } from "../../components/AgentWork.js";
4
4
  import { Editor as o } from "../../components/Editor.js";
5
5
  import { ArchiveIcon as s, ArrowRightIcon as c, CheckIcon as l, CommentIcon as u, FileTextIcon as d, InboxIcon as f, PriorityIcon as p, ProjectIcon as m, StatusIcon as h, UserIcon as g, usePriorityNames as _ } from "../../components/icons.js";
6
6
  import { PersonHoverCard as v } from "../../components/PersonHoverCard.js";
7
- import { parseApproval as y } from "../../lib/approval.js";
8
- import { copyItem as b, useLinkItems as x } from "../../lib/menus.js";
9
- import { useArchiveNotifications as ee, useReadNotifications as S, useUnreadNotifications as te } from "../../lib/notifications.js";
10
- import { usePageTitle as C } from "../../lib/pageTitle.js";
7
+ import { TriageButtons as y } from "../../components/TriageButtons.js";
8
+ import { parseApproval as b } from "../../lib/approval.js";
9
+ import { copyItem as x, useLinkItems as S } from "../../lib/menus.js";
10
+ import { useArchiveNotifications as ee, useReadNotifications as te, useUnreadNotifications as C } from "../../lib/notifications.js";
11
+ import { usePageTitle as ne } from "../../lib/pageTitle.js";
11
12
  import { usePeople as w } from "../../lib/people.js";
12
13
  import { plainText as T } from "../../lib/plainText.js";
13
- import { Link as E, useNavigate as ne } from "../../lib/router.js";
14
- import { useShortcuts as re } from "../../lib/shortcuts.js";
14
+ import { Link as E, useNavigate as re } from "../../lib/router.js";
15
+ import { useShortcuts as ie } from "../../lib/shortcuts.js";
15
16
  import { Route as D } from "./notifications.js";
16
17
  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";
17
- import { useEffect as ie, useMemo as L, useRef as ae, useState as oe } from "react";
18
+ import { useEffect as ae, useMemo as L, useRef as oe, useState as se } from "react";
18
19
  import { useTranslations as R } from "use-intl";
19
20
  import { Fragment as z, jsx as B, jsxs as V } from "react/jsx-runtime";
20
- import { useQuery as H, useSuspenseQuery as U } from "@tanstack/react-query";
21
- import { ListFilterMenu as se, useListView as W } from "@parallelworks/ui/list";
21
+ import { useQuery as H, useQueryClient as U, useSuspenseQuery as ce } from "@tanstack/react-query";
22
+ import { ListFilterMenu as le, useListView as W } from "@parallelworks/ui/list";
22
23
  // src/routes/$workspace/notifications.tsx?tsr-split=component
23
24
  var G = (...e) => e.filter(Boolean).join(" ");
24
- function ce(e, t) {
25
+ function ue(e, t) {
25
26
  let n = /* @__PURE__ */ new Map();
26
27
  for (let r of t) {
27
28
  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);
@@ -51,7 +52,7 @@ var K = {
51
52
  reminders: ["reminder"],
52
53
  mentions: ["mentioned"]
53
54
  }, q = (e) => e.reason === "reminder" && e.excerpt ? /* @__PURE__ */ new Date(`${e.excerpt}T00:00:00`) : /* @__PURE__ */ new Date(0), J = (e) => e.slice(0, e.lastIndexOf("-"));
54
- function le(e, t) {
55
+ function de(e, t) {
55
56
  let n = R("notifications"), r = L(() => {
56
57
  let e = [{
57
58
  key: "state",
@@ -87,11 +88,11 @@ function le(e, t) {
87
88
  });
88
89
  }
89
90
  function Y() {
90
- let { workspace: e } = D.useParams(), { issue: t } = D.useSearch(), i = R("notifications"), a = ne(), { data: { notifications: o, unread: c } } = U(n(e));
91
- C(c > 0 ? `${i("title")} (${c})` : i("title"));
92
- let u = S(e), d = te(e), p = ee(e), { data: m = [] } = H(r(e)), h = le(e, m), g = h.activeFilterCount > 0, _ = (h.filters.state ?? []).includes("unread"), v = h.filters.kind ?? [], y = h.filters.team ?? [], b = L(() => {
91
+ let { workspace: e } = D.useParams(), { issue: t } = D.useSearch(), i = R("notifications"), a = re(), { data: { notifications: o, unread: c } } = ce(n(e));
92
+ ne(c > 0 ? `${i("title")} (${c})` : i("title"));
93
+ let u = te(e), d = C(e), p = ee(e), { data: m = [] } = H(r(e)), h = de(e, m), g = h.activeFilterCount > 0, _ = (h.filters.state ?? []).includes("unread"), v = h.filters.kind ?? [], y = h.filters.team ?? [], b = L(() => {
93
94
  let n = o.filter((e) => (v.length === 0 || v.some((t) => K[t]?.includes(e.reason))) && (y.length === 0 || !!e.identifier && y.includes(J(e.identifier))));
94
- return ce(e, n).filter((e) => !_ || e.unread.length > 0 || e.key === t);
95
+ return ue(e, n).filter((e) => !_ || e.unread.length > 0 || e.key === t);
95
96
  }, [
96
97
  e,
97
98
  o,
@@ -99,58 +100,58 @@ function Y() {
99
100
  v,
100
101
  y,
101
102
  t
102
- ]), x = b.findIndex((e) => e.key === t), w = x >= 0 ? b[x] : void 0, [T, E] = oe(/* @__PURE__ */ new Set()), O = ae(null), A = L(() => b.filter((e) => T.has(e.key)), [b, T]), N = (t) => {
103
+ ]), x = b.findIndex((e) => e.key === t), S = x >= 0 ? b[x] : void 0, [w, T] = se(/* @__PURE__ */ new Set()), E = oe(null), O = L(() => b.filter((e) => w.has(e.key)), [b, w]), A = (t) => {
103
104
  a({
104
105
  to: "/$workspace/notifications",
105
106
  params: { workspace: e },
106
107
  search: t ? { issue: t.key } : {},
107
108
  replace: !0
108
109
  }), t && t.unread.length > 0 && u.mutate(t.unread);
109
- }, P = (e) => {
110
+ }, N = (e) => {
110
111
  let t = e.flatMap((e) => e.unread);
111
112
  t.length > 0 ? u.mutate(t) : d.mutate(e.flatMap((e) => e.items.map((e) => e.id)));
112
- }, F = (e) => {
113
- if (p.mutate(e.flatMap((e) => e.items.map((e) => e.id))), E(/* @__PURE__ */ new Set()), w && e.includes(w)) {
113
+ }, P = (e) => {
114
+ if (p.mutate(e.flatMap((e) => e.items.map((e) => e.id))), T(/* @__PURE__ */ new Set()), S && e.includes(S)) {
114
115
  let t = b.filter((t) => !e.includes(t));
115
- N(t[t.findIndex((e) => b.indexOf(e) > x)] ?? t.at(-1));
116
+ A(t[t.findIndex((e) => b.indexOf(e) > x)] ?? t.at(-1));
116
117
  }
117
- }, I = (e) => a({ to: e.href }), W = A.length > 0 ? A : w ? [w] : [], q = (e) => E((t) => {
118
+ }, F = (e) => a({ to: e.href }), I = O.length > 0 ? O : S ? [S] : [], U = (e) => T((t) => {
118
119
  let n = new Set(t);
119
120
  return n.has(e.key) ? n.delete(e.key) : n.add(e.key), n;
120
- }), Y = (e, t) => {
121
+ }), W = (e, t) => {
121
122
  let [n, r] = e < t ? [e, t] : [t, e];
122
- E(new Set(b.slice(n, r + 1).map((e) => e.key)));
123
- }, X = (e, t) => {
123
+ T(new Set(b.slice(n, r + 1).map((e) => e.key)));
124
+ }, q = (e, t) => {
124
125
  let n = b.indexOf(t);
125
- e.metaKey || e.ctrlKey ? (q(t), O.current = n) : e.shiftKey ? Y(O.current ?? (x >= 0 ? x : n), n) : (E(/* @__PURE__ */ new Set()), O.current = n, N(t));
126
- }, Z = (e, t) => {
126
+ e.metaKey || e.ctrlKey ? (U(t), E.current = n) : e.shiftKey ? W(E.current ?? (x >= 0 ? x : n), n) : (T(/* @__PURE__ */ new Set()), E.current = n, A(t));
127
+ }, Y = (e, t) => {
127
128
  let n = Math.min(Math.max(x + e, 0), b.length - 1);
128
- t && ((O.current === null || T.size === 0) && (O.current = Math.max(x, 0)), Y(O.current, n)), N(b[n]);
129
+ t && ((E.current === null || w.size === 0) && (E.current = Math.max(x, 0)), W(E.current, n)), A(b[n]);
129
130
  };
130
- re({
131
- j: () => Z(1, !1),
132
- k: () => Z(-1, !1),
133
- J: () => Z(1, !0),
134
- K: () => Z(-1, !0),
135
- ArrowDown: (e) => Z(1, e.shiftKey),
136
- ArrowUp: (e) => Z(-1, e.shiftKey),
131
+ ie({
132
+ j: () => Y(1, !1),
133
+ k: () => Y(-1, !1),
134
+ J: () => Y(1, !0),
135
+ K: () => Y(-1, !0),
136
+ ArrowDown: (e) => Y(1, e.shiftKey),
137
+ ArrowUp: (e) => Y(-1, e.shiftKey),
137
138
  x: () => {
138
- w && (q(w), O.current = x);
139
+ S && (U(S), E.current = x);
139
140
  },
140
- Enter: () => w && I(w),
141
- e: () => W.length > 0 && F(W),
142
- u: () => W.length > 0 && P(W),
143
- Escape: () => T.size > 0 ? E(/* @__PURE__ */ new Set()) : N(void 0)
144
- }), ie(() => {
145
- document.getElementById(`inbox-${w?.key}`)?.scrollIntoView({ block: "nearest" });
146
- }, [w]);
147
- let Q = {
148
- select: N,
149
- toggleRead: P,
150
- archiveGroups: F,
151
- openIssue: I,
152
- clickRow: X,
153
- targetsOf: (e) => T.has(e.key) ? A : (E(/* @__PURE__ */ new Set()), [e])
141
+ Enter: () => S && F(S),
142
+ e: () => I.length > 0 && P(I),
143
+ u: () => I.length > 0 && N(I),
144
+ Escape: () => w.size > 0 ? T(/* @__PURE__ */ new Set()) : A(void 0)
145
+ }), ae(() => {
146
+ document.getElementById(`inbox-${S?.key}`)?.scrollIntoView({ block: "nearest" });
147
+ }, [S]);
148
+ let X = {
149
+ select: A,
150
+ toggleRead: N,
151
+ archiveGroups: P,
152
+ openIssue: F,
153
+ clickRow: q,
154
+ targetsOf: (e) => w.has(e.key) ? O : (T(/* @__PURE__ */ new Set()), [e])
154
155
  };
155
156
  return /* @__PURE__ */ V("div", {
156
157
  className: "flex h-full flex-col",
@@ -166,7 +167,7 @@ function Y() {
166
167
  className: "min-w-0 flex-1 truncate text-xs text-muted-foreground",
167
168
  children: i("unreadCount", { count: c })
168
169
  }),
169
- /* @__PURE__ */ B(se, { view: h }),
170
+ /* @__PURE__ */ B(le, { view: h }),
170
171
  c > 0 && /* @__PURE__ */ V(z, { children: [/* @__PURE__ */ B(k, {
171
172
  type: "button",
172
173
  size: "sm",
@@ -199,16 +200,16 @@ function Y() {
199
200
  })] })
200
201
  ]
201
202
  }),
202
- A.length > 0 && /* @__PURE__ */ V("div", {
203
+ O.length > 0 && /* @__PURE__ */ V("div", {
203
204
  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",
204
205
  children: [
205
206
  /* @__PURE__ */ B("span", {
206
207
  className: "font-medium text-human",
207
- children: i("selected", { count: A.length })
208
+ children: i("selected", { count: O.length })
208
209
  }),
209
- A.length < b.length && /* @__PURE__ */ B("button", {
210
+ O.length < b.length && /* @__PURE__ */ B("button", {
210
211
  type: "button",
211
- onClick: () => E(new Set(b.map((e) => e.key))),
212
+ onClick: () => T(new Set(b.map((e) => e.key))),
212
213
  className: "hover:underline",
213
214
  children: i("selectAll", { count: b.length })
214
215
  }),
@@ -218,25 +219,25 @@ function Y() {
218
219
  /* @__PURE__ */ B(k, {
219
220
  type: "button",
220
221
  size: "sm",
221
- onClick: () => u.mutate(A.flatMap((e) => e.unread)),
222
- disabled: A.every((e) => e.unread.length === 0),
222
+ onClick: () => u.mutate(O.flatMap((e) => e.unread)),
223
+ disabled: O.every((e) => e.unread.length === 0),
223
224
  children: i("markRead")
224
225
  }),
225
226
  /* @__PURE__ */ B(k, {
226
227
  type: "button",
227
228
  size: "sm",
228
- onClick: () => d.mutate(A.flatMap((e) => e.items.map((e) => e.id))),
229
+ onClick: () => d.mutate(O.flatMap((e) => e.items.map((e) => e.id))),
229
230
  children: i("markUnread")
230
231
  }),
231
232
  /* @__PURE__ */ B(k, {
232
233
  type: "button",
233
234
  size: "sm",
234
- onClick: () => F(A),
235
+ onClick: () => P(O),
235
236
  children: i("archive")
236
237
  }),
237
238
  /* @__PURE__ */ B("button", {
238
239
  type: "button",
239
- onClick: () => E(/* @__PURE__ */ new Set()),
240
+ onClick: () => T(/* @__PURE__ */ new Set()),
240
241
  className: "shrink-0 px-1 hover:underline",
241
242
  children: i("clear")
242
243
  })
@@ -264,20 +265,20 @@ function Y() {
264
265
  className: "flex min-h-0 flex-1",
265
266
  children: [/* @__PURE__ */ B("ul", {
266
267
  "aria-label": i("title"),
267
- className: G("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", w ? "hidden" : "flex"),
268
- children: b.map((t) => /* @__PURE__ */ B(ue, {
268
+ className: G("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", S ? "hidden" : "flex"),
269
+ children: b.map((t) => /* @__PURE__ */ B(fe, {
269
270
  workspace: e,
270
271
  group: t,
271
- selected: t === w,
272
- picked: T.has(t.key),
273
- actions: Q
272
+ selected: t === S,
273
+ picked: w.has(t.key),
274
+ actions: X
274
275
  }, t.key))
275
276
  }), /* @__PURE__ */ B("div", {
276
- className: G("min-w-0 flex-1 overflow-y-auto md:block", w ? "block" : "hidden"),
277
- children: w ? /* @__PURE__ */ B(fe, {
277
+ className: G("min-w-0 flex-1 overflow-y-auto md:block", S ? "block" : "hidden"),
278
+ children: S ? /* @__PURE__ */ B(he, {
278
279
  workspace: e,
279
- group: w,
280
- actions: Q
280
+ group: S,
281
+ actions: X
281
282
  }) : /* @__PURE__ */ B("div", {
282
283
  className: "px-6 py-24",
283
284
  children: /* @__PURE__ */ B(j, {
@@ -291,7 +292,7 @@ function Y() {
291
292
  });
292
293
  }
293
294
  function X(e) {
294
- let t = R("notifications"), n = x();
295
+ let t = R("notifications"), n = S();
295
296
  return (r) => {
296
297
  let [i] = r;
297
298
  return [
@@ -308,7 +309,7 @@ function X(e) {
308
309
  ...r.length === 1 && i ? [
309
310
  F,
310
311
  ...n(i.href),
311
- ...i.identifier ? [b(t("copyId"), i.identifier)] : []
312
+ ...i.identifier ? [x(t("copyId"), i.identifier)] : []
312
313
  ] : []
313
314
  ];
314
315
  };
@@ -317,7 +318,7 @@ function Z(e) {
317
318
  let { actorName: t } = w(e);
318
319
  return (e) => e.actor.kind === "agent" && e.agentName ? e.agentName : t(e.actor);
319
320
  }
320
- function ue({ workspace: e, group: t, selected: n, picked: r, actions: a }) {
321
+ function fe({ workspace: e, group: t, selected: n, picked: r, actions: a }) {
321
322
  let o = R("notifications"), { avatarOf: s } = w(e), c = Z(e), l = I(), u = X(a), d = t.items[0], f = c(d), p = t.unread.length > 0;
322
323
  return /* @__PURE__ */ B("li", {
323
324
  id: `inbox-${t.key}`,
@@ -376,7 +377,7 @@ function ue({ workspace: e, group: t, selected: n, picked: r, actions: a }) {
376
377
  actor: f,
377
378
  agent: d.agentName ?? f,
378
379
  date: q(d)
379
- }), d.excerpt && d.reason !== "reminder" && /* @__PURE__ */ V(z, { children: [": ", /* @__PURE__ */ B(me, { text: d.excerpt })] })]
380
+ }), d.excerpt && d.reason !== "reminder" && /* @__PURE__ */ V(z, { children: [": ", /* @__PURE__ */ B(_e, { text: d.excerpt })] })]
380
381
  }), t.items.length > 1 && /* @__PURE__ */ B("span", {
381
382
  className: "shrink-0",
382
383
  children: o("more", { count: t.items.length - 1 })
@@ -414,7 +415,7 @@ function Q(e) {
414
415
  default: return null;
415
416
  }
416
417
  }
417
- function de({ workspace: e, identifier: n }) {
418
+ function pe({ workspace: e, identifier: n }) {
418
419
  let { data: r } = H(t(e, n)), i = _(), { nameOf: a, avatarOf: s } = w(e);
419
420
  return r ? /* @__PURE__ */ V("section", {
420
421
  className: "mt-5 rounded-lg border border-border px-4 py-3",
@@ -451,7 +452,15 @@ function de({ workspace: e, identifier: n }) {
451
452
  })]
452
453
  }) : null;
453
454
  }
454
- function fe({ workspace: e, group: t, actions: n }) {
455
+ function me({ workspace: e, identifier: r }) {
456
+ let i = U(), { data: a } = H(t(e, r));
457
+ return a ? /* @__PURE__ */ B(y, {
458
+ workspace: e,
459
+ issue: a,
460
+ onDecided: () => i.invalidateQueries({ queryKey: n(e).queryKey })
461
+ }) : null;
462
+ }
463
+ function he({ workspace: e, group: t, actions: n }) {
455
464
  let r = R("notifications"), { avatarOf: i } = w(e), a = Z(e), o = I(), s = X(n);
456
465
  return /* @__PURE__ */ V("article", {
457
466
  className: "w-full px-4 py-5 md:px-8",
@@ -497,13 +506,17 @@ function fe({ workspace: e, group: t, actions: n }) {
497
506
  size: "sm",
498
507
  onClick: () => n.archiveGroups([t]),
499
508
  children: r("archive")
509
+ }),
510
+ t.identifier && /* @__PURE__ */ B(me, {
511
+ workspace: e,
512
+ identifier: t.identifier
500
513
  })
501
514
  ]
502
515
  }),
503
- t.identifier && /* @__PURE__ */ V(z, { children: [/* @__PURE__ */ B(de, {
516
+ t.identifier && /* @__PURE__ */ V(z, { children: [/* @__PURE__ */ B(pe, {
504
517
  workspace: e,
505
518
  identifier: t.identifier
506
- }), /* @__PURE__ */ B(he, {
519
+ }), /* @__PURE__ */ B(ve, {
507
520
  workspace: e,
508
521
  identifier: t.identifier
509
522
  })] }),
@@ -545,7 +558,7 @@ function fe({ workspace: e, group: t, actions: n }) {
545
558
  exact: "medium",
546
559
  className: "text-xs text-muted-foreground"
547
560
  })]
548
- }), t.excerpt && t.reason !== "reminder" && /* @__PURE__ */ B(pe, { text: t.excerpt })]
561
+ }), t.excerpt && t.reason !== "reminder" && /* @__PURE__ */ B(ge, { text: t.excerpt })]
549
562
  })]
550
563
  }, t.id);
551
564
  })
@@ -553,8 +566,8 @@ function fe({ workspace: e, group: t, actions: n }) {
553
566
  ]
554
567
  });
555
568
  }
556
- function pe({ text: e }) {
557
- let t = R("agentWork"), n = y(e);
569
+ function ge({ text: e }) {
570
+ let t = R("agentWork"), n = b(e);
558
571
  return n ? /* @__PURE__ */ V("div", {
559
572
  className: "mt-1 min-w-0 text-sm text-muted-foreground",
560
573
  children: [
@@ -576,14 +589,14 @@ function pe({ text: e }) {
576
589
  })
577
590
  });
578
591
  }
579
- function me({ text: e }) {
580
- let t = y(e);
592
+ function _e({ text: e }) {
593
+ let t = b(e);
581
594
  return t ? /* @__PURE__ */ B("code", {
582
595
  className: "font-mono",
583
596
  children: t.command
584
597
  }) : T(e);
585
598
  }
586
- function he({ workspace: t, identifier: n }) {
599
+ function ve({ workspace: t, identifier: n }) {
587
600
  let r = R("notifications"), { data: i = [] } = H(e(t, n)), o = i.filter((e) => !e.answer && !e.canceled);
588
601
  return o.length === 0 ? null : /* @__PURE__ */ V("section", {
589
602
  "aria-label": r("waitingOnYou"),