@parallelworks/tandem-web 0.138.2 → 0.139.1
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/AgentWork.js +35 -35
- package/components/AppRoot.js +8 -7
- package/components/AreaWork.js +1 -1
- package/components/BlockHandle.js +3 -3
- package/components/CommandPalette.js +27 -27
- package/components/DateChip.js +27 -27
- package/components/DocLinkPicker.js +17 -17
- package/components/Graph.js +6 -6
- package/components/HoverCards.js +30 -29
- package/components/IssueListBlock.js +83 -83
- package/components/LinkCard.js +20 -20
- package/components/MentionPicker.js +12 -12
- package/components/NewIssueDialog.js +116 -116
- package/components/NewProjectDialog.js +5 -4
- package/components/Planning.js +31 -43
- package/components/RouterLink.js +4 -4
- package/components/ShareDialog.js +12 -12
- package/components/SharedUI.js +19 -19
- package/components/SlashMenu.js +11 -11
- package/components/SubPages.js +10 -10
- package/components/UnlinkedMentions.js +10 -10
- package/components/WorkCounts.js +8 -8
- package/components/settings.js +31 -31
- package/hostedApp.js +41 -39
- package/hosting.d.ts +24 -11
- package/index.js +58 -27
- package/lib/base.js +1 -14
- package/lib/docs.js +6 -6
- package/lib/issueMenu.js +33 -33
- package/lib/knowledge.js +90 -101
- package/lib/knowledgeKinds.js +14 -0
- package/lib/pageTitle.js +22 -10
- package/lib/projectList.js +1 -1
- package/lib/projectStates.js +15 -0
- package/lib/router.js +20 -34
- package/package.json +2 -2
- package/pages/areas.js +223 -223
- package/pages/decisions.js +69 -69
- package/pages/issues.js +38 -38
- package/pages/projects.js +268 -267
- package/pages/triage.js +133 -133
- package/pages.js +21 -0
- package/routes/__root.js +6 -6
- package/routes/_workspace/agents/_slug2.js +21 -21
- package/routes/_workspace/agents/index2.js +16 -16
- package/routes/_workspace/areas/_area2.js +105 -105
- package/routes/_workspace/docs/_doc2.js +189 -189
- package/routes/_workspace/docs2.js +8 -8
- package/routes/_workspace/graph2.js +9 -9
- package/routes/_workspace/graph3.js +8 -8
- package/routes/_workspace/issues/_identifier2.js +249 -249
- package/routes/_workspace/issues/index.js +6 -6
- package/routes/_workspace/knowledge/_term2.js +119 -118
- package/routes/_workspace/knowledge/index.js +8 -8
- package/routes/_workspace/knowledge/index2.js +41 -40
- package/routes/_workspace/measures2.js +4 -4
- package/routes/_workspace/measures3.js +18 -18
- package/routes/_workspace/notifications2.js +112 -112
- package/routes/_workspace/people/_username.js +4 -4
- package/routes/_workspace/people/_username2.js +36 -36
- package/routes/_workspace/projects/_projectId3.js +369 -368
- package/routes/_workspace/projects/index.js +7 -7
- package/routes/_workspace/settings/account2.js +3 -3
- package/routes/_workspace/settings/audit-log2.js +4 -4
- package/routes/_workspace/settings/audit-log3.js +51 -51
- package/routes/_workspace/settings/labels2.js +14 -14
- package/routes/_workspace/settings/members2.js +9 -9
- package/routes/_workspace/settings/runners2.js +11 -11
- package/routes/_workspace/settings/teams2.js +15 -15
- package/routes/_workspace/settings/tokens2.js +5 -5
- package/routes/_workspace/settings/webhooks2.js +7 -7
- package/routes/_workspace/settings2.js +3 -3
- package/routes/_workspace/teams/_key/cycles/_number2.js +16 -16
- package/routes/_workspace/teams/_key/cycles/index2.js +40 -40
- package/routes/_workspace/teams/_key/issues.js +4 -4
- package/routes/_workspace/teams/_key/projects.js +4 -4
- package/routes/_workspace/teams/_key/settings2.js +133 -133
- package/routes/_workspace2.js +319 -319
- package/routes/docs/route2.js +19 -19
- package/routes/new2.js +8 -8
- package/routes/request2._token.js +4 -4
package/components/AgentWork.js
CHANGED
|
@@ -4,13 +4,13 @@ import { Link as r, useNavigate as i } from "../lib/router.js";
|
|
|
4
4
|
import { agentsQuery as a, attachmentsQuery as o, issueDecisionsQuery as s, pullRequestsQuery as c, runActivityQuery as l, runReadsQuery as u, runsQuery as d } from "../api/queries.js";
|
|
5
5
|
import { AreaIcon as f, FileTextIcon as p, LibraryIcon as m, PullRequestIcon as ee } from "./icons.js";
|
|
6
6
|
import { copyItem as h, useLinkItems as g } from "../lib/menus.js";
|
|
7
|
-
import {
|
|
7
|
+
import { docRef as _ } from "../lib/docs.js";
|
|
8
|
+
import { invalidateIssueViews as v } from "../api/mutations.js";
|
|
8
9
|
import { useTime as y } from "../lib/time.js";
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import { useRunPanel as w } from "../lib/hostPanel.js";
|
|
10
|
+
import { usePeople as b } from "../lib/people.js";
|
|
11
|
+
import { useNewIssue as x } from "../lib/newIssue.js";
|
|
12
|
+
import { useRunPanel as S } from "../lib/hostPanel.js";
|
|
13
|
+
import { EntryDialog as C, useTermRefs as w } from "../lib/knowledge.js";
|
|
14
14
|
import { externalUrl as T } from "../lib/externalUrl.js";
|
|
15
15
|
import { Editor as E } from "./Editor.js";
|
|
16
16
|
import { harnessNames as D } from "../lib/agents.js";
|
|
@@ -19,17 +19,17 @@ import { parseApproval as ne } from "../lib/approval.js";
|
|
|
19
19
|
import { decisionDefaults as O } from "../lib/decisionEntry.js";
|
|
20
20
|
import { AgentPage as k } from "./AgentPage.js";
|
|
21
21
|
import { Avatar as re, Button as A, Card as ie, CopyCodeBlock as j, Disclosure as M, ErrorText as ae, NumberInput as N, RelativeTime as P, Tooltip as F, menuDivider as oe, useOpenMenu as se } from "@parallelworks/ui";
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
22
|
+
import { useParams as I } from "@tanstack/react-router";
|
|
23
|
+
import { Suspense as ce, useCallback as L, useEffect as le, useRef as R, useState as z } from "react";
|
|
24
|
+
import { useErrorMessage as ue } from "@parallelworks/problem/react";
|
|
25
|
+
import { useFormatter as de, useTranslations as B } from "use-intl";
|
|
25
26
|
import { Fragment as V, jsx as H, jsxs as U } from "react/jsx-runtime";
|
|
26
|
-
import { useParams as de } from "@tanstack/react-router";
|
|
27
27
|
import { useMutation as fe, useQuery as W, useQueryClient as pe, useSuspenseQuery as G } from "@tanstack/react-query";
|
|
28
28
|
import { MoreButton as me } from "@parallelworks/ui/list";
|
|
29
29
|
// src/components/AgentWork.tsx
|
|
30
30
|
var he = "var(--agent-tone)";
|
|
31
31
|
function ge() {
|
|
32
|
-
let e =
|
|
32
|
+
let e = de();
|
|
33
33
|
return (t) => e.number(t / 1e6, {
|
|
34
34
|
style: "currency",
|
|
35
35
|
currency: "USD"
|
|
@@ -58,8 +58,8 @@ function _e({ workspace: e, identifier: t }) {
|
|
|
58
58
|
});
|
|
59
59
|
}
|
|
60
60
|
function ve({ workspace: n, identifier: r, run: o }) {
|
|
61
|
-
let s = B("agentWork"), l = B("common"), u =
|
|
62
|
-
|
|
61
|
+
let s = B("agentWork"), l = B("common"), u = ue(), f = te(), p = y(), m = ge(), g = (e) => s(`state.${e}`), { nameOf: _ } = b(n), x = pe(), [C, w] = z(o.state === "working"), ne = () => {
|
|
62
|
+
x.invalidateQueries({ queryKey: d(n, r).queryKey }), v(x, n, r);
|
|
63
63
|
}, O = fe({
|
|
64
64
|
mutationFn: async (r) => t(await e.POST("/api/v1/workspaces/{workspace}/runs/{runId}/move", {
|
|
65
65
|
params: { path: {
|
|
@@ -90,7 +90,7 @@ function ve({ workspace: n, identifier: r, run: o }) {
|
|
|
90
90
|
j(!1), N("");
|
|
91
91
|
},
|
|
92
92
|
onSettled: ne
|
|
93
|
-
}), F = O.isPending || P.isPending, I = xe(o), [ce, L] = z(!1),
|
|
93
|
+
}), F = O.isPending || P.isPending, I = xe(o), [ce, L] = z(!1), le = () => I ? L(!0) : O.mutate({ state: "queued" }), R = I && {
|
|
94
94
|
turns: {
|
|
95
95
|
used: o.turns,
|
|
96
96
|
allowed: o.budget.maxTurns
|
|
@@ -103,7 +103,7 @@ function ve({ workspace: n, identifier: r, run: o }) {
|
|
|
103
103
|
used: m(o.costMicros),
|
|
104
104
|
allowed: m(o.budget.maxCostMicros)
|
|
105
105
|
}
|
|
106
|
-
}[I], de = !["closed", "stopped"].includes(o.state), G = o.state === "done_pending_verification", _e = se(), ve = i(), { data: be = [] } = W(a(n)), q = be.find((e) => e.id === o.agentId), { data: we = [] } = W(c(n, r)), J = we.find((e) => e.runId === o.id), Te = B("code"), Y = q?.slug, X =
|
|
106
|
+
}[I], de = !["closed", "stopped"].includes(o.state), G = o.state === "done_pending_verification", _e = se(), ve = i(), { data: be = [] } = W(a(n)), q = be.find((e) => e.id === o.agentId), { data: we = [] } = W(c(n, r)), J = we.find((e) => e.runId === o.id), Te = B("code"), Y = q?.slug, X = S(), Z = X && (o.harnessSession || o.runnerName) ? {
|
|
107
107
|
label: s("openRunIn", { name: X.action.label }),
|
|
108
108
|
onClick: () => X.open(o)
|
|
109
109
|
} : void 0, Q = () => [
|
|
@@ -117,7 +117,7 @@ function ve({ workspace: n, identifier: r, run: o }) {
|
|
|
117
117
|
}] : [],
|
|
118
118
|
...o.state === "stopped" || o.state === "blocked_external" ? [{
|
|
119
119
|
label: s("resume"),
|
|
120
|
-
onClick: () =>
|
|
120
|
+
onClick: () => le()
|
|
121
121
|
}] : [],
|
|
122
122
|
...de ? [{
|
|
123
123
|
label: s("stop"),
|
|
@@ -238,9 +238,9 @@ function ve({ workspace: n, identifier: r, run: o }) {
|
|
|
238
238
|
asked: f(o.agentPermissionMode)
|
|
239
239
|
})
|
|
240
240
|
}),
|
|
241
|
-
o.state === "stopped" && I &&
|
|
241
|
+
o.state === "stopped" && I && R ? /* @__PURE__ */ H("p", {
|
|
242
242
|
className: "px-3 pt-1.5 text-pretty",
|
|
243
|
-
children: s(`spent.${I}`,
|
|
243
|
+
children: s(`spent.${I}`, R)
|
|
244
244
|
}) : o.stopReason && o.state !== "working" && o.state !== "queued" && /* @__PURE__ */ H("p", {
|
|
245
245
|
className: "px-3 pt-1.5 text-pretty",
|
|
246
246
|
children: o.stopReason
|
|
@@ -334,7 +334,7 @@ function ve({ workspace: n, identifier: r, run: o }) {
|
|
|
334
334
|
(o.state === "stopped" || o.state === "blocked_external") && !ce && /* @__PURE__ */ H(A, {
|
|
335
335
|
size: "sm",
|
|
336
336
|
disabled: F,
|
|
337
|
-
onClick: () =>
|
|
337
|
+
onClick: () => le(),
|
|
338
338
|
children: s("resume")
|
|
339
339
|
}),
|
|
340
340
|
$ && /* @__PURE__ */ H(A, {
|
|
@@ -347,9 +347,9 @@ function ve({ workspace: n, identifier: r, run: o }) {
|
|
|
347
347
|
o.state !== "queued" && /* @__PURE__ */ H(A, {
|
|
348
348
|
size: "sm",
|
|
349
349
|
type: "button",
|
|
350
|
-
"aria-expanded":
|
|
351
|
-
onClick: () =>
|
|
352
|
-
children: s(
|
|
350
|
+
"aria-expanded": C,
|
|
351
|
+
onClick: () => w((e) => !e),
|
|
352
|
+
children: s(C ? "activity.hide" : "activity.show")
|
|
353
353
|
}),
|
|
354
354
|
/* @__PURE__ */ H("span", {
|
|
355
355
|
className: "ml-auto text-xs text-muted-foreground tabular-nums",
|
|
@@ -369,7 +369,7 @@ function ve({ workspace: n, identifier: r, run: o }) {
|
|
|
369
369
|
})
|
|
370
370
|
]
|
|
371
371
|
}),
|
|
372
|
-
|
|
372
|
+
C && o.state !== "queued" && /* @__PURE__ */ H(ye, {
|
|
373
373
|
workspace: n,
|
|
374
374
|
run: o
|
|
375
375
|
})
|
|
@@ -378,7 +378,7 @@ function ve({ workspace: n, identifier: r, run: o }) {
|
|
|
378
378
|
}
|
|
379
379
|
function ye({ workspace: e, run: t }) {
|
|
380
380
|
let n = B("agentWork.activity"), r = y(), i = t.state === "working", { data: a, isPending: o, isError: s } = W(l(e, t.id, i)), c = R(null), u = R(!0), d = a?.length ?? 0;
|
|
381
|
-
return
|
|
381
|
+
return le(() => {
|
|
382
382
|
let e = c.current;
|
|
383
383
|
e && u.current && d > 0 && (e.scrollTop = e.scrollHeight);
|
|
384
384
|
}, [d]), /* @__PURE__ */ U("div", {
|
|
@@ -543,7 +543,7 @@ function Se({ run: e, busy: t, onSubmit: n, onCancel: r }) {
|
|
|
543
543
|
}
|
|
544
544
|
var K = (...e) => e.filter(Boolean).join(" ");
|
|
545
545
|
function Ce({ workspace: e, run: t }) {
|
|
546
|
-
let n =
|
|
546
|
+
let n = w(e), i = B("agentWork"), [a, o] = z(!1), { data: s } = W({
|
|
547
547
|
...u(e, t.id),
|
|
548
548
|
enabled: a
|
|
549
549
|
});
|
|
@@ -562,7 +562,7 @@ function Ce({ workspace: e, run: t }) {
|
|
|
562
562
|
to: "/$workspace/docs/$doc",
|
|
563
563
|
params: {
|
|
564
564
|
workspace: e,
|
|
565
|
-
doc:
|
|
565
|
+
doc: _(t)
|
|
566
566
|
},
|
|
567
567
|
className: "inline-flex items-center gap-1 hover:underline",
|
|
568
568
|
children: [/* @__PURE__ */ H(p, { className: "size-3.5 text-muted-foreground" }), t.title]
|
|
@@ -677,7 +677,7 @@ function J({ workspace: e, decision: t }) {
|
|
|
677
677
|
}) : null;
|
|
678
678
|
}
|
|
679
679
|
function Te({ workspace: e, decision: t, onAnswer: n, busy: r }) {
|
|
680
|
-
let i = B("agentPage"), a = q(), { data: s = [] } = W(o(e, t.identifier)), [c, l] = z(null), u =
|
|
680
|
+
let i = B("agentPage"), a = q(), { data: s = [] } = W(o(e, t.identifier)), [c, l] = z(null), u = L((e) => {
|
|
681
681
|
t.options.some((t) => t.id === e) && l(e);
|
|
682
682
|
}, [t.options]), d = s.find((e) => e.id === t.pageId), f = t.options.find((e) => e.id === c);
|
|
683
683
|
return /* @__PURE__ */ U("div", {
|
|
@@ -709,7 +709,7 @@ function Te({ workspace: e, decision: t, onAnswer: n, busy: r }) {
|
|
|
709
709
|
});
|
|
710
710
|
}
|
|
711
711
|
function Y(e) {
|
|
712
|
-
let t = B("agentWork"), n = q(), r =
|
|
712
|
+
let t = B("agentWork"), n = q(), r = x(), { workspace: i } = I({ strict: !1 });
|
|
713
713
|
if (i !== e.workspace) return [];
|
|
714
714
|
let a = e.options.find((t) => t.id === e.answer?.optionId), o = [a && n(e, a), e.answer?.text].filter(Boolean).join(". "), s = e.prompt.split("\n").map((e) => `> ${e}`).join("\n");
|
|
715
715
|
return [{
|
|
@@ -738,7 +738,7 @@ function Q() {
|
|
|
738
738
|
});
|
|
739
739
|
}
|
|
740
740
|
function $({ workspace: r, decision: a, showIssue: o = !1 }) {
|
|
741
|
-
let s =
|
|
741
|
+
let s = ue(), c = B("agentWork"), l = q(), u = g(), d = pe(), f = B("common"), [p, m] = z(""), [ee, h] = z(0), [_, v] = z(!1), y = X(a), b = !y && a.options.some((e) => e.description), x = y ? [...a.options].sort((e, t) => Z(e.id) - Z(t.id)) : a.options, S = fe({
|
|
742
742
|
mutationFn: async (n) => t(await e.POST("/api/v1/workspaces/{workspace}/decisions/{decisionId}/answer", {
|
|
743
743
|
params: { path: {
|
|
744
744
|
workspace: r,
|
|
@@ -954,7 +954,7 @@ function Ee({ workspace: e, decision: t }) {
|
|
|
954
954
|
to: "/$workspace/docs/$doc",
|
|
955
955
|
params: {
|
|
956
956
|
workspace: e,
|
|
957
|
-
doc:
|
|
957
|
+
doc: _(a)
|
|
958
958
|
},
|
|
959
959
|
className: "flex min-w-0 items-center gap-1 hover:text-foreground",
|
|
960
960
|
children: [/* @__PURE__ */ H(p, { className: "size-3.5 shrink-0" }), /* @__PURE__ */ H("span", {
|
|
@@ -1062,8 +1062,8 @@ function Oe({ workspace: e, decisions: t }) {
|
|
|
1062
1062
|
});
|
|
1063
1063
|
}
|
|
1064
1064
|
function ke({ workspace: e, decision: t, showIssue: a = !1, showWorkspace: o = !1, bare: s = !1 }) {
|
|
1065
|
-
let c =
|
|
1066
|
-
...
|
|
1065
|
+
let c = w(e), l = B("agentWork"), u = y(), { person: d } = b(e), f = se(), p = g(), m = i(), [ee, h] = z(!1), _ = q(), v = t.options.find((e) => e.id === t.answer?.optionId), x = [v && _(t, v), t.answer?.text].filter(Boolean).join(". "), S = !!t.breakdown?.length || !!t.merge || !!t.release, T = () => h(!0), E = Y(t), D = (r) => f(r, [
|
|
1066
|
+
...S ? [] : [t.savedAs ? {
|
|
1067
1067
|
label: l("savedAsDecision"),
|
|
1068
1068
|
onClick: () => m({
|
|
1069
1069
|
to: "/$workspace/knowledge/$term",
|
|
@@ -1113,14 +1113,14 @@ function ke({ workspace: e, decision: t, showIssue: a = !1, showWorkspace: o = !
|
|
|
1113
1113
|
}),
|
|
1114
1114
|
/* @__PURE__ */ H("p", {
|
|
1115
1115
|
className: "mt-1 font-medium",
|
|
1116
|
-
children:
|
|
1116
|
+
children: x
|
|
1117
1117
|
}),
|
|
1118
1118
|
/* @__PURE__ */ H(J, {
|
|
1119
1119
|
workspace: e,
|
|
1120
1120
|
decision: t
|
|
1121
1121
|
}),
|
|
1122
1122
|
/* @__PURE__ */ H("div", {
|
|
1123
|
-
className:
|
|
1123
|
+
className: S ? "hidden" : "mt-2",
|
|
1124
1124
|
children: t.savedAs ? /* @__PURE__ */ H(r, {
|
|
1125
1125
|
to: "/$workspace/knowledge/$term",
|
|
1126
1126
|
params: {
|
|
@@ -1135,7 +1135,7 @@ function ke({ workspace: e, decision: t, showIssue: a = !1, showWorkspace: o = !
|
|
|
1135
1135
|
children: l("saveAsDecision")
|
|
1136
1136
|
})
|
|
1137
1137
|
}),
|
|
1138
|
-
ee && /* @__PURE__ */ H(
|
|
1138
|
+
ee && /* @__PURE__ */ H(ce, { children: /* @__PURE__ */ H(C, {
|
|
1139
1139
|
workspace: e,
|
|
1140
1140
|
mode: {
|
|
1141
1141
|
kind: "create",
|
package/components/AppRoot.js
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { PageTitle as e } from "../lib/pageTitle.js";
|
|
2
|
+
import { SharedUI as t } from "./SharedUI.js";
|
|
3
3
|
import { Outlet as n } from "@tanstack/react-router";
|
|
4
|
+
import { jsx as r, jsxs as i } from "react/jsx-runtime";
|
|
4
5
|
// src/components/AppRoot.tsx
|
|
5
|
-
function
|
|
6
|
-
return /* @__PURE__ */ t
|
|
6
|
+
function a() {
|
|
7
|
+
return /* @__PURE__ */ i(t, { children: [/* @__PURE__ */ r(e, {}), /* @__PURE__ */ r("div", {
|
|
7
8
|
className: "flex min-h-dvh flex-col",
|
|
8
|
-
children: /* @__PURE__ */
|
|
9
|
-
}) });
|
|
9
|
+
children: /* @__PURE__ */ r(n, {})
|
|
10
|
+
})] });
|
|
10
11
|
}
|
|
11
|
-
export {
|
|
12
|
+
export { a as default };
|
package/components/AreaWork.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Link as e } from "../lib/router.js";
|
|
2
2
|
import { ChevronRightIcon as t } from "./icons.js";
|
|
3
|
-
import { termRef as n } from "../lib/
|
|
3
|
+
import { termRef as n } from "../lib/knowledgeKinds.js";
|
|
4
4
|
import { AnsweredDecision as r } from "./AgentWork.js";
|
|
5
5
|
import { useState as i } from "react";
|
|
6
6
|
import { useTranslations as a } from "use-intl";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { copyItem as e } from "../lib/menus.js";
|
|
2
|
+
import { headingAnchor as t } from "../lib/glossary.js";
|
|
3
3
|
import { commands as n } from "./SlashMenu.js";
|
|
4
4
|
import { menuDivider as r, useOpenMenu as i } from "@parallelworks/ui";
|
|
5
5
|
import { useState as a } from "react";
|
|
@@ -76,7 +76,7 @@ function m({ editor: m }) {
|
|
|
76
76
|
label: h("duplicate"),
|
|
77
77
|
onClick: () => m.chain().focus().insertContentAt(_.pos + _.node.nodeSize, _.node.toJSON()).run()
|
|
78
78
|
},
|
|
79
|
-
..._.node.type.name === "heading" ? [
|
|
79
|
+
..._.node.type.name === "heading" ? [e(h("copyLink"), `${window.location.href.split("#")[0]}#${t(_.node.textContent)}`)] : [],
|
|
80
80
|
r,
|
|
81
81
|
{
|
|
82
82
|
label: h("delete"),
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
1
|
+
import { useHost as e } from "../lib/host.js";
|
|
2
|
+
import { useNavigate as t } from "../lib/router.js";
|
|
3
|
+
import { docQuery as n, docsQuery as r, issueSearchQuery as i, knowledgeQuery as a, meQuery as o, teamsQuery as ee } from "../api/queries.js";
|
|
4
|
+
import { AddIcon as s, AreaIcon as te, CheckIcon as ne, ChevronRightIcon as re, CloseIcon as ie, CycleIcon as ae, FileTextIcon as c, InboxIcon as l, LibraryIcon as u, ListViewIcon as d, NotificationIcon as oe, ProjectIcon as f, SearchIcon as se, SettingsIcon as ce, StatusIcon as le, TriageIcon as ue, UserIcon as p, UsersIcon as m } from "./icons.js";
|
|
5
|
+
import { teamPath as de } from "../lib/teamPaths.js";
|
|
6
|
+
import { docPath as h, useDocActions as fe } from "../lib/docs.js";
|
|
7
|
+
import { headingAnchor as pe, headings as me } from "../lib/glossary.js";
|
|
8
8
|
import { useIssueMenu as he } from "../lib/issueMenu.js";
|
|
9
9
|
import { useNewIssue as ge } from "../lib/newIssue.js";
|
|
10
10
|
import { fuzzyScore as g, namedFirst as _e } from "../lib/palette.js";
|
|
@@ -57,11 +57,11 @@ function Pe(e, t) {
|
|
|
57
57
|
return n;
|
|
58
58
|
}
|
|
59
59
|
function D({ workspace: v, open: D, onClose: O, selection: k }) {
|
|
60
|
-
let A = x("palette"), j = x("common"), M = x("workspace"), N =
|
|
61
|
-
...
|
|
60
|
+
let A = x("palette"), j = x("common"), M = x("workspace"), N = e(), Fe = x("measures"), Ie = x("graphPage"), Le = t(), Re = ge(), { data: P } = Me(o), { data: ze = [] } = T(ee(v)), { data: Be = [] } = T({
|
|
61
|
+
...a(v),
|
|
62
62
|
enabled: D
|
|
63
|
-
}), Ve =
|
|
64
|
-
...
|
|
63
|
+
}), Ve = fe(v), { views: He } = be(v), F = ye(), Ue = he(v), [I, L] = b(""), [R, z] = b(""), { data: B = [] } = T({
|
|
64
|
+
...r(v, { title: R }),
|
|
65
65
|
enabled: D && R !== "",
|
|
66
66
|
placeholderData: w
|
|
67
67
|
}), [We, V] = b([]), H = Ae(null);
|
|
@@ -72,17 +72,17 @@ function D({ workspace: v, open: D, onClose: O, selection: k }) {
|
|
|
72
72
|
return () => clearTimeout(e);
|
|
73
73
|
}, [I]);
|
|
74
74
|
let U = We.at(-1), W = D && !U && R !== "", { data: G } = T({
|
|
75
|
-
...
|
|
75
|
+
...i(v, { q: R }),
|
|
76
76
|
enabled: W,
|
|
77
77
|
placeholderData: w
|
|
78
78
|
}), { data: K = [] } = T({
|
|
79
|
-
...
|
|
79
|
+
...r(v, { q: R }),
|
|
80
80
|
enabled: W,
|
|
81
81
|
placeholderData: w
|
|
82
82
|
}), Ge = je({ queries: K.slice(0, 3).map((e) => ({
|
|
83
|
-
...
|
|
83
|
+
...n(v, e.key),
|
|
84
84
|
enabled: W
|
|
85
|
-
})) }), q = K.slice(0, 3).flatMap((e, t) =>
|
|
85
|
+
})) }), q = K.slice(0, 3).flatMap((e, t) => me(Ge[t]?.data?.body ?? "").filter((e) => g(R, e.text) !== null).slice(0, 3).map((t) => ({
|
|
86
86
|
doc: e,
|
|
87
87
|
heading: t.text
|
|
88
88
|
}))), J = D ? ve(v) : [], Ke = P?.workspaces.find((e) => e.slug === v)?.name ?? v, Y = ze.filter((e) => !e.archivedAt), X = (e) => () => Le({ href: e }), qe = (() => {
|
|
@@ -120,7 +120,7 @@ function D({ workspace: v, open: D, onClose: O, selection: k }) {
|
|
|
120
120
|
items: G.issues.slice(0, 8).map((e) => ({
|
|
121
121
|
id: e.id,
|
|
122
122
|
label: `${e.identifier} ${e.title}`,
|
|
123
|
-
icon: /* @__PURE__ */ S(
|
|
123
|
+
icon: /* @__PURE__ */ S(le, { category: e.status.category }),
|
|
124
124
|
run: X(`/${v}/issues/${e.identifier}`)
|
|
125
125
|
}))
|
|
126
126
|
}), t.push({
|
|
@@ -172,7 +172,7 @@ function D({ workspace: v, open: D, onClose: O, selection: k }) {
|
|
|
172
172
|
{
|
|
173
173
|
id: "notifications",
|
|
174
174
|
label: A("goTo", { page: M("notifications") }),
|
|
175
|
-
icon: /* @__PURE__ */ S(
|
|
175
|
+
icon: /* @__PURE__ */ S(oe, { className: E }),
|
|
176
176
|
run: X(`/${v}/notifications`)
|
|
177
177
|
},
|
|
178
178
|
{
|
|
@@ -202,7 +202,7 @@ function D({ workspace: v, open: D, onClose: O, selection: k }) {
|
|
|
202
202
|
...Y.some((e) => e.triageEnabled) ? [[
|
|
203
203
|
"triage",
|
|
204
204
|
M("triage"),
|
|
205
|
-
|
|
205
|
+
ue
|
|
206
206
|
]] : [],
|
|
207
207
|
[
|
|
208
208
|
"measures",
|
|
@@ -217,7 +217,7 @@ function D({ workspace: v, open: D, onClose: O, selection: k }) {
|
|
|
217
217
|
[
|
|
218
218
|
"settings",
|
|
219
219
|
M("settings"),
|
|
220
|
-
|
|
220
|
+
ce
|
|
221
221
|
]
|
|
222
222
|
].map(([e, t, n]) => ({
|
|
223
223
|
id: e,
|
|
@@ -265,7 +265,7 @@ function D({ workspace: v, open: D, onClose: O, selection: k }) {
|
|
|
265
265
|
color: e.color,
|
|
266
266
|
name: e.name
|
|
267
267
|
}),
|
|
268
|
-
run: X(
|
|
268
|
+
run: X(de(v, e.key, "issues"))
|
|
269
269
|
}))
|
|
270
270
|
}), N?.controls?.length && t.push({
|
|
271
271
|
id: "host",
|
|
@@ -292,7 +292,7 @@ function D({ workspace: v, open: D, onClose: O, selection: k }) {
|
|
|
292
292
|
[
|
|
293
293
|
"areas",
|
|
294
294
|
M("areas"),
|
|
295
|
-
|
|
295
|
+
te,
|
|
296
296
|
`teams/${t}/areas`
|
|
297
297
|
],
|
|
298
298
|
[
|
|
@@ -304,7 +304,7 @@ function D({ workspace: v, open: D, onClose: O, selection: k }) {
|
|
|
304
304
|
...e.cyclesEnabled ? [[
|
|
305
305
|
"cycles",
|
|
306
306
|
M("cycles"),
|
|
307
|
-
|
|
307
|
+
ae,
|
|
308
308
|
`cycles/${t}`
|
|
309
309
|
]] : []
|
|
310
310
|
].map(([t, n, r, i]) => ({
|
|
@@ -357,7 +357,7 @@ function D({ workspace: v, open: D, onClose: O, selection: k }) {
|
|
|
357
357
|
icon: e.icon,
|
|
358
358
|
className: E
|
|
359
359
|
}),
|
|
360
|
-
run: X(`${h(v, e)}#${
|
|
360
|
+
run: X(`${h(v, e)}#${pe(t)}`)
|
|
361
361
|
}))
|
|
362
362
|
}), t.push({
|
|
363
363
|
id: "knowledge",
|
|
@@ -417,7 +417,7 @@ function D({ workspace: v, open: D, onClose: O, selection: k }) {
|
|
|
417
417
|
/* @__PURE__ */ C("div", {
|
|
418
418
|
className: "flex h-12 shrink-0 items-center gap-2 border-b border-border px-3",
|
|
419
419
|
children: [
|
|
420
|
-
/* @__PURE__ */ S(
|
|
420
|
+
/* @__PURE__ */ S(se, { className: "size-4 shrink-0 text-muted-foreground" }),
|
|
421
421
|
U && /* @__PURE__ */ S(Oe, {
|
|
422
422
|
content: A("back"),
|
|
423
423
|
children: /* @__PURE__ */ S("button", {
|
|
@@ -445,7 +445,7 @@ function D({ workspace: v, open: D, onClose: O, selection: k }) {
|
|
|
445
445
|
/* @__PURE__ */ S(we, {
|
|
446
446
|
variant: "ghost",
|
|
447
447
|
size: "sm",
|
|
448
|
-
icon: /* @__PURE__ */ S(
|
|
448
|
+
icon: /* @__PURE__ */ S(ie, {}),
|
|
449
449
|
label: j("close"),
|
|
450
450
|
onClick: O,
|
|
451
451
|
className: "md:hidden"
|
|
@@ -469,9 +469,9 @@ function D({ workspace: v, open: D, onClose: O, selection: k }) {
|
|
|
469
469
|
hint: e.checked || e.hint || e.page ? /* @__PURE__ */ C("span", {
|
|
470
470
|
className: "flex items-center gap-2",
|
|
471
471
|
children: [
|
|
472
|
-
e.checked && /* @__PURE__ */ S(
|
|
472
|
+
e.checked && /* @__PURE__ */ S(ne, { className: "size-3.5" }),
|
|
473
473
|
e.hint,
|
|
474
|
-
e.page && /* @__PURE__ */ S(
|
|
474
|
+
e.page && /* @__PURE__ */ S(re, { className: "size-3.5" })
|
|
475
475
|
]
|
|
476
476
|
}) : void 0,
|
|
477
477
|
className: "h-9 md:h-8"
|
package/components/DateChip.js
CHANGED
|
@@ -5,11 +5,11 @@ import { docKey as a } from "../lib/docs.js";
|
|
|
5
5
|
import { usePeople as o } from "../lib/people.js";
|
|
6
6
|
import { fromIsoDate as s, isoDate as c } from "../lib/datePhrases.js";
|
|
7
7
|
import { Button as l, ErrorText as u, Input as d, Popover as f, Select as p } from "@parallelworks/ui";
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
8
|
+
import { useParams as m } from "@tanstack/react-router";
|
|
9
|
+
import { useState as h } from "react";
|
|
10
|
+
import { useErrorMessage as g } from "@parallelworks/problem/react";
|
|
11
|
+
import { useFormatter as _, useTranslations as v } from "use-intl";
|
|
12
|
+
import { Fragment as y, jsx as b, jsxs as x } from "react/jsx-runtime";
|
|
13
13
|
import { useMutation as S, useQuery as C } from "@tanstack/react-query";
|
|
14
14
|
import { Node as w, NodeViewWrapper as T, ReactNodeViewRenderer as E, mergeAttributes as D } from "@tiptap/react";
|
|
15
15
|
// src/components/DateChip.tsx
|
|
@@ -53,28 +53,28 @@ var O = w.create({
|
|
|
53
53
|
renderMarkdown: (e) => `@${String(e.attrs?.date ?? "")}`
|
|
54
54
|
});
|
|
55
55
|
function k({ node: e, editor: t, updateAttributes: n }) {
|
|
56
|
-
let a =
|
|
56
|
+
let a = _(), o = v("dateChip"), c = s(String(e.attrs.date ?? "")), l = e.attrs.remindAt, u = /* @__PURE__ */ new Date(), d = c ? a.dateTime(c, {
|
|
57
57
|
weekday: "short",
|
|
58
58
|
month: "short",
|
|
59
59
|
day: "numeric",
|
|
60
60
|
...c.getFullYear() !== u.getFullYear() && { year: "numeric" }
|
|
61
|
-
}) : String(e.attrs.date), p = /* @__PURE__ */
|
|
61
|
+
}) : String(e.attrs.date), p = /* @__PURE__ */ x("span", {
|
|
62
62
|
className: "date-chip",
|
|
63
63
|
"data-reminder": l ? "" : void 0,
|
|
64
64
|
children: [
|
|
65
|
-
/* @__PURE__ */
|
|
65
|
+
/* @__PURE__ */ b(r, { className: "size-3.5" }),
|
|
66
66
|
d,
|
|
67
|
-
l && /* @__PURE__ */
|
|
67
|
+
l && /* @__PURE__ */ b(i, {
|
|
68
68
|
className: "size-3",
|
|
69
69
|
"aria-label": o("reminderSet")
|
|
70
70
|
})
|
|
71
71
|
]
|
|
72
72
|
});
|
|
73
|
-
return /* @__PURE__ */
|
|
73
|
+
return /* @__PURE__ */ b(T, {
|
|
74
74
|
as: "span",
|
|
75
75
|
className: "date-chip-wrap",
|
|
76
|
-
children: t.isEditable ? /* @__PURE__ */
|
|
77
|
-
trigger: /* @__PURE__ */
|
|
76
|
+
children: t.isEditable ? /* @__PURE__ */ b(f, {
|
|
77
|
+
trigger: /* @__PURE__ */ b("button", {
|
|
78
78
|
type: "button",
|
|
79
79
|
className: "date-chip-button",
|
|
80
80
|
"aria-label": o("change", { date: d }),
|
|
@@ -84,7 +84,7 @@ function k({ node: e, editor: t, updateAttributes: n }) {
|
|
|
84
84
|
className: "w-72",
|
|
85
85
|
initialFocus: "first-control",
|
|
86
86
|
"aria-label": o("title"),
|
|
87
|
-
children: /* @__PURE__ */
|
|
87
|
+
children: /* @__PURE__ */ b(A, {
|
|
88
88
|
node: e,
|
|
89
89
|
updateAttributes: n
|
|
90
90
|
})
|
|
@@ -92,7 +92,7 @@ function k({ node: e, editor: t, updateAttributes: n }) {
|
|
|
92
92
|
});
|
|
93
93
|
}
|
|
94
94
|
function A({ node: r, updateAttributes: i }) {
|
|
95
|
-
let f =
|
|
95
|
+
let f = v("dateChip"), w = _(), T = g(), { workspace: E = "", doc: D } = m({ strict: !1 }), { members: O } = o(E), { data: k } = C(n), A = String(r.attrs.date ?? ""), j = r.attrs.reminderId, M = r.attrs.remindAt, N = r.attrs.remindFor ?? "", [P, F] = h(""), [I, L] = h("09:00"), R = {
|
|
96
96
|
workspace: E,
|
|
97
97
|
doc: D ? a(D) : ""
|
|
98
98
|
}, z = S({
|
|
@@ -127,11 +127,11 @@ function A({ node: r, updateAttributes: i }) {
|
|
|
127
127
|
remindFor: null
|
|
128
128
|
})
|
|
129
129
|
}), V = z.error ?? B.error;
|
|
130
|
-
return /* @__PURE__ */
|
|
130
|
+
return /* @__PURE__ */ x("div", {
|
|
131
131
|
className: "space-y-3 text-sm",
|
|
132
|
-
children: [/* @__PURE__ */
|
|
132
|
+
children: [/* @__PURE__ */ x("label", {
|
|
133
133
|
className: "block text-xs font-medium text-muted-foreground",
|
|
134
|
-
children: [f("date"), /* @__PURE__ */
|
|
134
|
+
children: [f("date"), /* @__PURE__ */ b(d, {
|
|
135
135
|
type: "date",
|
|
136
136
|
value: A,
|
|
137
137
|
onChange: (e) => {
|
|
@@ -140,9 +140,9 @@ function A({ node: r, updateAttributes: i }) {
|
|
|
140
140
|
},
|
|
141
141
|
className: "mt-1"
|
|
142
142
|
})]
|
|
143
|
-
}), D && /* @__PURE__ */
|
|
143
|
+
}), D && /* @__PURE__ */ x("div", {
|
|
144
144
|
className: "space-y-2 border-t border-border pt-3",
|
|
145
|
-
children: [M ? /* @__PURE__ */
|
|
145
|
+
children: [M ? /* @__PURE__ */ x(y, { children: [/* @__PURE__ */ b("p", {
|
|
146
146
|
className: "text-xs text-muted-foreground",
|
|
147
147
|
children: f("willRemind", {
|
|
148
148
|
who: N ? ((e) => O.find((t) => t.user.username === e)?.user.name ?? e)(N) : f("you"),
|
|
@@ -151,19 +151,19 @@ function A({ node: r, updateAttributes: i }) {
|
|
|
151
151
|
timeStyle: "short"
|
|
152
152
|
})
|
|
153
153
|
})
|
|
154
|
-
}), /* @__PURE__ */
|
|
154
|
+
}), /* @__PURE__ */ b(l, {
|
|
155
155
|
size: "sm",
|
|
156
156
|
loading: B.isPending,
|
|
157
157
|
onClick: () => B.mutate(),
|
|
158
158
|
children: f("removeReminder")
|
|
159
|
-
})] }) : /* @__PURE__ */
|
|
160
|
-
/* @__PURE__ */
|
|
159
|
+
})] }) : /* @__PURE__ */ x(y, { children: [
|
|
160
|
+
/* @__PURE__ */ b("p", {
|
|
161
161
|
className: "text-xs font-medium text-muted-foreground",
|
|
162
162
|
children: f("remind")
|
|
163
163
|
}),
|
|
164
|
-
/* @__PURE__ */
|
|
164
|
+
/* @__PURE__ */ x("div", {
|
|
165
165
|
className: "flex flex-wrap items-center gap-2",
|
|
166
|
-
children: [/* @__PURE__ */
|
|
166
|
+
children: [/* @__PURE__ */ b(p, {
|
|
167
167
|
value: P,
|
|
168
168
|
items: [{
|
|
169
169
|
value: "",
|
|
@@ -175,7 +175,7 @@ function A({ node: r, updateAttributes: i }) {
|
|
|
175
175
|
onValueChange: F,
|
|
176
176
|
"aria-label": f("who"),
|
|
177
177
|
width: "content"
|
|
178
|
-
}), /* @__PURE__ */
|
|
178
|
+
}), /* @__PURE__ */ b(d, {
|
|
179
179
|
type: "time",
|
|
180
180
|
value: I,
|
|
181
181
|
onChange: (e) => L(e.target.value),
|
|
@@ -183,14 +183,14 @@ function A({ node: r, updateAttributes: i }) {
|
|
|
183
183
|
className: "w-28"
|
|
184
184
|
})]
|
|
185
185
|
}),
|
|
186
|
-
/* @__PURE__ */
|
|
186
|
+
/* @__PURE__ */ b(l, {
|
|
187
187
|
size: "sm",
|
|
188
188
|
variant: "primary",
|
|
189
189
|
loading: z.isPending,
|
|
190
190
|
onClick: () => z.mutate(),
|
|
191
191
|
children: f("setReminder")
|
|
192
192
|
})
|
|
193
|
-
] }), V && /* @__PURE__ */
|
|
193
|
+
] }), V && /* @__PURE__ */ b(u, { children: T(V) })]
|
|
194
194
|
})]
|
|
195
195
|
});
|
|
196
196
|
}
|