@burdenoff/microfe-timecampus 2026.1109.4 → 2026.1114.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/dist/timecampus/pages/lifetime/RecommendationsPage.js +237 -215
- package/dist/timecampus/pages/lifetime/RecommendationsPage.js.map +1 -1
- package/dist/timecampus/pages/lifetime/domains.d.ts +6 -0
- package/dist/timecampus/pages/lifetime/domains.js +10 -6
- package/dist/timecampus/pages/lifetime/domains.js.map +1 -1
- package/package.json +1 -1
|
@@ -10,12 +10,12 @@ import { Modal as c } from "../../components/Modal.js";
|
|
|
10
10
|
import { ToastContainer as l, useToast as u } from "../../components/Toast.js";
|
|
11
11
|
import { TimeCampusLifeDomain as d } from "../../../generated/wspace-types.js";
|
|
12
12
|
import { useAcceptRecommendationMutation as f, useDismissRecommendationMutation as p, useGenerateMyRecommendationsMutation as ee, useMyRecommendationPreferencesQuery as m, useMyRecommendationsQuery as h, useMyTimeIntelligenceDeliveriesQuery as g, useSnoozeRecommendationMutation as _, useUpdateMyRecommendationPreferencesMutation as te } from "../../../generated/wspace-operations.js";
|
|
13
|
-
import {
|
|
14
|
-
import { evidenceWeeks as
|
|
15
|
-
import { DIGEST_CADENCE_OPTIONS as
|
|
13
|
+
import { ALL_LIFE_DOMAINS as v, lifeDomainLabel as y, toggleLifeDomain as b } from "./domains.js";
|
|
14
|
+
import { evidenceWeeks as x, formatEvidenceRef as S, formatHourOfDay as C, humaniseToken as w, parseEvidenceRefs as T, parseSuggestedAction as E, recommendationKindLabel as D, recommendationProvenance as ne } from "./recommendationEvidence.js";
|
|
15
|
+
import { DIGEST_CADENCE_OPTIONS as re, DIGEST_DAY_OPTIONS as O, describeDelivery as ie, formatUtcHourWithLocal as ae } from "./timeIntelligence.js";
|
|
16
16
|
import { useMemo as k, useState as A } from "react";
|
|
17
|
-
import { BellOff as
|
|
18
|
-
import { Fragment as
|
|
17
|
+
import { BellOff as oe, Briefcase as se, Bus as ce, CalendarClock as le, Check as j, CheckCircle2 as ue, ChevronDown as de, Circle as fe, Clock as M, Coffee as N, ExternalLink as pe, GraduationCap as me, Handshake as he, Heart as P, HeartPulse as F, Home as I, Hourglass as L, Lightbulb as R, Microscope as ge, Moon as _e, ShieldCheck as ve, Sparkles as z, Users as ye, Wallet as be, X as B } from "lucide-react";
|
|
18
|
+
import { Fragment as xe, jsx as V, jsxs as H } from "react/jsx-runtime";
|
|
19
19
|
import { GlassCard as U } from "@burdenoff/fe-libs/ui";
|
|
20
20
|
// src/timecampus/pages/lifetime/RecommendationsPage.tsx
|
|
21
21
|
var W = {
|
|
@@ -24,7 +24,7 @@ var W = {
|
|
|
24
24
|
Accepted: "ACCEPTED",
|
|
25
25
|
Dismissed: "DISMISSED",
|
|
26
26
|
Expired: "EXPIRED"
|
|
27
|
-
},
|
|
27
|
+
}, Se = [
|
|
28
28
|
{
|
|
29
29
|
key: W.New,
|
|
30
30
|
label: "New"
|
|
@@ -42,13 +42,13 @@ var W = {
|
|
|
42
42
|
label: "Dismissed"
|
|
43
43
|
}
|
|
44
44
|
];
|
|
45
|
-
function
|
|
45
|
+
function Ce(e) {
|
|
46
46
|
return e === W.New || e === W.Snoozed;
|
|
47
47
|
}
|
|
48
|
-
function
|
|
48
|
+
function we() {
|
|
49
49
|
return new Date(Date.now() + 6048e5).toISOString();
|
|
50
50
|
}
|
|
51
|
-
var
|
|
51
|
+
var Te = (e) => Math.min(1, Math.max(0, e)), G = (e) => `${Math.round(Te(e) * 100)}%`;
|
|
52
52
|
function K(e) {
|
|
53
53
|
return new Date(e).toLocaleDateString(void 0, {
|
|
54
54
|
month: "short",
|
|
@@ -56,26 +56,26 @@ function K(e) {
|
|
|
56
56
|
year: "numeric"
|
|
57
57
|
});
|
|
58
58
|
}
|
|
59
|
-
var q = Array.from({ length: 24 }, (e, t) => t),
|
|
60
|
-
[d.Work]:
|
|
61
|
-
[d.Sleep]:
|
|
62
|
-
[d.Health]:
|
|
63
|
-
[d.Family]:
|
|
64
|
-
[d.Learning]:
|
|
65
|
-
[d.Leisure]:
|
|
66
|
-
[d.Commute]:
|
|
67
|
-
[d.Waiting]:
|
|
68
|
-
[d.Chores]:
|
|
69
|
-
[d.SelfCare]:
|
|
70
|
-
[d.Social]:
|
|
71
|
-
[d.FinanceAdmin]:
|
|
59
|
+
var q = Array.from({ length: 24 }, (e, t) => t), Ee = {
|
|
60
|
+
[d.Work]: se,
|
|
61
|
+
[d.Sleep]: _e,
|
|
62
|
+
[d.Health]: F,
|
|
63
|
+
[d.Family]: ye,
|
|
64
|
+
[d.Learning]: me,
|
|
65
|
+
[d.Leisure]: N,
|
|
66
|
+
[d.Commute]: ce,
|
|
67
|
+
[d.Waiting]: L,
|
|
68
|
+
[d.Chores]: I,
|
|
69
|
+
[d.SelfCare]: P,
|
|
70
|
+
[d.Social]: he,
|
|
71
|
+
[d.FinanceAdmin]: be,
|
|
72
72
|
[d.Reflection]: z,
|
|
73
|
-
[d.Other]:
|
|
73
|
+
[d.Other]: fe
|
|
74
74
|
};
|
|
75
|
-
function
|
|
76
|
-
return e ?
|
|
75
|
+
function De(e) {
|
|
76
|
+
return e ? Ee[e] ?? R : R;
|
|
77
77
|
}
|
|
78
|
-
function
|
|
78
|
+
function Oe(e) {
|
|
79
79
|
switch (e) {
|
|
80
80
|
case W.Accepted: return {
|
|
81
81
|
variant: "success",
|
|
@@ -99,8 +99,8 @@ function Te(e) {
|
|
|
99
99
|
};
|
|
100
100
|
}
|
|
101
101
|
}
|
|
102
|
-
var
|
|
103
|
-
function
|
|
102
|
+
var J = "inline-flex items-center gap-1.5 rounded-md bg-action-primary-bg px-3 py-1.5 text-sm font-medium text-action-primary-text hover:bg-action-primary-bg/90 disabled:opacity-50", Y = "inline-flex items-center gap-1.5 rounded-md border border-border-subtle px-3 py-1.5 text-sm font-medium text-text-primary hover:bg-bg-sunken/50 disabled:opacity-50", X = "inline-flex items-center gap-1 rounded-full bg-bg-sunken px-2.5 py-0.5 text-xs font-medium text-text-secondary";
|
|
103
|
+
function Z({ checked: t, onChange: n, label: r, disabled: i }) {
|
|
104
104
|
return /* @__PURE__ */ V("button", {
|
|
105
105
|
type: "button",
|
|
106
106
|
role: "switch",
|
|
@@ -112,8 +112,8 @@ function Ee({ checked: t, onChange: n, label: r, disabled: i }) {
|
|
|
112
112
|
children: /* @__PURE__ */ V("span", { className: e("inline-block h-3.5 w-3.5 transform rounded-full shadow-sm transition-transform", t ? "translate-x-4 bg-action-primary-text" : "translate-x-0.5 bg-text-secondary") })
|
|
113
113
|
});
|
|
114
114
|
}
|
|
115
|
-
function
|
|
116
|
-
let u =
|
|
115
|
+
function ke({ rec: t, busy: n, muted: r, onAccept: i, onSnooze: o, onDismiss: c, onMuteKind: l }) {
|
|
116
|
+
let u = De(t.domain), d = Ce(t.state), f = Oe(t.state), [p, ee] = A(!1), m = T(t.evidenceRefs), h = E(t.suggestedAction), g = `rec-evidence-${t.id}`, _ = x(t.createdAt, m), te = a();
|
|
117
117
|
return /* @__PURE__ */ H(U, {
|
|
118
118
|
treatment: "glass",
|
|
119
119
|
className: "flex flex-col gap-3 p-4 sm:p-5",
|
|
@@ -130,12 +130,12 @@ function De({ rec: t, busy: n, muted: r, onAccept: i, onSnooze: o, onDismiss: c,
|
|
|
130
130
|
children: [/* @__PURE__ */ H("p", {
|
|
131
131
|
className: "flex min-w-0 items-center gap-1.5 text-xs font-medium uppercase tracking-wide text-text-secondary",
|
|
132
132
|
children: [t.source === "AI" && /* @__PURE__ */ H("span", {
|
|
133
|
-
className:
|
|
133
|
+
className: X,
|
|
134
134
|
"data-testid": "rec-ai-chip",
|
|
135
135
|
children: [/* @__PURE__ */ V(z, { className: "h-3 w-3" }), "AI"]
|
|
136
136
|
}), /* @__PURE__ */ V("span", {
|
|
137
137
|
className: "truncate",
|
|
138
|
-
children:
|
|
138
|
+
children: D(t.kind)
|
|
139
139
|
})]
|
|
140
140
|
}), /* @__PURE__ */ V("h3", {
|
|
141
141
|
className: "mt-0.5 text-base font-semibold text-text-primary",
|
|
@@ -155,35 +155,35 @@ function De({ rec: t, busy: n, muted: r, onAccept: i, onSnooze: o, onDismiss: c,
|
|
|
155
155
|
/* @__PURE__ */ V("p", {
|
|
156
156
|
className: "text-xs text-text-tertiary",
|
|
157
157
|
"data-testid": "rec-provenance",
|
|
158
|
-
children:
|
|
158
|
+
children: ne(t.source, t.aiModel)
|
|
159
159
|
}),
|
|
160
160
|
/* @__PURE__ */ H("div", {
|
|
161
161
|
className: "flex flex-wrap items-center gap-1.5",
|
|
162
162
|
children: [
|
|
163
163
|
t.domain && /* @__PURE__ */ V("span", {
|
|
164
|
-
className:
|
|
165
|
-
children:
|
|
164
|
+
className: X,
|
|
165
|
+
children: y(t.domain)
|
|
166
166
|
}),
|
|
167
167
|
t.valueAlignment != null && /* @__PURE__ */ H("span", {
|
|
168
|
-
className:
|
|
168
|
+
className: X,
|
|
169
169
|
children: [
|
|
170
|
-
/* @__PURE__ */ V(
|
|
170
|
+
/* @__PURE__ */ V(ve, { className: "h-3 w-3" }),
|
|
171
171
|
"Aligns with your values · ",
|
|
172
172
|
G(t.valueAlignment)
|
|
173
173
|
]
|
|
174
174
|
}),
|
|
175
175
|
t.state === W.Snoozed && t.snoozeUntil && /* @__PURE__ */ H("span", {
|
|
176
|
-
className:
|
|
176
|
+
className: X,
|
|
177
177
|
children: [
|
|
178
|
-
/* @__PURE__ */ V(
|
|
178
|
+
/* @__PURE__ */ V(M, { className: "h-3 w-3" }),
|
|
179
179
|
"Snoozed until ",
|
|
180
180
|
K(t.snoozeUntil)
|
|
181
181
|
]
|
|
182
182
|
}),
|
|
183
183
|
d && t.expiresAt && /* @__PURE__ */ H("span", {
|
|
184
|
-
className:
|
|
184
|
+
className: X,
|
|
185
185
|
children: [
|
|
186
|
-
/* @__PURE__ */ V(
|
|
186
|
+
/* @__PURE__ */ V(le, { className: "h-3 w-3" }),
|
|
187
187
|
"Expires ",
|
|
188
188
|
K(t.expiresAt)
|
|
189
189
|
]
|
|
@@ -199,7 +199,7 @@ function De({ rec: t, busy: n, muted: r, onAccept: i, onSnooze: o, onDismiss: c,
|
|
|
199
199
|
}),
|
|
200
200
|
/* @__PURE__ */ V("p", {
|
|
201
201
|
className: "mt-1 text-sm font-medium text-text-primary",
|
|
202
|
-
children:
|
|
202
|
+
children: w(h.type)
|
|
203
203
|
}),
|
|
204
204
|
h.details.length > 0 && /* @__PURE__ */ V("dl", {
|
|
205
205
|
className: "mt-1.5 flex flex-wrap gap-x-4 gap-y-1",
|
|
@@ -226,15 +226,15 @@ function De({ rec: t, busy: n, muted: r, onAccept: i, onSnooze: o, onDismiss: c,
|
|
|
226
226
|
className: "flex w-full items-center justify-between gap-2 px-3 py-2 text-left",
|
|
227
227
|
children: [/* @__PURE__ */ H("span", {
|
|
228
228
|
className: "flex min-w-0 items-center gap-2",
|
|
229
|
-
children: [/* @__PURE__ */ V(
|
|
229
|
+
children: [/* @__PURE__ */ V(ge, { className: "h-3.5 w-3.5 shrink-0 text-text-secondary" }), /* @__PURE__ */ H("span", {
|
|
230
230
|
className: "truncate text-xs text-text-secondary",
|
|
231
231
|
children: [
|
|
232
232
|
"Evidence: ",
|
|
233
|
-
|
|
233
|
+
S(m[0]),
|
|
234
234
|
m.length > 1 ? ` · +${m.length - 1} more` : ""
|
|
235
235
|
]
|
|
236
236
|
})]
|
|
237
|
-
}), /* @__PURE__ */ V(
|
|
237
|
+
}), /* @__PURE__ */ V(de, { className: e("h-4 w-4 shrink-0 text-text-secondary transition-transform", p && "rotate-180") })]
|
|
238
238
|
}), p && /* @__PURE__ */ H("dl", {
|
|
239
239
|
id: g,
|
|
240
240
|
className: "space-y-1.5 border-t border-border-seam px-3 py-2.5",
|
|
@@ -243,10 +243,10 @@ function De({ rec: t, busy: n, muted: r, onAccept: i, onSnooze: o, onDismiss: c,
|
|
|
243
243
|
className: "flex items-baseline justify-between gap-3",
|
|
244
244
|
children: [/* @__PURE__ */ V("dt", {
|
|
245
245
|
className: "text-xs text-text-secondary",
|
|
246
|
-
children:
|
|
246
|
+
children: S(e).split(": ")[0]
|
|
247
247
|
}), /* @__PURE__ */ V("dd", {
|
|
248
248
|
className: "text-xs font-medium tabular-nums text-text-primary",
|
|
249
|
-
children:
|
|
249
|
+
children: S(e).split(": ").slice(1).join(": ")
|
|
250
250
|
})]
|
|
251
251
|
}, `${e.metric}-${e.period ?? e.domain ?? t}`)),
|
|
252
252
|
_.length > 0 && /* @__PURE__ */ V("div", {
|
|
@@ -278,30 +278,30 @@ function De({ rec: t, busy: n, muted: r, onAccept: i, onSnooze: o, onDismiss: c,
|
|
|
278
278
|
type: "button",
|
|
279
279
|
onClick: () => i(t.id),
|
|
280
280
|
disabled: n,
|
|
281
|
-
className:
|
|
282
|
-
children: [/* @__PURE__ */ V(
|
|
281
|
+
className: J,
|
|
282
|
+
children: [/* @__PURE__ */ V(j, { className: "h-4 w-4" }), "Accept"]
|
|
283
283
|
}),
|
|
284
284
|
/* @__PURE__ */ H("button", {
|
|
285
285
|
type: "button",
|
|
286
286
|
onClick: () => o(t.id),
|
|
287
287
|
disabled: n,
|
|
288
|
-
className:
|
|
289
|
-
children: [/* @__PURE__ */ V(
|
|
288
|
+
className: Y,
|
|
289
|
+
children: [/* @__PURE__ */ V(M, { className: "h-4 w-4" }), "Snooze"]
|
|
290
290
|
}),
|
|
291
291
|
/* @__PURE__ */ H("button", {
|
|
292
292
|
type: "button",
|
|
293
293
|
onClick: () => c(t),
|
|
294
294
|
disabled: n,
|
|
295
|
-
className:
|
|
295
|
+
className: Y,
|
|
296
296
|
children: [/* @__PURE__ */ V(B, { className: "h-4 w-4" }), "Dismiss"]
|
|
297
297
|
}),
|
|
298
298
|
/* @__PURE__ */ H("button", {
|
|
299
299
|
type: "button",
|
|
300
300
|
onClick: () => l(t.kind),
|
|
301
301
|
disabled: n || r,
|
|
302
|
-
className:
|
|
303
|
-
title: r ? `${
|
|
304
|
-
children: [/* @__PURE__ */ V(
|
|
302
|
+
className: Y,
|
|
303
|
+
title: r ? `${D(t.kind)} suggestions are already muted` : `Stop generating ${D(t.kind)} suggestions`,
|
|
304
|
+
children: [/* @__PURE__ */ V(oe, { className: "h-4 w-4" }), r ? "Muted" : "Mute this kind"]
|
|
305
305
|
})
|
|
306
306
|
]
|
|
307
307
|
}) : /* @__PURE__ */ H("div", {
|
|
@@ -323,20 +323,20 @@ function De({ rec: t, busy: n, muted: r, onAccept: i, onSnooze: o, onDismiss: c,
|
|
|
323
323
|
]
|
|
324
324
|
});
|
|
325
325
|
}
|
|
326
|
-
function
|
|
326
|
+
function Ae({ prefs: t, loading: r, saving: i, onToggleOutputGuard: a, onQuietHoursChange: o, onUnmuteKind: s, onDomainsChange: c, onAutonomousChange: l }) {
|
|
327
327
|
if (r) return /* @__PURE__ */ V(n, {
|
|
328
328
|
variant: "card",
|
|
329
329
|
count: 1
|
|
330
330
|
});
|
|
331
331
|
if (!t) return null;
|
|
332
|
-
let
|
|
332
|
+
let u = C(t.quietHoursStart), d = C(t.quietHoursEnd), f = u !== null && d !== null, p = "rounded-md border border-border-subtle bg-bg-surface px-2 py-1 text-xs text-text-primary focus:outline-none focus:ring-2 focus:ring-action-primary-bg/40 disabled:opacity-50";
|
|
333
333
|
return /* @__PURE__ */ H(U, {
|
|
334
334
|
treatment: "glass",
|
|
335
335
|
className: "p-4 sm:p-5",
|
|
336
336
|
children: [
|
|
337
337
|
/* @__PURE__ */ H("div", {
|
|
338
338
|
className: "flex items-center gap-2",
|
|
339
|
-
children: [/* @__PURE__ */ V(
|
|
339
|
+
children: [/* @__PURE__ */ V(ve, { className: "h-4 w-4 text-text-secondary" }), /* @__PURE__ */ V("h3", {
|
|
340
340
|
className: "text-sm font-semibold text-text-primary",
|
|
341
341
|
children: "Guardrails"
|
|
342
342
|
})]
|
|
@@ -359,7 +359,7 @@ function Oe({ prefs: t, loading: r, saving: i, onToggleOutputGuard: a, onQuietHo
|
|
|
359
359
|
className: "mt-0.5 text-xs text-text-secondary",
|
|
360
360
|
children: "Output-increasing suggestions are filtered out before they reach you."
|
|
361
361
|
})]
|
|
362
|
-
}), /* @__PURE__ */ V(
|
|
362
|
+
}), /* @__PURE__ */ V(Z, {
|
|
363
363
|
checked: t.neverOptimiseForOutput,
|
|
364
364
|
disabled: i,
|
|
365
365
|
label: "Never suggest more work",
|
|
@@ -376,7 +376,7 @@ function Oe({ prefs: t, loading: r, saving: i, onToggleOutputGuard: a, onQuietHo
|
|
|
376
376
|
children: "Quiet hours"
|
|
377
377
|
}), /* @__PURE__ */ V("span", {
|
|
378
378
|
className: "text-xs text-text-secondary",
|
|
379
|
-
children:
|
|
379
|
+
children: f ? `${u}–${d}` : "Not set"
|
|
380
380
|
})]
|
|
381
381
|
}),
|
|
382
382
|
/* @__PURE__ */ V("p", {
|
|
@@ -389,7 +389,7 @@ function Oe({ prefs: t, loading: r, saving: i, onToggleOutputGuard: a, onQuietHo
|
|
|
389
389
|
/* @__PURE__ */ H("label", {
|
|
390
390
|
className: "flex items-center gap-1.5 text-xs text-text-secondary",
|
|
391
391
|
children: ["From", /* @__PURE__ */ H("select", {
|
|
392
|
-
className:
|
|
392
|
+
className: p,
|
|
393
393
|
disabled: i,
|
|
394
394
|
value: t.quietHoursStart ?? "",
|
|
395
395
|
onChange: (e) => o(e.target.value === "" ? null : Number(e.target.value), t.quietHoursEnd ?? null),
|
|
@@ -398,14 +398,14 @@ function Oe({ prefs: t, loading: r, saving: i, onToggleOutputGuard: a, onQuietHo
|
|
|
398
398
|
children: "—"
|
|
399
399
|
}), q.map((e) => /* @__PURE__ */ V("option", {
|
|
400
400
|
value: e,
|
|
401
|
-
children:
|
|
401
|
+
children: C(e)
|
|
402
402
|
}, e))]
|
|
403
403
|
})]
|
|
404
404
|
}),
|
|
405
405
|
/* @__PURE__ */ H("label", {
|
|
406
406
|
className: "flex items-center gap-1.5 text-xs text-text-secondary",
|
|
407
407
|
children: ["To", /* @__PURE__ */ H("select", {
|
|
408
|
-
className:
|
|
408
|
+
className: p,
|
|
409
409
|
disabled: i,
|
|
410
410
|
value: t.quietHoursEnd ?? "",
|
|
411
411
|
onChange: (e) => o(t.quietHoursStart ?? null, e.target.value === "" ? null : Number(e.target.value)),
|
|
@@ -414,11 +414,11 @@ function Oe({ prefs: t, loading: r, saving: i, onToggleOutputGuard: a, onQuietHo
|
|
|
414
414
|
children: "—"
|
|
415
415
|
}), q.map((e) => /* @__PURE__ */ V("option", {
|
|
416
416
|
value: e,
|
|
417
|
-
children:
|
|
417
|
+
children: C(e)
|
|
418
418
|
}, e))]
|
|
419
419
|
})]
|
|
420
420
|
}),
|
|
421
|
-
|
|
421
|
+
f && /* @__PURE__ */ V("button", {
|
|
422
422
|
type: "button",
|
|
423
423
|
disabled: i,
|
|
424
424
|
onClick: () => o(null, null),
|
|
@@ -437,7 +437,7 @@ function Oe({ prefs: t, loading: r, saving: i, onToggleOutputGuard: a, onQuietHo
|
|
|
437
437
|
className: "text-sm font-medium text-text-primary",
|
|
438
438
|
children: "Muted kinds"
|
|
439
439
|
}), /* @__PURE__ */ V("span", {
|
|
440
|
-
className:
|
|
440
|
+
className: X,
|
|
441
441
|
children: t.mutedKinds.length
|
|
442
442
|
})]
|
|
443
443
|
}), t.mutedKinds.length === 0 ? /* @__PURE__ */ V("p", {
|
|
@@ -449,104 +449,125 @@ function Oe({ prefs: t, loading: r, saving: i, onToggleOutputGuard: a, onQuietHo
|
|
|
449
449
|
type: "button",
|
|
450
450
|
disabled: i,
|
|
451
451
|
onClick: () => s(t),
|
|
452
|
-
className: e(
|
|
453
|
-
title: `Unmute ${
|
|
454
|
-
children: [
|
|
452
|
+
className: e(X, "hover:text-text-primary disabled:opacity-50"),
|
|
453
|
+
title: `Unmute ${D(t)} suggestions`,
|
|
454
|
+
children: [D(t), /* @__PURE__ */ V(B, { className: "h-3 w-3" })]
|
|
455
455
|
}, t))
|
|
456
456
|
})]
|
|
457
457
|
}),
|
|
458
458
|
/* @__PURE__ */ H("div", {
|
|
459
459
|
className: "border-t border-border-seam pt-4",
|
|
460
|
-
"data-testid": "autonomous-digests",
|
|
461
460
|
children: [
|
|
462
461
|
/* @__PURE__ */ H("div", {
|
|
463
|
-
className: "flex items-
|
|
464
|
-
children: [/* @__PURE__ */
|
|
465
|
-
className: "
|
|
466
|
-
children:
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
className: "mt-0.5 text-xs text-text-secondary",
|
|
471
|
-
children: "Off unless you turn it on. TimeCampus then sends a short summary of your own tracked time to your notifications, and you can turn it off here at any time. Quiet hours and muted kinds still apply."
|
|
472
|
-
})]
|
|
473
|
-
}), /* @__PURE__ */ V(Ee, {
|
|
474
|
-
checked: t.autonomousEnabled,
|
|
475
|
-
disabled: i,
|
|
476
|
-
label: "Send me digests without asking",
|
|
477
|
-
onChange: (e) => c({ autonomousEnabled: e })
|
|
462
|
+
className: "flex items-center justify-between gap-3",
|
|
463
|
+
children: [/* @__PURE__ */ V("p", {
|
|
464
|
+
className: "text-sm font-medium text-text-primary",
|
|
465
|
+
children: "Opted-in domains"
|
|
466
|
+
}), /* @__PURE__ */ V("span", {
|
|
467
|
+
className: X,
|
|
468
|
+
children: t.optedInDomains.length
|
|
478
469
|
})]
|
|
479
470
|
}),
|
|
480
|
-
|
|
481
|
-
className: "mt-
|
|
482
|
-
children:
|
|
483
|
-
/* @__PURE__ */ H("label", {
|
|
484
|
-
className: "flex flex-wrap items-center gap-1.5 text-xs text-text-secondary",
|
|
485
|
-
children: ["What to send", /* @__PURE__ */ V("select", {
|
|
486
|
-
className: f,
|
|
487
|
-
disabled: i,
|
|
488
|
-
value: t.cadence,
|
|
489
|
-
"aria-label": "What to send",
|
|
490
|
-
onChange: (e) => c({ cadence: e.target.value }),
|
|
491
|
-
children: D.map((e) => /* @__PURE__ */ V("option", {
|
|
492
|
-
value: e.value,
|
|
493
|
-
children: e.label
|
|
494
|
-
}, e.value))
|
|
495
|
-
})]
|
|
496
|
-
}),
|
|
497
|
-
/* @__PURE__ */ H("label", {
|
|
498
|
-
className: "flex flex-wrap items-center gap-1.5 text-xs text-text-secondary",
|
|
499
|
-
children: ["Not before", /* @__PURE__ */ V("select", {
|
|
500
|
-
className: f,
|
|
501
|
-
disabled: i,
|
|
502
|
-
value: t.digestHourUtc,
|
|
503
|
-
"aria-label": "Not before",
|
|
504
|
-
onChange: (e) => c({ digestHourUtc: Number(e.target.value) }),
|
|
505
|
-
children: q.map((e) => /* @__PURE__ */ V("option", {
|
|
506
|
-
value: e,
|
|
507
|
-
children: O(e)
|
|
508
|
-
}, e))
|
|
509
|
-
})]
|
|
510
|
-
}),
|
|
511
|
-
/* @__PURE__ */ H("label", {
|
|
512
|
-
className: "flex flex-wrap items-center gap-1.5 text-xs text-text-secondary",
|
|
513
|
-
children: ["Weekly digest on", /* @__PURE__ */ V("select", {
|
|
514
|
-
className: f,
|
|
515
|
-
disabled: i,
|
|
516
|
-
value: t.weeklyDigestDay,
|
|
517
|
-
"aria-label": "Weekly digest on",
|
|
518
|
-
onChange: (e) => c({ weeklyDigestDay: Number(e.target.value) }),
|
|
519
|
-
children: ne.map((e) => /* @__PURE__ */ V("option", {
|
|
520
|
-
value: e.value,
|
|
521
|
-
children: e.label
|
|
522
|
-
}, e.value))
|
|
523
|
-
})]
|
|
524
|
-
})
|
|
525
|
-
]
|
|
471
|
+
/* @__PURE__ */ V("p", {
|
|
472
|
+
className: "mt-0.5 text-xs text-text-secondary",
|
|
473
|
+
children: "TimeCampus only suggests giving more time to the domains you opt in to. Pick at least one so suggestions stay relevant."
|
|
526
474
|
}),
|
|
527
|
-
|
|
528
|
-
className: "mt-
|
|
529
|
-
children:
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
475
|
+
/* @__PURE__ */ V("div", {
|
|
476
|
+
className: "mt-2 flex flex-wrap gap-1.5",
|
|
477
|
+
children: v.map((n) => {
|
|
478
|
+
let r = t.optedInDomains.includes(n);
|
|
479
|
+
return /* @__PURE__ */ H("button", {
|
|
480
|
+
type: "button",
|
|
481
|
+
disabled: i,
|
|
482
|
+
"aria-pressed": r,
|
|
483
|
+
title: `${r ? "Remove" : "Add"} ${y(n)}`,
|
|
484
|
+
onClick: () => c(b(t.optedInDomains, n)),
|
|
485
|
+
className: e(X, "border disabled:opacity-50", r ? "border-action-primary-bg/50 bg-action-primary-bg/15 text-text-primary" : "border-transparent hover:text-text-primary"),
|
|
486
|
+
children: [y(n), r && /* @__PURE__ */ V(j, { className: "h-3 w-3" })]
|
|
487
|
+
}, n);
|
|
488
|
+
})
|
|
489
|
+
})
|
|
537
490
|
]
|
|
491
|
+
}),
|
|
492
|
+
/* @__PURE__ */ H("div", {
|
|
493
|
+
className: "border-t border-border-seam pt-4",
|
|
494
|
+
"data-testid": "autonomous-digests",
|
|
495
|
+
children: [/* @__PURE__ */ H("div", {
|
|
496
|
+
className: "flex items-start justify-between gap-3",
|
|
497
|
+
children: [/* @__PURE__ */ H("div", {
|
|
498
|
+
className: "min-w-0",
|
|
499
|
+
children: [/* @__PURE__ */ V("p", {
|
|
500
|
+
className: "text-sm font-medium text-text-primary",
|
|
501
|
+
children: "Send me digests without asking"
|
|
502
|
+
}), /* @__PURE__ */ V("p", {
|
|
503
|
+
className: "mt-0.5 text-xs text-text-secondary",
|
|
504
|
+
children: "Off unless you turn it on. TimeCampus then sends a short summary of your own tracked time to your notifications, and you can turn it off here at any time. Quiet hours and muted kinds still apply."
|
|
505
|
+
})]
|
|
506
|
+
}), /* @__PURE__ */ V(Z, {
|
|
507
|
+
checked: t.autonomousEnabled,
|
|
508
|
+
disabled: i,
|
|
509
|
+
label: "Send me digests without asking",
|
|
510
|
+
onChange: (e) => l({ autonomousEnabled: e })
|
|
511
|
+
})]
|
|
512
|
+
}), t.autonomousEnabled && /* @__PURE__ */ H("div", {
|
|
513
|
+
className: "mt-3 flex flex-col gap-2",
|
|
514
|
+
children: [
|
|
515
|
+
/* @__PURE__ */ H("label", {
|
|
516
|
+
className: "flex flex-wrap items-center gap-1.5 text-xs text-text-secondary",
|
|
517
|
+
children: ["What to send", /* @__PURE__ */ V("select", {
|
|
518
|
+
className: p,
|
|
519
|
+
disabled: i,
|
|
520
|
+
value: t.cadence,
|
|
521
|
+
"aria-label": "What to send",
|
|
522
|
+
onChange: (e) => l({ cadence: e.target.value }),
|
|
523
|
+
children: re.map((e) => /* @__PURE__ */ V("option", {
|
|
524
|
+
value: e.value,
|
|
525
|
+
children: e.label
|
|
526
|
+
}, e.value))
|
|
527
|
+
})]
|
|
528
|
+
}),
|
|
529
|
+
/* @__PURE__ */ H("label", {
|
|
530
|
+
className: "flex flex-wrap items-center gap-1.5 text-xs text-text-secondary",
|
|
531
|
+
children: ["Not before", /* @__PURE__ */ V("select", {
|
|
532
|
+
className: p,
|
|
533
|
+
disabled: i,
|
|
534
|
+
value: t.digestHourUtc,
|
|
535
|
+
"aria-label": "Not before",
|
|
536
|
+
onChange: (e) => l({ digestHourUtc: Number(e.target.value) }),
|
|
537
|
+
children: q.map((e) => /* @__PURE__ */ V("option", {
|
|
538
|
+
value: e,
|
|
539
|
+
children: ae(e)
|
|
540
|
+
}, e))
|
|
541
|
+
})]
|
|
542
|
+
}),
|
|
543
|
+
/* @__PURE__ */ H("label", {
|
|
544
|
+
className: "flex flex-wrap items-center gap-1.5 text-xs text-text-secondary",
|
|
545
|
+
children: ["Weekly digest on", /* @__PURE__ */ V("select", {
|
|
546
|
+
className: p,
|
|
547
|
+
disabled: i,
|
|
548
|
+
value: t.weeklyDigestDay,
|
|
549
|
+
"aria-label": "Weekly digest on",
|
|
550
|
+
onChange: (e) => l({ weeklyDigestDay: Number(e.target.value) }),
|
|
551
|
+
children: O.map((e) => /* @__PURE__ */ V("option", {
|
|
552
|
+
value: e.value,
|
|
553
|
+
children: e.label
|
|
554
|
+
}, e.value))
|
|
555
|
+
})]
|
|
556
|
+
})
|
|
557
|
+
]
|
|
558
|
+
})]
|
|
538
559
|
})
|
|
539
560
|
]
|
|
540
561
|
})
|
|
541
562
|
]
|
|
542
563
|
});
|
|
543
564
|
}
|
|
544
|
-
var
|
|
565
|
+
var Q = {
|
|
545
566
|
success: "success",
|
|
546
567
|
neutral: "muted",
|
|
547
568
|
warning: "warning"
|
|
548
569
|
};
|
|
549
|
-
function
|
|
570
|
+
function je({ deliveries: e, loading: t, enabled: n }) {
|
|
550
571
|
return t || !n && e.length === 0 ? null : /* @__PURE__ */ H(U, {
|
|
551
572
|
treatment: "glass",
|
|
552
573
|
className: "mt-4 p-4 sm:p-5",
|
|
@@ -560,7 +581,7 @@ function Ae({ deliveries: e, loading: t, enabled: n }) {
|
|
|
560
581
|
}) : /* @__PURE__ */ V("ul", {
|
|
561
582
|
className: "mt-3 space-y-3",
|
|
562
583
|
children: e.map((e) => {
|
|
563
|
-
let t =
|
|
584
|
+
let t = ie(e);
|
|
564
585
|
return /* @__PURE__ */ H("li", {
|
|
565
586
|
className: "flex flex-col gap-1",
|
|
566
587
|
children: [/* @__PURE__ */ H("div", {
|
|
@@ -569,7 +590,7 @@ function Ae({ deliveries: e, loading: t, enabled: n }) {
|
|
|
569
590
|
className: "text-xs font-medium text-text-primary",
|
|
570
591
|
children: t.title
|
|
571
592
|
}), /* @__PURE__ */ V(s, {
|
|
572
|
-
variant:
|
|
593
|
+
variant: Q[t.tone],
|
|
573
594
|
label: e.trigger === "SCHEDULED" ? "Automatic" : "Manual"
|
|
574
595
|
})]
|
|
575
596
|
}), /* @__PURE__ */ H("span", {
|
|
@@ -585,7 +606,7 @@ function Ae({ deliveries: e, loading: t, enabled: n }) {
|
|
|
585
606
|
})]
|
|
586
607
|
});
|
|
587
608
|
}
|
|
588
|
-
function
|
|
609
|
+
function Me(e) {
|
|
589
610
|
switch (e) {
|
|
590
611
|
case W.Snoozed: return {
|
|
591
612
|
title: "Nothing snoozed",
|
|
@@ -605,18 +626,18 @@ function je(e) {
|
|
|
605
626
|
};
|
|
606
627
|
}
|
|
607
628
|
}
|
|
608
|
-
function
|
|
609
|
-
let { workspaceId: e } = i(), { toasts: a, addToast: s, dismissToast: d } = u(), [v, y] = A(W.New), [b, x] = A(null), [S, C] = A(null), [w,
|
|
629
|
+
function $() {
|
|
630
|
+
let { workspaceId: e } = i(), { toasts: a, addToast: s, dismissToast: d } = u(), [v, y] = A(W.New), [b, x] = A(null), [S, C] = A(null), [w, T] = A(""), { data: E, loading: ne, error: re, refetch: O } = h({
|
|
610
631
|
variables: { state: null },
|
|
611
632
|
skip: !e
|
|
612
|
-
}), { data: ie, loading: ae, refetch: oe } = m({ skip: !e }), [se, { loading: ce }] = ee(), [
|
|
633
|
+
}), { data: ie, loading: ae, refetch: oe } = m({ skip: !e }), [se, { loading: ce }] = ee(), [le] = f(), [j] = p(), [de] = _(), [fe, { loading: N }] = te(), { data: pe, loading: me, refetch: he } = g({
|
|
613
634
|
variables: { limit: 5 },
|
|
614
635
|
skip: !e
|
|
615
|
-
}),
|
|
636
|
+
}), P = ie?.myRecommendationPreferences, F = k(() => new Set(P?.mutedKinds ?? []), [P?.mutedKinds]), I = k(() => E?.myRecommendations ?? [], [E?.myRecommendations]), L = k(() => {
|
|
616
637
|
let e = {};
|
|
617
|
-
for (let t of
|
|
638
|
+
for (let t of I) e[t.state] = (e[t.state] ?? 0) + 1;
|
|
618
639
|
return e;
|
|
619
|
-
}, [
|
|
640
|
+
}, [I]), R = k(() => I.filter((e) => e.state === v), [I, v]), ge = L[W.New] ?? 0, _e = L[W.Accepted] ?? 0, ye = L[W.Snoozed] ?? 0, be = async () => {
|
|
620
641
|
try {
|
|
621
642
|
let e = (await se()).data?.generateMyRecommendations ?? [];
|
|
622
643
|
s({
|
|
@@ -631,10 +652,10 @@ function Q() {
|
|
|
631
652
|
variant: "error"
|
|
632
653
|
});
|
|
633
654
|
}
|
|
634
|
-
},
|
|
655
|
+
}, Ce = async (e) => {
|
|
635
656
|
x(e);
|
|
636
657
|
try {
|
|
637
|
-
await
|
|
658
|
+
await le({ variables: { id: e } }), s({
|
|
638
659
|
title: "Accepted — nice",
|
|
639
660
|
variant: "success"
|
|
640
661
|
}), await O();
|
|
@@ -646,12 +667,12 @@ function Q() {
|
|
|
646
667
|
} finally {
|
|
647
668
|
x(null);
|
|
648
669
|
}
|
|
649
|
-
},
|
|
670
|
+
}, Te = async (e) => {
|
|
650
671
|
x(e);
|
|
651
672
|
try {
|
|
652
|
-
await
|
|
673
|
+
await de({ variables: {
|
|
653
674
|
id: e,
|
|
654
|
-
until:
|
|
675
|
+
until: we()
|
|
655
676
|
} }), s({
|
|
656
677
|
title: "Snoozed for a week",
|
|
657
678
|
description: "It'll resurface later — no nagging in between.",
|
|
@@ -665,21 +686,21 @@ function Q() {
|
|
|
665
686
|
} finally {
|
|
666
687
|
x(null);
|
|
667
688
|
}
|
|
668
|
-
},
|
|
669
|
-
|
|
670
|
-
},
|
|
689
|
+
}, G = (e) => {
|
|
690
|
+
T(""), C(e);
|
|
691
|
+
}, K = async () => {
|
|
671
692
|
let e = S;
|
|
672
693
|
if (!e) return;
|
|
673
694
|
let t = w.trim();
|
|
674
695
|
x(e.id);
|
|
675
696
|
try {
|
|
676
|
-
await
|
|
697
|
+
await j({ variables: {
|
|
677
698
|
id: e.id,
|
|
678
699
|
reason: t.length > 0 ? t : null
|
|
679
700
|
} }), s({
|
|
680
701
|
title: "Dismissed",
|
|
681
702
|
variant: "success"
|
|
682
|
-
}), C(null),
|
|
703
|
+
}), C(null), T(""), await O();
|
|
683
704
|
} catch {
|
|
684
705
|
s({
|
|
685
706
|
title: "Couldn't dismiss that one",
|
|
@@ -688,9 +709,9 @@ function Q() {
|
|
|
688
709
|
} finally {
|
|
689
710
|
x(null);
|
|
690
711
|
}
|
|
691
|
-
},
|
|
712
|
+
}, q = async (e, t) => {
|
|
692
713
|
try {
|
|
693
|
-
await
|
|
714
|
+
await fe({ variables: { input: e } }), s({
|
|
694
715
|
title: t,
|
|
695
716
|
variant: "success"
|
|
696
717
|
}), await oe();
|
|
@@ -701,42 +722,43 @@ function Q() {
|
|
|
701
722
|
variant: "error"
|
|
702
723
|
});
|
|
703
724
|
}
|
|
704
|
-
},
|
|
725
|
+
}, Ee = (e) => void q({ neverOptimiseForOutput: e }, e ? "Output-increasing suggestions are off" : "Output-increasing suggestions allowed"), De = (e, t) => void q({
|
|
705
726
|
quietHoursStart: e,
|
|
706
727
|
quietHoursEnd: t
|
|
707
|
-
}, e === null && t === null ? "Quiet hours cleared" : "Quiet hours saved"),
|
|
708
|
-
|
|
709
|
-
},
|
|
710
|
-
prefs:
|
|
728
|
+
}, e === null && t === null ? "Quiet hours cleared" : "Quiet hours saved"), Oe = (e) => {
|
|
729
|
+
F.has(e) || q({ mutedKinds: [...F, e] }, `${D(e)} suggestions muted`);
|
|
730
|
+
}, X = /* @__PURE__ */ V(Ae, {
|
|
731
|
+
prefs: P,
|
|
711
732
|
loading: ae,
|
|
712
|
-
saving:
|
|
713
|
-
onToggleOutputGuard:
|
|
714
|
-
onQuietHoursChange:
|
|
715
|
-
onUnmuteKind: (e) => void
|
|
733
|
+
saving: N,
|
|
734
|
+
onToggleOutputGuard: Ee,
|
|
735
|
+
onQuietHoursChange: De,
|
|
736
|
+
onUnmuteKind: (e) => void q({ mutedKinds: [...F].filter((t) => t !== e) }, `${D(e)} suggestions unmuted`),
|
|
737
|
+
onDomainsChange: (e) => void q({ optedInDomains: e }, "Opted-in domains saved"),
|
|
716
738
|
onAutonomousChange: (e) => {
|
|
717
739
|
(async () => {
|
|
718
740
|
let t = "Digest settings saved";
|
|
719
|
-
e.autonomousEnabled === !0 && (t = "Digests turned on"), e.autonomousEnabled === !1 && (t = "Digests turned off"), await
|
|
741
|
+
e.autonomousEnabled === !0 && (t = "Digests turned on"), e.autonomousEnabled === !1 && (t = "Digests turned off"), await q(e, t), await he();
|
|
720
742
|
})();
|
|
721
743
|
}
|
|
722
|
-
}),
|
|
723
|
-
deliveries:
|
|
724
|
-
loading:
|
|
725
|
-
enabled:
|
|
726
|
-
}),
|
|
744
|
+
}), Z = /* @__PURE__ */ V(je, {
|
|
745
|
+
deliveries: pe?.myTimeIntelligenceDeliveries ?? [],
|
|
746
|
+
loading: me,
|
|
747
|
+
enabled: P?.autonomousEnabled ?? !1
|
|
748
|
+
}), Q = /* @__PURE__ */ H("button", {
|
|
727
749
|
type: "button",
|
|
728
|
-
onClick:
|
|
750
|
+
onClick: be,
|
|
729
751
|
disabled: ce || !e,
|
|
730
|
-
className:
|
|
752
|
+
className: J,
|
|
731
753
|
children: [/* @__PURE__ */ V(z, { className: "h-4 w-4" }), ce ? "Generating…" : "Generate recommendations"]
|
|
732
|
-
}),
|
|
754
|
+
}), $ = "Gentle, values-aware nudges built from your real timeline — protect a focus block, reclaim a commute, guard family time. Accept the ones that fit, snooze the rest, and dismiss what doesn't. TimeCampus never optimises for more output — only for time that matches what you value.", Ne = /* @__PURE__ */ V(U, {
|
|
733
755
|
treatment: "insight",
|
|
734
756
|
className: "mt-6 p-4 sm:p-5",
|
|
735
757
|
children: /* @__PURE__ */ H("div", {
|
|
736
758
|
className: "flex items-start gap-3",
|
|
737
759
|
children: [/* @__PURE__ */ V("span", {
|
|
738
760
|
className: "flex h-9 w-9 shrink-0 items-center justify-center rounded-lg bg-status-info-bg text-status-info-text",
|
|
739
|
-
children: /* @__PURE__ */ V(
|
|
761
|
+
children: /* @__PURE__ */ V(ve, { className: "h-5 w-5" })
|
|
740
762
|
}), /* @__PURE__ */ H("div", {
|
|
741
763
|
className: "min-w-0",
|
|
742
764
|
children: [/* @__PURE__ */ V("h3", {
|
|
@@ -752,8 +774,8 @@ function Q() {
|
|
|
752
774
|
if (!e || ne) return /* @__PURE__ */ V(o, {
|
|
753
775
|
title: "Recommendations",
|
|
754
776
|
description: "Values-aware suggestions from your real timeline",
|
|
755
|
-
purpose:
|
|
756
|
-
actions:
|
|
777
|
+
purpose: $,
|
|
778
|
+
actions: Q,
|
|
757
779
|
children: /* @__PURE__ */ V(n, {
|
|
758
780
|
variant: "list",
|
|
759
781
|
count: 4
|
|
@@ -762,19 +784,19 @@ function Q() {
|
|
|
762
784
|
if (re) return /* @__PURE__ */ V(o, {
|
|
763
785
|
title: "Recommendations",
|
|
764
786
|
description: "Values-aware suggestions from your real timeline",
|
|
765
|
-
purpose:
|
|
766
|
-
actions:
|
|
787
|
+
purpose: $,
|
|
788
|
+
actions: Q,
|
|
767
789
|
children: /* @__PURE__ */ V("div", {
|
|
768
790
|
className: "rounded-xl border border-status-error-border/50 bg-status-error-bg/10 p-4 text-sm text-status-error-text",
|
|
769
791
|
children: "Couldn't load your recommendations right now. Please try again in a moment."
|
|
770
792
|
})
|
|
771
793
|
});
|
|
772
|
-
let Pe =
|
|
794
|
+
let Pe = I.length > 0, Fe = Me(v);
|
|
773
795
|
return /* @__PURE__ */ H(o, {
|
|
774
796
|
title: "Recommendations",
|
|
775
797
|
description: "Values-aware suggestions from your real timeline",
|
|
776
|
-
purpose:
|
|
777
|
-
actions:
|
|
798
|
+
purpose: $,
|
|
799
|
+
actions: Q,
|
|
778
800
|
children: [
|
|
779
801
|
Pe ? /* @__PURE__ */ H("div", {
|
|
780
802
|
className: "grid grid-cols-1 gap-6 lg:grid-cols-[minmax(0,1fr)_20rem]",
|
|
@@ -787,20 +809,20 @@ function Q() {
|
|
|
787
809
|
/* @__PURE__ */ V(t, {
|
|
788
810
|
featured: !0,
|
|
789
811
|
title: "New for you",
|
|
790
|
-
value: String(
|
|
812
|
+
value: String(ge),
|
|
791
813
|
icon: /* @__PURE__ */ V(z, { className: "h-5 w-5" }),
|
|
792
814
|
description: "Awaiting your call"
|
|
793
815
|
}),
|
|
794
816
|
/* @__PURE__ */ V(t, {
|
|
795
817
|
title: "Accepted",
|
|
796
|
-
value: String(
|
|
797
|
-
icon: /* @__PURE__ */ V(
|
|
818
|
+
value: String(_e),
|
|
819
|
+
icon: /* @__PURE__ */ V(ue, { className: "h-5 w-5" }),
|
|
798
820
|
description: "Changes you chose to make"
|
|
799
821
|
}),
|
|
800
822
|
/* @__PURE__ */ V(t, {
|
|
801
823
|
title: "Snoozed",
|
|
802
|
-
value: String(
|
|
803
|
-
icon: /* @__PURE__ */ V(
|
|
824
|
+
value: String(ye),
|
|
825
|
+
icon: /* @__PURE__ */ V(M, { className: "h-5 w-5" }),
|
|
804
826
|
description: "Waiting for a better moment"
|
|
805
827
|
})
|
|
806
828
|
]
|
|
@@ -811,8 +833,8 @@ function Q() {
|
|
|
811
833
|
className: "inline-flex items-center rounded-lg border border-border-subtle bg-bg-sunken/50 p-0.5",
|
|
812
834
|
role: "tablist",
|
|
813
835
|
"aria-label": "Filter recommendations by state",
|
|
814
|
-
children:
|
|
815
|
-
let t = e.key === v, n =
|
|
836
|
+
children: Se.map((e) => {
|
|
837
|
+
let t = e.key === v, n = L[e.key] ?? 0;
|
|
816
838
|
return /* @__PURE__ */ H("button", {
|
|
817
839
|
type: "button",
|
|
818
840
|
role: "tab",
|
|
@@ -827,34 +849,34 @@ function Q() {
|
|
|
827
849
|
})
|
|
828
850
|
})
|
|
829
851
|
}),
|
|
830
|
-
|
|
852
|
+
R.length === 0 ? /* @__PURE__ */ V(r, {
|
|
831
853
|
illustration: "empty-data",
|
|
832
854
|
title: Fe.title,
|
|
833
855
|
description: Fe.description,
|
|
834
|
-
action: v === W.New ?
|
|
856
|
+
action: v === W.New ? Q : void 0
|
|
835
857
|
}) : /* @__PURE__ */ V("div", {
|
|
836
858
|
className: "space-y-4",
|
|
837
|
-
children:
|
|
859
|
+
children: R.map((e) => /* @__PURE__ */ V(ke, {
|
|
838
860
|
rec: e,
|
|
839
|
-
busy: b === e.id ||
|
|
840
|
-
muted:
|
|
841
|
-
onAccept:
|
|
842
|
-
onSnooze:
|
|
843
|
-
onDismiss:
|
|
844
|
-
onMuteKind:
|
|
861
|
+
busy: b === e.id || N,
|
|
862
|
+
muted: F.has(e.kind),
|
|
863
|
+
onAccept: Ce,
|
|
864
|
+
onSnooze: Te,
|
|
865
|
+
onDismiss: G,
|
|
866
|
+
onMuteKind: Oe
|
|
845
867
|
}, e.id))
|
|
846
868
|
}),
|
|
847
869
|
Ne
|
|
848
870
|
]
|
|
849
|
-
}), /* @__PURE__ */ H("div", { children: [
|
|
871
|
+
}), /* @__PURE__ */ H("div", { children: [X, Z] })]
|
|
850
872
|
}) : /* @__PURE__ */ H("div", {
|
|
851
873
|
className: "grid grid-cols-1 gap-6 lg:grid-cols-[minmax(0,1fr)_20rem]",
|
|
852
874
|
children: [/* @__PURE__ */ H("div", { children: [/* @__PURE__ */ V(r, {
|
|
853
875
|
illustration: "empty-data",
|
|
854
876
|
title: "No recommendations yet",
|
|
855
877
|
description: "TimeCampus turns your real timeline into gentle, values-aware suggestions — like protecting a focus block or reclaiming a commute. Generate your first set to see what it notices.",
|
|
856
|
-
action:
|
|
857
|
-
}), Ne] }), /* @__PURE__ */ H("div", { children: [
|
|
878
|
+
action: Q
|
|
879
|
+
}), Ne] }), /* @__PURE__ */ H("div", { children: [X, Z] })]
|
|
858
880
|
}),
|
|
859
881
|
/* @__PURE__ */ H(c, {
|
|
860
882
|
open: S !== null,
|
|
@@ -862,16 +884,16 @@ function Q() {
|
|
|
862
884
|
title: "Dismiss this suggestion",
|
|
863
885
|
description: S?.title,
|
|
864
886
|
size: "sm",
|
|
865
|
-
footer: /* @__PURE__ */ H(
|
|
887
|
+
footer: /* @__PURE__ */ H(xe, { children: [/* @__PURE__ */ V("button", {
|
|
866
888
|
type: "button",
|
|
867
889
|
onClick: () => C(null),
|
|
868
|
-
className:
|
|
890
|
+
className: Y,
|
|
869
891
|
children: "Cancel"
|
|
870
892
|
}), /* @__PURE__ */ H("button", {
|
|
871
893
|
type: "button",
|
|
872
|
-
onClick: () => void
|
|
894
|
+
onClick: () => void K(),
|
|
873
895
|
disabled: b !== null,
|
|
874
|
-
className:
|
|
896
|
+
className: J,
|
|
875
897
|
children: [/* @__PURE__ */ V(B, { className: "h-4 w-4" }), "Dismiss"]
|
|
876
898
|
})] }),
|
|
877
899
|
children: [
|
|
@@ -891,7 +913,7 @@ function Q() {
|
|
|
891
913
|
id: "rec-dismiss-reason",
|
|
892
914
|
rows: 3,
|
|
893
915
|
value: w,
|
|
894
|
-
onChange: (e) =>
|
|
916
|
+
onChange: (e) => T(e.target.value),
|
|
895
917
|
placeholder: "e.g. already handled, not the right week",
|
|
896
918
|
className: "mt-1.5 w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary placeholder:text-text-secondary"
|
|
897
919
|
}),
|
|
@@ -908,6 +930,6 @@ function Q() {
|
|
|
908
930
|
]
|
|
909
931
|
});
|
|
910
932
|
}
|
|
911
|
-
export {
|
|
933
|
+
export { $ as RecommendationsPage };
|
|
912
934
|
|
|
913
935
|
//# sourceMappingURL=RecommendationsPage.js.map
|