@parallelworks/tandem-web 0.185.0 → 0.186.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.
@@ -2,33 +2,41 @@ import { windows as e } from "./measures.js";
2
2
  import { measuresQuery as t } from "../../api/queries.js";
3
3
  import { useMoney as n } from "../../components/AgentWork.js";
4
4
  import { AreaLink as r } from "../../components/AreaLink.js";
5
- import { usePageTitle as i } from "../../lib/pageTitle.js";
6
- import { Link as a } from "../../lib/router.js";
7
- import { Route as o } from "./measures2.js";
8
- import { SegmentedControl as s } from "@parallelworks/ui";
9
- import { useFormatter as c, useTranslations as l } from "use-intl";
10
- import { jsx as u, jsxs as d } from "react/jsx-runtime";
11
- import { useSuspenseQuery as f } from "@tanstack/react-query";
5
+ import { FavoriteStar as i } from "../../components/FavoriteStar.js";
6
+ import { usePageTitle as a } from "../../lib/pageTitle.js";
7
+ import { Link as o } from "../../lib/router.js";
8
+ import { Route as s } from "./measures2.js";
9
+ import { SegmentedControl as c } from "@parallelworks/ui";
10
+ import { useFormatter as l, useTranslations as u } from "use-intl";
11
+ import { jsx as d, jsxs as f } from "react/jsx-runtime";
12
+ import { useSuspenseQuery as p } from "@tanstack/react-query";
12
13
  // src/routes/$workspace/measures.tsx?tsr-split=component
13
- function p() {
14
- let n = l("measures");
15
- i(n("title"));
16
- let { workspace: c } = o.useParams(), { days: p = "30" } = o.useSearch(), h = o.useNavigate(), { data: v } = f(t(c, Number(p)));
17
- return /* @__PURE__ */ d("div", {
14
+ function m() {
15
+ let n = u("measures");
16
+ a(n("title"));
17
+ let { workspace: l } = s.useParams(), { days: m = "30" } = s.useSearch(), g = s.useNavigate(), { data: y } = p(t(l, Number(m)));
18
+ return /* @__PURE__ */ f("div", {
18
19
  className: "w-full space-y-10 px-4 py-6 md:px-8 md:py-8",
19
20
  children: [
20
- /* @__PURE__ */ d("div", {
21
+ /* @__PURE__ */ f("div", {
21
22
  className: "flex flex-wrap items-end justify-between gap-4",
22
- children: [/* @__PURE__ */ d("div", { children: [/* @__PURE__ */ u("h1", {
23
- className: "text-xl font-semibold tracking-tight",
24
- children: n("title")
25
- }), /* @__PURE__ */ u("p", {
23
+ children: [/* @__PURE__ */ f("div", { children: [/* @__PURE__ */ f("div", {
24
+ className: "flex items-center gap-2",
25
+ children: [/* @__PURE__ */ d("h1", {
26
+ className: "text-xl font-semibold tracking-tight",
27
+ children: n("title")
28
+ }), /* @__PURE__ */ d(i, {
29
+ workspace: l,
30
+ kind: "page",
31
+ target: "measures"
32
+ })]
33
+ }), /* @__PURE__ */ d("p", {
26
34
  className: "mt-1 text-sm text-muted-foreground",
27
35
  children: n("description")
28
- })] }), /* @__PURE__ */ u(s, {
36
+ })] }), /* @__PURE__ */ d(c, {
29
37
  label: n("window"),
30
- value: p,
31
- onValueChange: (e) => h({
38
+ value: m,
39
+ onValueChange: (e) => g({
32
40
  search: { days: e },
33
41
  replace: !0
34
42
  }),
@@ -38,28 +46,28 @@ function p() {
38
46
  }))
39
47
  })]
40
48
  }),
41
- /* @__PURE__ */ u(m, { queue: v.queue }),
42
- /* @__PURE__ */ u(g, { states: v.states }),
43
- /* @__PURE__ */ d("section", {
49
+ /* @__PURE__ */ d(h, { queue: y.queue }),
50
+ /* @__PURE__ */ d(_, { states: y.states }),
51
+ /* @__PURE__ */ f("section", {
44
52
  "aria-label": n("cost"),
45
- children: [/* @__PURE__ */ u("h2", {
53
+ children: [/* @__PURE__ */ d("h2", {
46
54
  className: "text-sm font-semibold",
47
55
  children: n("cost")
48
- }), /* @__PURE__ */ d("div", {
56
+ }), /* @__PURE__ */ f("div", {
49
57
  className: "mt-3 grid gap-6 lg:grid-cols-3",
50
58
  children: [
51
- /* @__PURE__ */ u(_, {
59
+ /* @__PURE__ */ d(v, {
52
60
  title: n("byIssue"),
53
- rows: v.issues,
54
- link: (e) => /* @__PURE__ */ d(a, {
61
+ rows: y.issues,
62
+ link: (e) => /* @__PURE__ */ f(o, {
55
63
  to: "/$workspace/issues/$identifier",
56
64
  params: {
57
- workspace: c,
65
+ workspace: l,
58
66
  identifier: e.key
59
67
  },
60
68
  className: "hover:underline",
61
69
  children: [
62
- /* @__PURE__ */ u("span", {
70
+ /* @__PURE__ */ d("span", {
63
71
  className: "text-muted-foreground",
64
72
  children: e.key
65
73
  }),
@@ -68,23 +76,23 @@ function p() {
68
76
  ]
69
77
  })
70
78
  }),
71
- /* @__PURE__ */ u(_, {
79
+ /* @__PURE__ */ d(v, {
72
80
  title: n("byArea"),
73
- rows: v.areas,
74
- link: (e) => /* @__PURE__ */ u(r, {
75
- workspace: c,
81
+ rows: y.areas,
82
+ link: (e) => /* @__PURE__ */ d(r, {
83
+ workspace: l,
76
84
  area: e,
77
85
  className: "hover:underline",
78
86
  children: e.title
79
87
  })
80
88
  }),
81
- /* @__PURE__ */ u(_, {
89
+ /* @__PURE__ */ d(v, {
82
90
  title: n("byTeam"),
83
- rows: v.teams,
84
- link: (e) => /* @__PURE__ */ u(a, {
91
+ rows: y.teams,
92
+ link: (e) => /* @__PURE__ */ d(o, {
85
93
  to: "/$workspace/teams/$key/settings",
86
94
  params: {
87
- workspace: c,
95
+ workspace: l,
88
96
  key: e.key
89
97
  },
90
98
  className: "hover:underline",
@@ -97,32 +105,32 @@ function p() {
97
105
  ]
98
106
  });
99
107
  }
100
- function m({ queue: e }) {
101
- let t = l("measures"), n = c();
102
- return /* @__PURE__ */ d("section", {
108
+ function h({ queue: e }) {
109
+ let t = u("measures"), n = l();
110
+ return /* @__PURE__ */ f("section", {
103
111
  "aria-label": t("queue"),
104
112
  children: [
105
- /* @__PURE__ */ u("h2", {
113
+ /* @__PURE__ */ d("h2", {
106
114
  className: "text-sm font-semibold",
107
115
  children: t("queue")
108
116
  }),
109
- /* @__PURE__ */ u("p", {
117
+ /* @__PURE__ */ d("p", {
110
118
  className: "mt-0.5 text-xs text-muted-foreground",
111
119
  children: t("queueHelp")
112
120
  }),
113
- e.length === 0 ? /* @__PURE__ */ u("p", {
121
+ e.length === 0 ? /* @__PURE__ */ d("p", {
114
122
  className: "mt-3 text-sm text-muted-foreground",
115
123
  children: t("noQueue")
116
- }) : /* @__PURE__ */ u("ul", {
124
+ }) : /* @__PURE__ */ d("ul", {
117
125
  className: "mt-3 flex flex-wrap gap-2",
118
- children: e.map((e) => /* @__PURE__ */ d("li", {
126
+ children: e.map((e) => /* @__PURE__ */ f("li", {
119
127
  className: "flex items-baseline gap-2 rounded-md border border-border px-3 py-2",
120
- children: [/* @__PURE__ */ u("span", {
128
+ children: [/* @__PURE__ */ d("span", {
121
129
  className: "text-lg font-semibold tabular-nums",
122
130
  children: n.number(e.queued)
123
- }), /* @__PURE__ */ u("span", {
131
+ }), /* @__PURE__ */ d("span", {
124
132
  className: "text-sm text-muted-foreground",
125
- children: e.label ? /* @__PURE__ */ u("code", {
133
+ children: e.label ? /* @__PURE__ */ d("code", {
126
134
  className: "font-mono text-xs",
127
135
  children: e.label
128
136
  }) : t("anyRunner")
@@ -132,8 +140,8 @@ function m({ queue: e }) {
132
140
  ]
133
141
  });
134
142
  }
135
- function h() {
136
- let e = c();
143
+ function g() {
144
+ let e = l();
137
145
  return (t) => {
138
146
  for (let [n, r] of [
139
147
  ["day", 86400],
@@ -152,30 +160,30 @@ function h() {
152
160
  });
153
161
  };
154
162
  }
155
- function g({ states: e }) {
156
- let t = l("measures"), n = l("agentWork.state"), r = h(), i = Math.max(1, ...e.map((e) => e.totalSeconds));
157
- return /* @__PURE__ */ d("section", {
163
+ function _({ states: e }) {
164
+ let t = u("measures"), n = u("agentWork.state"), r = g(), i = Math.max(1, ...e.map((e) => e.totalSeconds));
165
+ return /* @__PURE__ */ f("section", {
158
166
  "aria-label": t("states"),
159
167
  children: [
160
- /* @__PURE__ */ u("h2", {
168
+ /* @__PURE__ */ d("h2", {
161
169
  className: "text-sm font-semibold",
162
170
  children: t("states")
163
171
  }),
164
- /* @__PURE__ */ u("p", {
172
+ /* @__PURE__ */ d("p", {
165
173
  className: "mt-0.5 text-xs text-muted-foreground",
166
174
  children: t("statesHelp")
167
175
  }),
168
- e.length === 0 ? /* @__PURE__ */ u("p", {
176
+ e.length === 0 ? /* @__PURE__ */ d("p", {
169
177
  className: "mt-3 text-sm text-muted-foreground",
170
178
  children: t("noRuns")
171
- }) : /* @__PURE__ */ u("ul", {
179
+ }) : /* @__PURE__ */ d("ul", {
172
180
  className: "mt-3 max-w-3xl space-y-3",
173
- children: e.map((e) => /* @__PURE__ */ d("li", { children: [/* @__PURE__ */ d("div", {
181
+ children: e.map((e) => /* @__PURE__ */ f("li", { children: [/* @__PURE__ */ f("div", {
174
182
  className: "flex items-baseline justify-between gap-3 text-sm",
175
- children: [/* @__PURE__ */ u("span", {
183
+ children: [/* @__PURE__ */ d("span", {
176
184
  className: "font-medium",
177
185
  children: n(e.state)
178
- }), /* @__PURE__ */ d("span", {
186
+ }), /* @__PURE__ */ f("span", {
179
187
  className: "text-xs text-muted-foreground tabular-nums",
180
188
  children: [
181
189
  r(e.totalSeconds),
@@ -187,9 +195,9 @@ function g({ states: e }) {
187
195
  })
188
196
  ]
189
197
  })]
190
- }), /* @__PURE__ */ u("div", {
198
+ }), /* @__PURE__ */ d("div", {
191
199
  className: "mt-1 h-2 overflow-hidden rounded-full bg-muted",
192
- children: /* @__PURE__ */ u("div", {
200
+ children: /* @__PURE__ */ d("div", {
193
201
  className: "h-full rounded-full bg-agent",
194
202
  style: { width: `${e.totalSeconds / i * 100}%` }
195
203
  })
@@ -198,30 +206,30 @@ function g({ states: e }) {
198
206
  ]
199
207
  });
200
208
  }
201
- function _({ title: e, rows: t, link: r }) {
202
- let i = l("measures"), a = n();
203
- return /* @__PURE__ */ d("div", {
209
+ function v({ title: e, rows: t, link: r }) {
210
+ let i = u("measures"), a = n();
211
+ return /* @__PURE__ */ f("div", {
204
212
  className: "min-w-0",
205
- children: [/* @__PURE__ */ u("h3", {
213
+ children: [/* @__PURE__ */ d("h3", {
206
214
  className: "mb-2 text-xs font-medium text-muted-foreground",
207
215
  children: e
208
- }), t.length === 0 ? /* @__PURE__ */ u("p", {
216
+ }), t.length === 0 ? /* @__PURE__ */ d("p", {
209
217
  className: "text-sm text-muted-foreground",
210
218
  children: i("noCost")
211
- }) : /* @__PURE__ */ u("ol", {
219
+ }) : /* @__PURE__ */ d("ol", {
212
220
  className: "divide-y divide-border rounded-md border border-border text-sm",
213
- children: t.map((e) => /* @__PURE__ */ d("li", {
221
+ children: t.map((e) => /* @__PURE__ */ f("li", {
214
222
  className: "flex items-baseline gap-3 px-3 py-2",
215
223
  children: [
216
- /* @__PURE__ */ u("span", {
224
+ /* @__PURE__ */ d("span", {
217
225
  className: "min-w-0 flex-1 truncate",
218
226
  children: r(e)
219
227
  }),
220
- /* @__PURE__ */ u("span", {
228
+ /* @__PURE__ */ d("span", {
221
229
  className: "shrink-0 text-xs text-muted-foreground tabular-nums",
222
230
  children: i("runCount", { count: e.runs })
223
231
  }),
224
- /* @__PURE__ */ u("span", {
232
+ /* @__PURE__ */ d("span", {
225
233
  className: "w-20 shrink-0 text-right tabular-nums",
226
234
  children: a(e.costMicros)
227
235
  })
@@ -230,4 +238,4 @@ function _({ title: e, rows: t, link: r }) {
230
238
  })]
231
239
  });
232
240
  }
233
- export { p as component };
241
+ export { m as component };