@burdenoff/microfe-timecampus 2026.1031.2 → 2026.1031.4
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/channels/ChannelsPage.d.ts.map +1 -1
- package/dist/timecampus/pages/channels/ChannelsPage.js +25 -18
- package/dist/timecampus/pages/channels/ChannelsPage.js.map +1 -1
- package/dist/timecampus/pages/channels/channelCatalog.d.ts +9 -3
- package/dist/timecampus/pages/channels/channelCatalog.d.ts.map +1 -1
- package/dist/timecampus/pages/channels/channelCatalog.js +19 -15
- package/dist/timecampus/pages/channels/channelCatalog.js.map +1 -1
- package/dist/timecampus/pages/lifetime/RecommendationsPage.d.ts.map +1 -1
- package/dist/timecampus/pages/lifetime/RecommendationsPage.js +337 -314
- package/dist/timecampus/pages/lifetime/RecommendationsPage.js.map +1 -1
- package/dist/timecampus/pages/lifetime/recommendationEvidence.d.ts +18 -0
- package/dist/timecampus/pages/lifetime/recommendationEvidence.d.ts.map +1 -1
- package/dist/timecampus/pages/lifetime/recommendationEvidence.js +21 -1
- package/dist/timecampus/pages/lifetime/recommendationEvidence.js.map +1 -1
- package/dist/timecampus/pages/timeline/TimelinePage.d.ts.map +1 -1
- package/dist/timecampus/pages/timeline/TimelinePage.js +212 -207
- package/dist/timecampus/pages/timeline/TimelinePage.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import { useTimeCampus as e } from "../../providers/TimeCampusProvider.js";
|
|
2
|
-
import { cn as
|
|
3
|
-
import { StatCard as
|
|
4
|
-
import { LoadingSkeleton as
|
|
5
|
-
import { EmptyState as
|
|
6
|
-
import { useAcceptRecommendationMutation as
|
|
7
|
-
import { PageLayout as
|
|
8
|
-
import { StatusBadge as
|
|
9
|
-
import { Modal as
|
|
10
|
-
import { ToastContainer as
|
|
1
|
+
import { useTimeCampus as e, useTimeCampusNavigate as t } from "../../providers/TimeCampusProvider.js";
|
|
2
|
+
import { cn as n } from "../../utils/helpers.js";
|
|
3
|
+
import { StatCard as r } from "../../components/StatCard.js";
|
|
4
|
+
import { LoadingSkeleton as i } from "../../components/LoadingSkeleton.js";
|
|
5
|
+
import { EmptyState as a } from "../../components/EmptyState.js";
|
|
6
|
+
import { useAcceptRecommendationMutation as o, useDismissRecommendationMutation as s, useGenerateMyRecommendationsMutation as c, useMyRecommendationPreferencesQuery as l, useMyRecommendationsQuery as u, useSnoozeRecommendationMutation as d, useUpdateMyRecommendationPreferencesMutation as f } from "../../../generated/wspace-operations.js";
|
|
7
|
+
import { PageLayout as p } from "../../components/PageLayout.js";
|
|
8
|
+
import { StatusBadge as m } from "../../components/StatusBadge.js";
|
|
9
|
+
import { Modal as h } from "../../components/Modal.js";
|
|
10
|
+
import { ToastContainer as g, useToast as _ } from "../../components/Toast.js";
|
|
11
11
|
import "../../components/index.js";
|
|
12
|
-
import { TimeCampusLifeDomain as
|
|
13
|
-
import { lifeDomainLabel as
|
|
14
|
-
import { formatEvidenceRef as
|
|
15
|
-
import { useMemo as
|
|
16
|
-
import { BellOff as
|
|
17
|
-
import { Fragment as de, jsx as
|
|
18
|
-
import { GlassCard as
|
|
12
|
+
import { TimeCampusLifeDomain as v } from "../../../generated/wspace-types.js";
|
|
13
|
+
import { lifeDomainLabel as y } from "./domains.js";
|
|
14
|
+
import { evidenceWeeks as b, formatEvidenceRef as x, formatHourOfDay as S, humaniseToken as C, parseEvidenceRefs as w, parseSuggestedAction as T } from "./recommendationEvidence.js";
|
|
15
|
+
import { useMemo as E, useState as D } from "react";
|
|
16
|
+
import { BellOff as O, Briefcase as k, Bus as A, CalendarClock as ee, Check as te, CheckCircle2 as ne, ChevronDown as j, Circle as re, Clock as M, Coffee as ie, ExternalLink as ae, GraduationCap as oe, Handshake as N, Heart as se, HeartPulse as ce, Home as le, Hourglass as ue, Lightbulb as P, Microscope as F, Moon as I, ShieldCheck as L, Sparkles as R, Users as z, Wallet as B, X as V } from "lucide-react";
|
|
17
|
+
import { Fragment as de, jsx as H, jsxs as U } from "react/jsx-runtime";
|
|
18
|
+
import { GlassCard as W } from "@burdenoff/fe-libs/ui";
|
|
19
19
|
//#region src/timecampus/pages/lifetime/RecommendationsPage.tsx
|
|
20
|
-
var
|
|
20
|
+
var G = "Raised by TimeCampus's built-in rules from your own tracked time. It can be wrong for your week, so judge it before you accept.", K = {
|
|
21
21
|
New: "NEW",
|
|
22
22
|
Snoozed: "SNOOZED",
|
|
23
23
|
Accepted: "ACCEPTED",
|
|
@@ -25,70 +25,70 @@ var H = {
|
|
|
25
25
|
Expired: "EXPIRED"
|
|
26
26
|
}, fe = [
|
|
27
27
|
{
|
|
28
|
-
key:
|
|
28
|
+
key: K.New,
|
|
29
29
|
label: "New"
|
|
30
30
|
},
|
|
31
31
|
{
|
|
32
|
-
key:
|
|
32
|
+
key: K.Snoozed,
|
|
33
33
|
label: "Snoozed"
|
|
34
34
|
},
|
|
35
35
|
{
|
|
36
|
-
key:
|
|
36
|
+
key: K.Accepted,
|
|
37
37
|
label: "Accepted"
|
|
38
38
|
},
|
|
39
39
|
{
|
|
40
|
-
key:
|
|
40
|
+
key: K.Dismissed,
|
|
41
41
|
label: "Dismissed"
|
|
42
42
|
}
|
|
43
43
|
];
|
|
44
|
-
function
|
|
45
|
-
return e ===
|
|
44
|
+
function pe(e) {
|
|
45
|
+
return e === K.New || e === K.Snoozed;
|
|
46
46
|
}
|
|
47
|
-
function
|
|
47
|
+
function me() {
|
|
48
48
|
return new Date(Date.now() + 6048e5).toISOString();
|
|
49
49
|
}
|
|
50
|
-
var
|
|
51
|
-
function
|
|
50
|
+
var he = (e) => Math.min(1, Math.max(0, e)), q = (e) => `${Math.round(he(e) * 100)}%`;
|
|
51
|
+
function J(e) {
|
|
52
52
|
return new Date(e).toLocaleDateString(void 0, {
|
|
53
53
|
month: "short",
|
|
54
54
|
day: "numeric",
|
|
55
55
|
year: "numeric"
|
|
56
56
|
});
|
|
57
57
|
}
|
|
58
|
-
var
|
|
59
|
-
[
|
|
60
|
-
[
|
|
61
|
-
[
|
|
62
|
-
[
|
|
63
|
-
[
|
|
64
|
-
[
|
|
65
|
-
[
|
|
66
|
-
[
|
|
67
|
-
[
|
|
68
|
-
[
|
|
69
|
-
[
|
|
70
|
-
[
|
|
71
|
-
[
|
|
72
|
-
[
|
|
58
|
+
var Y = Array.from({ length: 24 }, (e, t) => t), ge = {
|
|
59
|
+
[v.Work]: k,
|
|
60
|
+
[v.Sleep]: I,
|
|
61
|
+
[v.Health]: ce,
|
|
62
|
+
[v.Family]: z,
|
|
63
|
+
[v.Learning]: oe,
|
|
64
|
+
[v.Leisure]: ie,
|
|
65
|
+
[v.Commute]: A,
|
|
66
|
+
[v.Waiting]: ue,
|
|
67
|
+
[v.Chores]: le,
|
|
68
|
+
[v.SelfCare]: se,
|
|
69
|
+
[v.Social]: N,
|
|
70
|
+
[v.FinanceAdmin]: B,
|
|
71
|
+
[v.Reflection]: R,
|
|
72
|
+
[v.Other]: re
|
|
73
73
|
};
|
|
74
|
-
function
|
|
75
|
-
return e ?
|
|
74
|
+
function _e(e) {
|
|
75
|
+
return e ? ge[e] ?? P : P;
|
|
76
76
|
}
|
|
77
|
-
function
|
|
77
|
+
function ve(e) {
|
|
78
78
|
switch (e) {
|
|
79
|
-
case
|
|
79
|
+
case K.Accepted: return {
|
|
80
80
|
variant: "success",
|
|
81
81
|
label: "Accepted"
|
|
82
82
|
};
|
|
83
|
-
case
|
|
83
|
+
case K.Snoozed: return {
|
|
84
84
|
variant: "warning",
|
|
85
85
|
label: "Snoozed"
|
|
86
86
|
};
|
|
87
|
-
case
|
|
87
|
+
case K.Dismissed: return {
|
|
88
88
|
variant: "muted",
|
|
89
89
|
label: "Dismissed"
|
|
90
90
|
};
|
|
91
|
-
case
|
|
91
|
+
case K.Expired: return {
|
|
92
92
|
variant: "muted",
|
|
93
93
|
label: "Expired"
|
|
94
94
|
};
|
|
@@ -98,104 +98,109 @@ function ge(e) {
|
|
|
98
98
|
};
|
|
99
99
|
}
|
|
100
100
|
}
|
|
101
|
-
var
|
|
102
|
-
function
|
|
103
|
-
return /* @__PURE__ */
|
|
101
|
+
var ye = "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", X = "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", Z = "inline-flex items-center gap-1 rounded-full bg-bg-sunken px-2.5 py-0.5 text-xs font-medium text-text-secondary";
|
|
102
|
+
function be({ checked: e, onChange: t, label: r, disabled: i }) {
|
|
103
|
+
return /* @__PURE__ */ H("button", {
|
|
104
104
|
type: "button",
|
|
105
105
|
role: "switch",
|
|
106
106
|
"aria-checked": e,
|
|
107
107
|
"aria-label": r,
|
|
108
108
|
disabled: i,
|
|
109
|
-
onClick: () =>
|
|
110
|
-
className:
|
|
111
|
-
children: /* @__PURE__ */
|
|
109
|
+
onClick: () => t(!e),
|
|
110
|
+
className: n("relative inline-flex h-5 w-9 shrink-0 items-center rounded-full border transition-colors disabled:cursor-not-allowed disabled:opacity-50", e ? "border-transparent bg-action-primary-bg" : "border-border-subtle bg-bg-sunken"),
|
|
111
|
+
children: /* @__PURE__ */ H("span", { className: n("inline-block h-3.5 w-3.5 transform rounded-full shadow-sm transition-transform", e ? "translate-x-4 bg-action-primary-text" : "translate-x-0.5 bg-text-secondary") })
|
|
112
112
|
});
|
|
113
113
|
}
|
|
114
|
-
function
|
|
115
|
-
let
|
|
116
|
-
return /* @__PURE__ */
|
|
114
|
+
function xe({ rec: e, busy: r, muted: i, onAccept: a, onSnooze: o, onDismiss: s, onMuteKind: c }) {
|
|
115
|
+
let l = _e(e.domain), u = pe(e.state), d = ve(e.state), [f, p] = D(!1), h = w(e.evidenceRefs), g = T(e.suggestedAction), _ = `rec-evidence-${e.id}`, v = b(e.createdAt, h), S = t();
|
|
116
|
+
return /* @__PURE__ */ U(W, {
|
|
117
117
|
treatment: "glass",
|
|
118
118
|
className: "flex flex-col gap-3 p-4 sm:p-5",
|
|
119
119
|
children: [
|
|
120
|
-
/* @__PURE__ */
|
|
120
|
+
/* @__PURE__ */ U("div", {
|
|
121
121
|
className: "flex items-start justify-between gap-3",
|
|
122
|
-
children: [/* @__PURE__ */
|
|
122
|
+
children: [/* @__PURE__ */ U("div", {
|
|
123
123
|
className: "flex min-w-0 items-center gap-3",
|
|
124
|
-
children: [/* @__PURE__ */
|
|
124
|
+
children: [/* @__PURE__ */ H("span", {
|
|
125
125
|
className: "flex h-10 w-10 shrink-0 items-center justify-center rounded-lg bg-action-primary-bg/10 text-primary",
|
|
126
|
-
children: /* @__PURE__ */
|
|
127
|
-
}), /* @__PURE__ */
|
|
126
|
+
children: /* @__PURE__ */ H(l, { className: "h-5 w-5" })
|
|
127
|
+
}), /* @__PURE__ */ U("div", {
|
|
128
128
|
className: "min-w-0",
|
|
129
|
-
children: [/* @__PURE__ */
|
|
129
|
+
children: [/* @__PURE__ */ H("p", {
|
|
130
130
|
className: "truncate text-xs font-medium uppercase tracking-wide text-text-secondary",
|
|
131
|
-
children:
|
|
132
|
-
}), /* @__PURE__ */
|
|
131
|
+
children: C(e.kind)
|
|
132
|
+
}), /* @__PURE__ */ H("h3", {
|
|
133
133
|
className: "mt-0.5 text-base font-semibold text-text-primary",
|
|
134
134
|
children: e.title
|
|
135
135
|
})]
|
|
136
136
|
})]
|
|
137
|
-
}), e.confidence != null && /* @__PURE__ */
|
|
137
|
+
}), e.confidence != null && /* @__PURE__ */ H(m, {
|
|
138
138
|
variant: "info",
|
|
139
|
-
label: `${
|
|
139
|
+
label: `${q(e.confidence)} confident`,
|
|
140
140
|
className: "shrink-0"
|
|
141
141
|
})]
|
|
142
142
|
}),
|
|
143
|
-
/* @__PURE__ */
|
|
143
|
+
/* @__PURE__ */ H("p", {
|
|
144
144
|
className: "text-sm text-text-secondary",
|
|
145
145
|
children: e.rationale
|
|
146
146
|
}),
|
|
147
|
-
/* @__PURE__ */
|
|
147
|
+
/* @__PURE__ */ H("p", {
|
|
148
|
+
className: "text-xs text-text-tertiary",
|
|
149
|
+
"data-testid": "rec-provenance",
|
|
150
|
+
children: G
|
|
151
|
+
}),
|
|
152
|
+
/* @__PURE__ */ U("div", {
|
|
148
153
|
className: "flex flex-wrap items-center gap-1.5",
|
|
149
154
|
children: [
|
|
150
|
-
e.domain && /* @__PURE__ */
|
|
151
|
-
className:
|
|
152
|
-
children:
|
|
155
|
+
e.domain && /* @__PURE__ */ H("span", {
|
|
156
|
+
className: Z,
|
|
157
|
+
children: y(e.domain)
|
|
153
158
|
}),
|
|
154
|
-
e.valueAlignment != null && /* @__PURE__ */
|
|
155
|
-
className:
|
|
159
|
+
e.valueAlignment != null && /* @__PURE__ */ U("span", {
|
|
160
|
+
className: Z,
|
|
156
161
|
children: [
|
|
157
|
-
/* @__PURE__ */
|
|
162
|
+
/* @__PURE__ */ H(L, { className: "h-3 w-3" }),
|
|
158
163
|
"Aligns with your values · ",
|
|
159
|
-
|
|
164
|
+
q(e.valueAlignment)
|
|
160
165
|
]
|
|
161
166
|
}),
|
|
162
|
-
e.state ===
|
|
163
|
-
className:
|
|
167
|
+
e.state === K.Snoozed && e.snoozeUntil && /* @__PURE__ */ U("span", {
|
|
168
|
+
className: Z,
|
|
164
169
|
children: [
|
|
165
|
-
/* @__PURE__ */
|
|
170
|
+
/* @__PURE__ */ H(M, { className: "h-3 w-3" }),
|
|
166
171
|
"Snoozed until ",
|
|
167
|
-
|
|
172
|
+
J(e.snoozeUntil)
|
|
168
173
|
]
|
|
169
174
|
}),
|
|
170
|
-
|
|
171
|
-
className:
|
|
175
|
+
u && e.expiresAt && /* @__PURE__ */ U("span", {
|
|
176
|
+
className: Z,
|
|
172
177
|
children: [
|
|
173
|
-
/* @__PURE__ */
|
|
178
|
+
/* @__PURE__ */ H(ee, { className: "h-3 w-3" }),
|
|
174
179
|
"Expires ",
|
|
175
|
-
|
|
180
|
+
J(e.expiresAt)
|
|
176
181
|
]
|
|
177
182
|
})
|
|
178
183
|
]
|
|
179
184
|
}),
|
|
180
|
-
|
|
185
|
+
g && /* @__PURE__ */ U("div", {
|
|
181
186
|
className: "rounded-lg border border-border-seam bg-bg-sunken/40 p-3",
|
|
182
187
|
children: [
|
|
183
|
-
/* @__PURE__ */
|
|
188
|
+
/* @__PURE__ */ H("p", {
|
|
184
189
|
className: "text-xs font-medium uppercase tracking-wide text-text-secondary",
|
|
185
190
|
children: "Suggested action"
|
|
186
191
|
}),
|
|
187
|
-
/* @__PURE__ */
|
|
192
|
+
/* @__PURE__ */ H("p", {
|
|
188
193
|
className: "mt-1 text-sm font-medium text-text-primary",
|
|
189
|
-
children:
|
|
194
|
+
children: C(g.type)
|
|
190
195
|
}),
|
|
191
|
-
|
|
196
|
+
g.details.length > 0 && /* @__PURE__ */ H("dl", {
|
|
192
197
|
className: "mt-1.5 flex flex-wrap gap-x-4 gap-y-1",
|
|
193
|
-
children:
|
|
198
|
+
children: g.details.map((e) => /* @__PURE__ */ U("div", {
|
|
194
199
|
className: "flex items-center gap-1.5",
|
|
195
|
-
children: [/* @__PURE__ */
|
|
200
|
+
children: [/* @__PURE__ */ H("dt", {
|
|
196
201
|
className: "text-xs text-text-secondary",
|
|
197
202
|
children: e.key
|
|
198
|
-
}), /* @__PURE__ */
|
|
203
|
+
}), /* @__PURE__ */ H("dd", {
|
|
199
204
|
className: "text-xs font-medium tabular-nums text-text-primary",
|
|
200
205
|
children: e.value
|
|
201
206
|
})]
|
|
@@ -203,88 +208,106 @@ function ve({ rec: e, busy: n, muted: r, onAccept: i, onSnooze: a, onDismiss: o,
|
|
|
203
208
|
})
|
|
204
209
|
]
|
|
205
210
|
}),
|
|
206
|
-
|
|
211
|
+
h.length > 0 && /* @__PURE__ */ U("div", {
|
|
207
212
|
className: "rounded-lg border border-border-seam bg-bg-sunken/40",
|
|
208
|
-
children: [/* @__PURE__ */
|
|
213
|
+
children: [/* @__PURE__ */ U("button", {
|
|
209
214
|
type: "button",
|
|
210
|
-
onClick: () =>
|
|
211
|
-
"aria-expanded":
|
|
212
|
-
"aria-controls":
|
|
215
|
+
onClick: () => p((e) => !e),
|
|
216
|
+
"aria-expanded": f,
|
|
217
|
+
"aria-controls": _,
|
|
213
218
|
className: "flex w-full items-center justify-between gap-2 px-3 py-2 text-left",
|
|
214
|
-
children: [/* @__PURE__ */
|
|
219
|
+
children: [/* @__PURE__ */ U("span", {
|
|
215
220
|
className: "flex min-w-0 items-center gap-2",
|
|
216
|
-
children: [/* @__PURE__ */
|
|
221
|
+
children: [/* @__PURE__ */ H(F, { className: "h-3.5 w-3.5 shrink-0 text-text-secondary" }), /* @__PURE__ */ U("span", {
|
|
217
222
|
className: "truncate text-xs text-text-secondary",
|
|
218
223
|
children: [
|
|
219
224
|
"Evidence: ",
|
|
220
|
-
|
|
221
|
-
|
|
225
|
+
x(h[0]),
|
|
226
|
+
h.length > 1 ? ` · +${h.length - 1} more` : ""
|
|
222
227
|
]
|
|
223
228
|
})]
|
|
224
|
-
}), /* @__PURE__ */
|
|
225
|
-
}),
|
|
226
|
-
id:
|
|
229
|
+
}), /* @__PURE__ */ H(j, { className: n("h-4 w-4 shrink-0 text-text-secondary transition-transform", f && "rotate-180") })]
|
|
230
|
+
}), f && /* @__PURE__ */ U("dl", {
|
|
231
|
+
id: _,
|
|
227
232
|
className: "space-y-1.5 border-t border-border-seam px-3 py-2.5",
|
|
228
|
-
children: [
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
233
|
+
children: [
|
|
234
|
+
h.map((e, t) => /* @__PURE__ */ U("div", {
|
|
235
|
+
className: "flex items-baseline justify-between gap-3",
|
|
236
|
+
children: [/* @__PURE__ */ H("dt", {
|
|
237
|
+
className: "text-xs text-text-secondary",
|
|
238
|
+
children: x(e).split(": ")[0]
|
|
239
|
+
}), /* @__PURE__ */ H("dd", {
|
|
240
|
+
className: "text-xs font-medium tabular-nums text-text-primary",
|
|
241
|
+
children: x(e).split(": ").slice(1).join(": ")
|
|
242
|
+
})]
|
|
243
|
+
}, `${e.metric}-${e.period ?? e.domain ?? t}`)),
|
|
244
|
+
v.length > 0 && /* @__PURE__ */ H("div", {
|
|
245
|
+
className: "flex flex-wrap gap-2 pt-1",
|
|
246
|
+
children: v.map((e) => /* @__PURE__ */ U("button", {
|
|
247
|
+
type: "button",
|
|
248
|
+
onClick: () => S(`/timeline?date=${encodeURIComponent(e)}`),
|
|
249
|
+
"data-testid": "rec-evidence-timeline-link",
|
|
250
|
+
className: "inline-flex items-center gap-1 text-xs font-medium text-primary hover:underline focus:outline-none focus-visible:ring-2 focus-visible:ring-action-primary-bg/40",
|
|
251
|
+
children: [
|
|
252
|
+
/* @__PURE__ */ H(ae, { className: "h-3 w-3" }),
|
|
253
|
+
"Open the week of ",
|
|
254
|
+
J(`${e}T12:00:00`),
|
|
255
|
+
" on your timeline"
|
|
256
|
+
]
|
|
257
|
+
}, e))
|
|
258
|
+
}),
|
|
259
|
+
/* @__PURE__ */ H("p", {
|
|
260
|
+
className: "pt-1 text-xs text-text-tertiary",
|
|
261
|
+
children: "Measured from your own tracked week. Nothing is applied until you accept."
|
|
262
|
+
})
|
|
263
|
+
]
|
|
241
264
|
})]
|
|
242
265
|
}),
|
|
243
|
-
|
|
266
|
+
u ? /* @__PURE__ */ U("div", {
|
|
244
267
|
className: "flex flex-wrap items-center gap-2 pt-1",
|
|
245
268
|
children: [
|
|
246
|
-
/* @__PURE__ */
|
|
269
|
+
/* @__PURE__ */ U("button", {
|
|
247
270
|
type: "button",
|
|
248
|
-
onClick: () =>
|
|
249
|
-
disabled:
|
|
250
|
-
className:
|
|
251
|
-
children: [/* @__PURE__ */
|
|
271
|
+
onClick: () => a(e.id),
|
|
272
|
+
disabled: r,
|
|
273
|
+
className: ye,
|
|
274
|
+
children: [/* @__PURE__ */ H(te, { className: "h-4 w-4" }), "Accept"]
|
|
252
275
|
}),
|
|
253
|
-
/* @__PURE__ */
|
|
276
|
+
/* @__PURE__ */ U("button", {
|
|
254
277
|
type: "button",
|
|
255
|
-
onClick: () =>
|
|
256
|
-
disabled:
|
|
257
|
-
className:
|
|
258
|
-
children: [/* @__PURE__ */
|
|
278
|
+
onClick: () => o(e.id),
|
|
279
|
+
disabled: r,
|
|
280
|
+
className: X,
|
|
281
|
+
children: [/* @__PURE__ */ H(M, { className: "h-4 w-4" }), "Snooze"]
|
|
259
282
|
}),
|
|
260
|
-
/* @__PURE__ */
|
|
283
|
+
/* @__PURE__ */ U("button", {
|
|
261
284
|
type: "button",
|
|
262
|
-
onClick: () =>
|
|
263
|
-
disabled:
|
|
264
|
-
className:
|
|
265
|
-
children: [/* @__PURE__ */
|
|
285
|
+
onClick: () => s(e),
|
|
286
|
+
disabled: r,
|
|
287
|
+
className: X,
|
|
288
|
+
children: [/* @__PURE__ */ H(V, { className: "h-4 w-4" }), "Dismiss"]
|
|
266
289
|
}),
|
|
267
|
-
/* @__PURE__ */
|
|
290
|
+
/* @__PURE__ */ U("button", {
|
|
268
291
|
type: "button",
|
|
269
|
-
onClick: () =>
|
|
270
|
-
disabled:
|
|
271
|
-
className:
|
|
272
|
-
title:
|
|
273
|
-
children: [/* @__PURE__ */
|
|
292
|
+
onClick: () => c(e.kind),
|
|
293
|
+
disabled: r || i,
|
|
294
|
+
className: X,
|
|
295
|
+
title: i ? `${C(e.kind)} suggestions are already muted` : `Stop generating ${C(e.kind)} suggestions`,
|
|
296
|
+
children: [/* @__PURE__ */ H(O, { className: "h-4 w-4" }), i ? "Muted" : "Mute this kind"]
|
|
274
297
|
})
|
|
275
298
|
]
|
|
276
|
-
}) : /* @__PURE__ */
|
|
299
|
+
}) : /* @__PURE__ */ U("div", {
|
|
277
300
|
className: "flex flex-col gap-2 pt-1",
|
|
278
|
-
children: [/* @__PURE__ */
|
|
301
|
+
children: [/* @__PURE__ */ U("div", {
|
|
279
302
|
className: "flex items-center justify-between gap-2",
|
|
280
|
-
children: [/* @__PURE__ */
|
|
281
|
-
variant:
|
|
282
|
-
label:
|
|
283
|
-
}), /* @__PURE__ */
|
|
303
|
+
children: [/* @__PURE__ */ H(m, {
|
|
304
|
+
variant: d.variant,
|
|
305
|
+
label: d.label
|
|
306
|
+
}), /* @__PURE__ */ H("span", {
|
|
284
307
|
className: "text-xs text-text-secondary",
|
|
285
|
-
children:
|
|
308
|
+
children: J(e.createdAt)
|
|
286
309
|
})]
|
|
287
|
-
}), e.state ===
|
|
310
|
+
}), e.state === K.Dismissed && e.dismissReason && /* @__PURE__ */ U("p", {
|
|
288
311
|
className: "text-xs text-text-secondary",
|
|
289
312
|
children: ["Reason given: ", e.dismissReason]
|
|
290
313
|
})]
|
|
@@ -292,104 +315,104 @@ function ve({ rec: e, busy: n, muted: r, onAccept: i, onSnooze: a, onDismiss: o,
|
|
|
292
315
|
]
|
|
293
316
|
});
|
|
294
317
|
}
|
|
295
|
-
function
|
|
296
|
-
if (
|
|
318
|
+
function Se({ prefs: e, loading: t, saving: r, onToggleOutputGuard: a, onQuietHoursChange: o, onUnmuteKind: s }) {
|
|
319
|
+
if (t) return /* @__PURE__ */ H(i, {
|
|
297
320
|
variant: "card",
|
|
298
321
|
count: 1
|
|
299
322
|
});
|
|
300
323
|
if (!e) return null;
|
|
301
|
-
let c =
|
|
302
|
-
return /* @__PURE__ */
|
|
324
|
+
let c = S(e.quietHoursStart), l = S(e.quietHoursEnd), u = c !== null && l !== null, d = "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";
|
|
325
|
+
return /* @__PURE__ */ U(W, {
|
|
303
326
|
treatment: "glass",
|
|
304
327
|
className: "p-4 sm:p-5",
|
|
305
328
|
children: [
|
|
306
|
-
/* @__PURE__ */
|
|
329
|
+
/* @__PURE__ */ U("div", {
|
|
307
330
|
className: "flex items-center gap-2",
|
|
308
|
-
children: [/* @__PURE__ */
|
|
331
|
+
children: [/* @__PURE__ */ H(L, { className: "h-4 w-4 text-text-secondary" }), /* @__PURE__ */ H("h3", {
|
|
309
332
|
className: "text-sm font-semibold text-text-primary",
|
|
310
333
|
children: "Guardrails"
|
|
311
334
|
})]
|
|
312
335
|
}),
|
|
313
|
-
/* @__PURE__ */
|
|
336
|
+
/* @__PURE__ */ H("p", {
|
|
314
337
|
className: "mt-1 text-xs text-text-secondary",
|
|
315
338
|
children: "What TimeCampus is allowed to suggest, and when."
|
|
316
339
|
}),
|
|
317
|
-
/* @__PURE__ */
|
|
340
|
+
/* @__PURE__ */ U("div", {
|
|
318
341
|
className: "mt-4 space-y-4",
|
|
319
342
|
children: [
|
|
320
|
-
/* @__PURE__ */
|
|
343
|
+
/* @__PURE__ */ U("div", {
|
|
321
344
|
className: "flex items-start justify-between gap-3",
|
|
322
|
-
children: [/* @__PURE__ */
|
|
345
|
+
children: [/* @__PURE__ */ U("div", {
|
|
323
346
|
className: "min-w-0",
|
|
324
|
-
children: [/* @__PURE__ */
|
|
347
|
+
children: [/* @__PURE__ */ H("p", {
|
|
325
348
|
className: "text-sm font-medium text-text-primary",
|
|
326
349
|
children: "Never suggest more work"
|
|
327
|
-
}), /* @__PURE__ */
|
|
350
|
+
}), /* @__PURE__ */ H("p", {
|
|
328
351
|
className: "mt-0.5 text-xs text-text-secondary",
|
|
329
352
|
children: "Output-increasing suggestions are filtered out before they reach you."
|
|
330
353
|
})]
|
|
331
|
-
}), /* @__PURE__ */
|
|
354
|
+
}), /* @__PURE__ */ H(be, {
|
|
332
355
|
checked: e.neverOptimiseForOutput,
|
|
333
|
-
disabled:
|
|
356
|
+
disabled: r,
|
|
334
357
|
label: "Never suggest more work",
|
|
335
358
|
onChange: a
|
|
336
359
|
})]
|
|
337
360
|
}),
|
|
338
|
-
/* @__PURE__ */
|
|
361
|
+
/* @__PURE__ */ U("div", {
|
|
339
362
|
className: "border-t border-border-seam pt-4",
|
|
340
363
|
children: [
|
|
341
|
-
/* @__PURE__ */
|
|
364
|
+
/* @__PURE__ */ U("div", {
|
|
342
365
|
className: "flex items-center justify-between gap-3",
|
|
343
|
-
children: [/* @__PURE__ */
|
|
366
|
+
children: [/* @__PURE__ */ H("p", {
|
|
344
367
|
className: "text-sm font-medium text-text-primary",
|
|
345
368
|
children: "Quiet hours"
|
|
346
|
-
}), /* @__PURE__ */
|
|
369
|
+
}), /* @__PURE__ */ H("span", {
|
|
347
370
|
className: "text-xs text-text-secondary",
|
|
348
371
|
children: u ? `${c}–${l}` : "Not set"
|
|
349
372
|
})]
|
|
350
373
|
}),
|
|
351
|
-
/* @__PURE__ */
|
|
374
|
+
/* @__PURE__ */ H("p", {
|
|
352
375
|
className: "mt-0.5 text-xs text-text-secondary",
|
|
353
376
|
children: "No nudges are sent inside this window."
|
|
354
377
|
}),
|
|
355
|
-
/* @__PURE__ */
|
|
378
|
+
/* @__PURE__ */ U("div", {
|
|
356
379
|
className: "mt-2 flex flex-wrap items-center gap-2",
|
|
357
380
|
children: [
|
|
358
|
-
/* @__PURE__ */
|
|
381
|
+
/* @__PURE__ */ U("label", {
|
|
359
382
|
className: "flex items-center gap-1.5 text-xs text-text-secondary",
|
|
360
|
-
children: ["From", /* @__PURE__ */
|
|
383
|
+
children: ["From", /* @__PURE__ */ U("select", {
|
|
361
384
|
className: d,
|
|
362
|
-
disabled:
|
|
385
|
+
disabled: r,
|
|
363
386
|
value: e.quietHoursStart ?? "",
|
|
364
387
|
onChange: (t) => o(t.target.value === "" ? null : Number(t.target.value), e.quietHoursEnd ?? null),
|
|
365
|
-
children: [/* @__PURE__ */
|
|
388
|
+
children: [/* @__PURE__ */ H("option", {
|
|
366
389
|
value: "",
|
|
367
390
|
children: "—"
|
|
368
|
-
}),
|
|
391
|
+
}), Y.map((e) => /* @__PURE__ */ H("option", {
|
|
369
392
|
value: e,
|
|
370
|
-
children:
|
|
393
|
+
children: S(e)
|
|
371
394
|
}, e))]
|
|
372
395
|
})]
|
|
373
396
|
}),
|
|
374
|
-
/* @__PURE__ */
|
|
397
|
+
/* @__PURE__ */ U("label", {
|
|
375
398
|
className: "flex items-center gap-1.5 text-xs text-text-secondary",
|
|
376
|
-
children: ["To", /* @__PURE__ */
|
|
399
|
+
children: ["To", /* @__PURE__ */ U("select", {
|
|
377
400
|
className: d,
|
|
378
|
-
disabled:
|
|
401
|
+
disabled: r,
|
|
379
402
|
value: e.quietHoursEnd ?? "",
|
|
380
403
|
onChange: (t) => o(e.quietHoursStart ?? null, t.target.value === "" ? null : Number(t.target.value)),
|
|
381
|
-
children: [/* @__PURE__ */
|
|
404
|
+
children: [/* @__PURE__ */ H("option", {
|
|
382
405
|
value: "",
|
|
383
406
|
children: "—"
|
|
384
|
-
}),
|
|
407
|
+
}), Y.map((e) => /* @__PURE__ */ H("option", {
|
|
385
408
|
value: e,
|
|
386
|
-
children:
|
|
409
|
+
children: S(e)
|
|
387
410
|
}, e))]
|
|
388
411
|
})]
|
|
389
412
|
}),
|
|
390
|
-
u && /* @__PURE__ */
|
|
413
|
+
u && /* @__PURE__ */ H("button", {
|
|
391
414
|
type: "button",
|
|
392
|
-
disabled:
|
|
415
|
+
disabled: r,
|
|
393
416
|
onClick: () => o(null, null),
|
|
394
417
|
className: "text-xs font-medium text-text-secondary underline-offset-2 hover:text-text-primary hover:underline disabled:opacity-50",
|
|
395
418
|
children: "Clear"
|
|
@@ -398,51 +421,51 @@ function ye({ prefs: e, loading: n, saving: i, onToggleOutputGuard: a, onQuietHo
|
|
|
398
421
|
})
|
|
399
422
|
]
|
|
400
423
|
}),
|
|
401
|
-
/* @__PURE__ */
|
|
424
|
+
/* @__PURE__ */ U("div", {
|
|
402
425
|
className: "border-t border-border-seam pt-4",
|
|
403
|
-
children: [/* @__PURE__ */
|
|
426
|
+
children: [/* @__PURE__ */ U("div", {
|
|
404
427
|
className: "flex items-center justify-between gap-3",
|
|
405
|
-
children: [/* @__PURE__ */
|
|
428
|
+
children: [/* @__PURE__ */ H("p", {
|
|
406
429
|
className: "text-sm font-medium text-text-primary",
|
|
407
430
|
children: "Muted kinds"
|
|
408
|
-
}), /* @__PURE__ */
|
|
409
|
-
className:
|
|
431
|
+
}), /* @__PURE__ */ H("span", {
|
|
432
|
+
className: Z,
|
|
410
433
|
children: e.mutedKinds.length
|
|
411
434
|
})]
|
|
412
|
-
}), e.mutedKinds.length === 0 ? /* @__PURE__ */
|
|
435
|
+
}), e.mutedKinds.length === 0 ? /* @__PURE__ */ H("p", {
|
|
413
436
|
className: "mt-0.5 text-xs text-text-secondary",
|
|
414
437
|
children: "Nothing muted — mute a kind from any suggestion to stop it coming back."
|
|
415
|
-
}) : /* @__PURE__ */
|
|
438
|
+
}) : /* @__PURE__ */ H("div", {
|
|
416
439
|
className: "mt-2 flex flex-wrap gap-1.5",
|
|
417
|
-
children: e.mutedKinds.map((e) => /* @__PURE__ */
|
|
440
|
+
children: e.mutedKinds.map((e) => /* @__PURE__ */ U("button", {
|
|
418
441
|
type: "button",
|
|
419
|
-
disabled:
|
|
442
|
+
disabled: r,
|
|
420
443
|
onClick: () => s(e),
|
|
421
|
-
className:
|
|
422
|
-
title: `Unmute ${
|
|
423
|
-
children: [
|
|
444
|
+
className: n(Z, "hover:text-text-primary disabled:opacity-50"),
|
|
445
|
+
title: `Unmute ${C(e)} suggestions`,
|
|
446
|
+
children: [C(e), /* @__PURE__ */ H(V, { className: "h-3 w-3" })]
|
|
424
447
|
}, e))
|
|
425
448
|
})]
|
|
426
449
|
}),
|
|
427
|
-
/* @__PURE__ */
|
|
450
|
+
/* @__PURE__ */ U("div", {
|
|
428
451
|
className: "border-t border-border-seam pt-4",
|
|
429
|
-
children: [/* @__PURE__ */
|
|
452
|
+
children: [/* @__PURE__ */ U("div", {
|
|
430
453
|
className: "flex items-center justify-between gap-3",
|
|
431
|
-
children: [/* @__PURE__ */
|
|
454
|
+
children: [/* @__PURE__ */ H("p", {
|
|
432
455
|
className: "text-sm font-medium text-text-primary",
|
|
433
456
|
children: "Cadence"
|
|
434
|
-
}), /* @__PURE__ */
|
|
457
|
+
}), /* @__PURE__ */ H("span", {
|
|
435
458
|
className: "text-xs text-text-secondary",
|
|
436
|
-
children:
|
|
459
|
+
children: C(e.cadence)
|
|
437
460
|
})]
|
|
438
|
-
}), e.optedInDomains.length > 0 && /* @__PURE__ */
|
|
461
|
+
}), e.optedInDomains.length > 0 && /* @__PURE__ */ U(de, { children: [/* @__PURE__ */ H("p", {
|
|
439
462
|
className: "mt-3 text-sm font-medium text-text-primary",
|
|
440
463
|
children: "Opted-in domains"
|
|
441
|
-
}), /* @__PURE__ */
|
|
464
|
+
}), /* @__PURE__ */ H("div", {
|
|
442
465
|
className: "mt-1.5 flex flex-wrap gap-1.5",
|
|
443
|
-
children: e.optedInDomains.map((e) => /* @__PURE__ */
|
|
444
|
-
className:
|
|
445
|
-
children:
|
|
466
|
+
children: e.optedInDomains.map((e) => /* @__PURE__ */ H("span", {
|
|
467
|
+
className: Z,
|
|
468
|
+
children: y(e)
|
|
446
469
|
}, e))
|
|
447
470
|
})] })]
|
|
448
471
|
})
|
|
@@ -451,17 +474,17 @@ function ye({ prefs: e, loading: n, saving: i, onToggleOutputGuard: a, onQuietHo
|
|
|
451
474
|
]
|
|
452
475
|
});
|
|
453
476
|
}
|
|
454
|
-
function
|
|
477
|
+
function Ce(e) {
|
|
455
478
|
switch (e) {
|
|
456
|
-
case
|
|
479
|
+
case K.Snoozed: return {
|
|
457
480
|
title: "Nothing snoozed",
|
|
458
481
|
description: "Suggestions you snooze for later will wait here quietly until they're worth another look."
|
|
459
482
|
};
|
|
460
|
-
case
|
|
483
|
+
case K.Accepted: return {
|
|
461
484
|
title: "Nothing accepted yet",
|
|
462
485
|
description: "When you accept a suggestion it moves here, so you can see the changes you chose to make."
|
|
463
486
|
};
|
|
464
|
-
case
|
|
487
|
+
case K.Dismissed: return {
|
|
465
488
|
title: "Nothing dismissed",
|
|
466
489
|
description: "Suggestions you dismiss are kept here — TimeCampus learns from them and won't keep nagging."
|
|
467
490
|
};
|
|
@@ -471,80 +494,80 @@ function be(e) {
|
|
|
471
494
|
};
|
|
472
495
|
}
|
|
473
496
|
}
|
|
474
|
-
function
|
|
475
|
-
let { workspaceId: t } = e(), { toasts:
|
|
497
|
+
function we() {
|
|
498
|
+
let { workspaceId: t } = e(), { toasts: n, addToast: m, dismissToast: v } = _(), [y, b] = D(K.New), [x, S] = D(null), [w, T] = D(null), [O, k] = D(""), { data: A, loading: ee, error: te, refetch: j } = u({
|
|
476
499
|
variables: { state: null },
|
|
477
500
|
skip: !t
|
|
478
|
-
}), { data:
|
|
501
|
+
}), { data: re, loading: ie, refetch: ae } = l({ skip: !t }), [oe, { loading: N }] = c(), [se] = o(), [ce] = s(), [le] = d(), [ue, { loading: P }] = f(), F = re?.myRecommendationPreferences, I = E(() => new Set(F?.mutedKinds ?? []), [F?.mutedKinds]), z = E(() => A?.myRecommendations ?? [], [A?.myRecommendations]), B = E(() => {
|
|
479
502
|
let e = {};
|
|
480
|
-
for (let t of
|
|
503
|
+
for (let t of z) e[t.state] = (e[t.state] ?? 0) + 1;
|
|
481
504
|
return e;
|
|
482
|
-
}, [
|
|
505
|
+
}, [z]), G = E(() => z.filter((e) => e.state === y), [z, y]), pe = B[K.New] ?? 0, he = B[K.Accepted] ?? 0, q = B[K.Snoozed] ?? 0, J = async () => {
|
|
483
506
|
try {
|
|
484
|
-
let e = (await
|
|
485
|
-
|
|
507
|
+
let e = (await oe()).data?.generateMyRecommendations ?? [];
|
|
508
|
+
m({
|
|
486
509
|
title: e.length > 0 ? `${e.length} suggestion${e.length === 1 ? "" : "s"} ready` : "No new suggestions",
|
|
487
510
|
description: e.length > 0 ? "Fresh, values-aware ideas are in your New feed." : "You're all caught up — nothing new to suggest right now.",
|
|
488
511
|
variant: e.length > 0 ? "success" : "info"
|
|
489
|
-
}),
|
|
512
|
+
}), b(K.New), await j();
|
|
490
513
|
} catch {
|
|
491
|
-
|
|
514
|
+
m({
|
|
492
515
|
title: "Couldn't generate recommendations",
|
|
493
516
|
description: "Please try again in a moment.",
|
|
494
517
|
variant: "error"
|
|
495
518
|
});
|
|
496
519
|
}
|
|
497
|
-
},
|
|
520
|
+
}, Y = async (e) => {
|
|
498
521
|
S(e);
|
|
499
522
|
try {
|
|
500
|
-
await
|
|
523
|
+
await se({ variables: { id: e } }), m({
|
|
501
524
|
title: "Accepted — nice",
|
|
502
525
|
variant: "success"
|
|
503
526
|
}), await j();
|
|
504
527
|
} catch {
|
|
505
|
-
|
|
528
|
+
m({
|
|
506
529
|
title: "Couldn't accept that one",
|
|
507
530
|
variant: "error"
|
|
508
531
|
});
|
|
509
532
|
} finally {
|
|
510
533
|
S(null);
|
|
511
534
|
}
|
|
512
|
-
},
|
|
535
|
+
}, ge = async (e) => {
|
|
513
536
|
S(e);
|
|
514
537
|
try {
|
|
515
538
|
await le({ variables: {
|
|
516
539
|
id: e,
|
|
517
|
-
until:
|
|
518
|
-
} }),
|
|
540
|
+
until: me()
|
|
541
|
+
} }), m({
|
|
519
542
|
title: "Snoozed for a week",
|
|
520
543
|
description: "It'll resurface later — no nagging in between.",
|
|
521
544
|
variant: "info"
|
|
522
545
|
}), await j();
|
|
523
546
|
} catch {
|
|
524
|
-
|
|
547
|
+
m({
|
|
525
548
|
title: "Couldn't snooze that one",
|
|
526
549
|
variant: "error"
|
|
527
550
|
});
|
|
528
551
|
} finally {
|
|
529
552
|
S(null);
|
|
530
553
|
}
|
|
531
|
-
},
|
|
532
|
-
|
|
533
|
-
},
|
|
534
|
-
let e =
|
|
554
|
+
}, _e = (e) => {
|
|
555
|
+
k(""), T(e);
|
|
556
|
+
}, ve = async () => {
|
|
557
|
+
let e = w;
|
|
535
558
|
if (!e) return;
|
|
536
|
-
let t =
|
|
559
|
+
let t = O.trim();
|
|
537
560
|
S(e.id);
|
|
538
561
|
try {
|
|
539
|
-
await
|
|
562
|
+
await ce({ variables: {
|
|
540
563
|
id: e.id,
|
|
541
564
|
reason: t.length > 0 ? t : null
|
|
542
|
-
} }),
|
|
565
|
+
} }), m({
|
|
543
566
|
title: "Dismissed",
|
|
544
567
|
variant: "success"
|
|
545
|
-
}),
|
|
568
|
+
}), T(null), k(""), await j();
|
|
546
569
|
} catch {
|
|
547
|
-
|
|
570
|
+
m({
|
|
548
571
|
title: "Couldn't dismiss that one",
|
|
549
572
|
variant: "error"
|
|
550
573
|
});
|
|
@@ -553,126 +576,126 @@ function xe() {
|
|
|
553
576
|
}
|
|
554
577
|
}, Z = async (e, t) => {
|
|
555
578
|
try {
|
|
556
|
-
await ue({ variables: { input: e } }),
|
|
579
|
+
await ue({ variables: { input: e } }), m({
|
|
557
580
|
title: t,
|
|
558
581
|
variant: "success"
|
|
559
|
-
}), await
|
|
582
|
+
}), await ae();
|
|
560
583
|
} catch {
|
|
561
|
-
|
|
584
|
+
m({
|
|
562
585
|
title: "Couldn't save that guardrail",
|
|
563
586
|
description: "Please try again in a moment.",
|
|
564
587
|
variant: "error"
|
|
565
588
|
});
|
|
566
589
|
}
|
|
567
|
-
},
|
|
590
|
+
}, be = (e) => void Z({ neverOptimiseForOutput: e }, e ? "Output-increasing suggestions are off" : "Output-increasing suggestions allowed"), we = (e, t) => void Z({
|
|
568
591
|
quietHoursStart: e,
|
|
569
592
|
quietHoursEnd: t
|
|
570
593
|
}, e === null && t === null ? "Quiet hours cleared" : "Quiet hours saved"), Te = (e) => {
|
|
571
|
-
|
|
572
|
-
}, Ee = /* @__PURE__ */
|
|
573
|
-
prefs:
|
|
574
|
-
loading:
|
|
575
|
-
saving:
|
|
576
|
-
onToggleOutputGuard:
|
|
594
|
+
I.has(e) || Z({ mutedKinds: [...I, e] }, `${C(e)} suggestions muted`);
|
|
595
|
+
}, Ee = /* @__PURE__ */ H(Se, {
|
|
596
|
+
prefs: F,
|
|
597
|
+
loading: ie,
|
|
598
|
+
saving: P,
|
|
599
|
+
onToggleOutputGuard: be,
|
|
577
600
|
onQuietHoursChange: we,
|
|
578
|
-
onUnmuteKind: (e) => void Z({ mutedKinds: [...
|
|
579
|
-
}), Q = /* @__PURE__ */
|
|
601
|
+
onUnmuteKind: (e) => void Z({ mutedKinds: [...I].filter((t) => t !== e) }, `${C(e)} suggestions unmuted`)
|
|
602
|
+
}), Q = /* @__PURE__ */ U("button", {
|
|
580
603
|
type: "button",
|
|
581
|
-
onClick:
|
|
582
|
-
disabled:
|
|
583
|
-
className:
|
|
584
|
-
children: [/* @__PURE__ */
|
|
585
|
-
}), $ = "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.", De = /* @__PURE__ */
|
|
604
|
+
onClick: J,
|
|
605
|
+
disabled: N || !t,
|
|
606
|
+
className: ye,
|
|
607
|
+
children: [/* @__PURE__ */ H(R, { className: "h-4 w-4" }), N ? "Generating…" : "Generate recommendations"]
|
|
608
|
+
}), $ = "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.", De = /* @__PURE__ */ H(W, {
|
|
586
609
|
treatment: "insight",
|
|
587
610
|
className: "mt-6 p-4 sm:p-5",
|
|
588
|
-
children: /* @__PURE__ */
|
|
611
|
+
children: /* @__PURE__ */ U("div", {
|
|
589
612
|
className: "flex items-start gap-3",
|
|
590
|
-
children: [/* @__PURE__ */
|
|
613
|
+
children: [/* @__PURE__ */ H("span", {
|
|
591
614
|
className: "flex h-9 w-9 shrink-0 items-center justify-center rounded-lg bg-status-info-bg text-status-info-text",
|
|
592
|
-
children: /* @__PURE__ */
|
|
593
|
-
}), /* @__PURE__ */
|
|
615
|
+
children: /* @__PURE__ */ H(L, { className: "h-5 w-5" })
|
|
616
|
+
}), /* @__PURE__ */ U("div", {
|
|
594
617
|
className: "min-w-0",
|
|
595
|
-
children: [/* @__PURE__ */
|
|
618
|
+
children: [/* @__PURE__ */ H("h3", {
|
|
596
619
|
className: "text-sm font-semibold text-text-primary",
|
|
597
620
|
children: "Never optimises for more output."
|
|
598
|
-
}), /* @__PURE__ */
|
|
621
|
+
}), /* @__PURE__ */ H("p", {
|
|
599
622
|
className: "mt-1 text-sm text-text-secondary",
|
|
600
623
|
children: "Every suggestion protects something you value — rest, focus, relationships — not your throughput. Snooze or dismiss freely; TimeCampus takes the hint and won't keep nagging."
|
|
601
624
|
})]
|
|
602
625
|
})]
|
|
603
626
|
})
|
|
604
627
|
});
|
|
605
|
-
if (!t ||
|
|
628
|
+
if (!t || ee) return /* @__PURE__ */ H(p, {
|
|
606
629
|
title: "Recommendations",
|
|
607
630
|
description: "Values-aware suggestions from your real timeline",
|
|
608
631
|
purpose: $,
|
|
609
632
|
actions: Q,
|
|
610
|
-
children: /* @__PURE__ */
|
|
633
|
+
children: /* @__PURE__ */ H(i, {
|
|
611
634
|
variant: "list",
|
|
612
635
|
count: 4
|
|
613
636
|
})
|
|
614
637
|
});
|
|
615
|
-
if (
|
|
638
|
+
if (te) return /* @__PURE__ */ H(p, {
|
|
616
639
|
title: "Recommendations",
|
|
617
640
|
description: "Values-aware suggestions from your real timeline",
|
|
618
641
|
purpose: $,
|
|
619
642
|
actions: Q,
|
|
620
|
-
children: /* @__PURE__ */
|
|
643
|
+
children: /* @__PURE__ */ H("div", {
|
|
621
644
|
className: "rounded-xl border border-status-error-border/50 bg-status-error-bg/10 p-4 text-sm text-status-error-text",
|
|
622
645
|
children: "Couldn't load your recommendations right now. Please try again in a moment."
|
|
623
646
|
})
|
|
624
647
|
});
|
|
625
|
-
let Oe =
|
|
626
|
-
return /* @__PURE__ */
|
|
648
|
+
let Oe = z.length > 0, ke = Ce(y);
|
|
649
|
+
return /* @__PURE__ */ U(p, {
|
|
627
650
|
title: "Recommendations",
|
|
628
651
|
description: "Values-aware suggestions from your real timeline",
|
|
629
652
|
purpose: $,
|
|
630
653
|
actions: Q,
|
|
631
654
|
children: [
|
|
632
|
-
Oe ? /* @__PURE__ */
|
|
655
|
+
Oe ? /* @__PURE__ */ U("div", {
|
|
633
656
|
className: "grid grid-cols-1 gap-6 lg:grid-cols-[minmax(0,1fr)_20rem]",
|
|
634
|
-
children: [/* @__PURE__ */
|
|
657
|
+
children: [/* @__PURE__ */ U("div", {
|
|
635
658
|
className: "min-w-0 space-y-6",
|
|
636
659
|
children: [
|
|
637
|
-
/* @__PURE__ */
|
|
660
|
+
/* @__PURE__ */ U("div", {
|
|
638
661
|
className: "grid grid-cols-1 gap-4 sm:grid-cols-3",
|
|
639
662
|
children: [
|
|
640
|
-
/* @__PURE__ */
|
|
663
|
+
/* @__PURE__ */ H(r, {
|
|
641
664
|
featured: !0,
|
|
642
665
|
title: "New for you",
|
|
643
|
-
value: String(
|
|
644
|
-
icon: /* @__PURE__ */
|
|
666
|
+
value: String(pe),
|
|
667
|
+
icon: /* @__PURE__ */ H(R, { className: "h-5 w-5" }),
|
|
645
668
|
description: "Awaiting your call"
|
|
646
669
|
}),
|
|
647
|
-
/* @__PURE__ */
|
|
670
|
+
/* @__PURE__ */ H(r, {
|
|
648
671
|
title: "Accepted",
|
|
649
|
-
value: String(
|
|
650
|
-
icon: /* @__PURE__ */
|
|
672
|
+
value: String(he),
|
|
673
|
+
icon: /* @__PURE__ */ H(ne, { className: "h-5 w-5" }),
|
|
651
674
|
description: "Changes you chose to make"
|
|
652
675
|
}),
|
|
653
|
-
/* @__PURE__ */
|
|
676
|
+
/* @__PURE__ */ H(r, {
|
|
654
677
|
title: "Snoozed",
|
|
655
|
-
value: String(
|
|
656
|
-
icon: /* @__PURE__ */
|
|
678
|
+
value: String(q),
|
|
679
|
+
icon: /* @__PURE__ */ H(M, { className: "h-5 w-5" }),
|
|
657
680
|
description: "Waiting for a better moment"
|
|
658
681
|
})
|
|
659
682
|
]
|
|
660
683
|
}),
|
|
661
|
-
/* @__PURE__ */
|
|
684
|
+
/* @__PURE__ */ H("div", {
|
|
662
685
|
className: "overflow-x-auto",
|
|
663
|
-
children: /* @__PURE__ */
|
|
686
|
+
children: /* @__PURE__ */ H("div", {
|
|
664
687
|
className: "inline-flex items-center rounded-lg border border-border-subtle bg-bg-sunken/50 p-0.5",
|
|
665
688
|
role: "tablist",
|
|
666
689
|
"aria-label": "Filter recommendations by state",
|
|
667
690
|
children: fe.map((e) => {
|
|
668
|
-
let t = e.key ===
|
|
669
|
-
return /* @__PURE__ */
|
|
691
|
+
let t = e.key === y, n = B[e.key] ?? 0;
|
|
692
|
+
return /* @__PURE__ */ U("button", {
|
|
670
693
|
type: "button",
|
|
671
694
|
role: "tab",
|
|
672
695
|
"aria-selected": t,
|
|
673
|
-
onClick: () =>
|
|
696
|
+
onClick: () => b(e.key),
|
|
674
697
|
className: t ? "flex items-center gap-1.5 rounded-md bg-bg-surface px-3 py-1.5 text-sm font-medium text-text-primary shadow-sm" : "flex items-center gap-1.5 rounded-md px-3 py-1.5 text-sm font-medium text-text-secondary transition-colors hover:text-text-primary",
|
|
675
|
-
children: [e.label, /* @__PURE__ */
|
|
698
|
+
children: [e.label, /* @__PURE__ */ H("span", {
|
|
676
699
|
className: t ? "rounded-full bg-action-primary-bg/15 px-1.5 text-xs font-semibold text-primary" : "rounded-full bg-bg-sunken px-1.5 text-xs font-semibold text-text-secondary",
|
|
677
700
|
children: n
|
|
678
701
|
})]
|
|
@@ -680,88 +703,88 @@ function xe() {
|
|
|
680
703
|
})
|
|
681
704
|
})
|
|
682
705
|
}),
|
|
683
|
-
|
|
706
|
+
G.length === 0 ? /* @__PURE__ */ H(a, {
|
|
684
707
|
illustration: "empty-data",
|
|
685
708
|
title: ke.title,
|
|
686
709
|
description: ke.description,
|
|
687
|
-
action:
|
|
688
|
-
}) : /* @__PURE__ */
|
|
710
|
+
action: y === K.New ? Q : void 0
|
|
711
|
+
}) : /* @__PURE__ */ H("div", {
|
|
689
712
|
className: "space-y-4",
|
|
690
|
-
children:
|
|
713
|
+
children: G.map((e) => /* @__PURE__ */ H(xe, {
|
|
691
714
|
rec: e,
|
|
692
|
-
busy: x === e.id ||
|
|
693
|
-
muted:
|
|
694
|
-
onAccept:
|
|
695
|
-
onSnooze:
|
|
696
|
-
onDismiss:
|
|
715
|
+
busy: x === e.id || P,
|
|
716
|
+
muted: I.has(e.kind),
|
|
717
|
+
onAccept: Y,
|
|
718
|
+
onSnooze: ge,
|
|
719
|
+
onDismiss: _e,
|
|
697
720
|
onMuteKind: Te
|
|
698
721
|
}, e.id))
|
|
699
722
|
}),
|
|
700
723
|
De
|
|
701
724
|
]
|
|
702
|
-
}), /* @__PURE__ */
|
|
703
|
-
}) : /* @__PURE__ */
|
|
725
|
+
}), /* @__PURE__ */ H("div", { children: Ee })]
|
|
726
|
+
}) : /* @__PURE__ */ U("div", {
|
|
704
727
|
className: "grid grid-cols-1 gap-6 lg:grid-cols-[minmax(0,1fr)_20rem]",
|
|
705
|
-
children: [/* @__PURE__ */
|
|
728
|
+
children: [/* @__PURE__ */ U("div", { children: [/* @__PURE__ */ H(a, {
|
|
706
729
|
illustration: "empty-data",
|
|
707
730
|
title: "No recommendations yet",
|
|
708
731
|
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.",
|
|
709
732
|
action: Q
|
|
710
|
-
}), De] }), /* @__PURE__ */
|
|
733
|
+
}), De] }), /* @__PURE__ */ H("div", { children: Ee })]
|
|
711
734
|
}),
|
|
712
|
-
/* @__PURE__ */
|
|
713
|
-
open:
|
|
714
|
-
onClose: () =>
|
|
735
|
+
/* @__PURE__ */ U(h, {
|
|
736
|
+
open: w !== null,
|
|
737
|
+
onClose: () => T(null),
|
|
715
738
|
title: "Dismiss this suggestion",
|
|
716
|
-
description:
|
|
739
|
+
description: w?.title,
|
|
717
740
|
size: "sm",
|
|
718
|
-
footer: /* @__PURE__ */
|
|
741
|
+
footer: /* @__PURE__ */ U(de, { children: [/* @__PURE__ */ H("button", {
|
|
719
742
|
type: "button",
|
|
720
|
-
onClick: () =>
|
|
721
|
-
className:
|
|
743
|
+
onClick: () => T(null),
|
|
744
|
+
className: X,
|
|
722
745
|
children: "Cancel"
|
|
723
|
-
}), /* @__PURE__ */
|
|
746
|
+
}), /* @__PURE__ */ U("button", {
|
|
724
747
|
type: "button",
|
|
725
|
-
onClick: () => void
|
|
748
|
+
onClick: () => void ve(),
|
|
726
749
|
disabled: x !== null,
|
|
727
|
-
className:
|
|
728
|
-
children: [/* @__PURE__ */
|
|
750
|
+
className: ye,
|
|
751
|
+
children: [/* @__PURE__ */ H(V, { className: "h-4 w-4" }), "Dismiss"]
|
|
729
752
|
})] }),
|
|
730
753
|
children: [
|
|
731
|
-
/* @__PURE__ */
|
|
754
|
+
/* @__PURE__ */ U("label", {
|
|
732
755
|
htmlFor: "rec-dismiss-reason",
|
|
733
756
|
className: "block text-sm font-medium text-text-primary",
|
|
734
757
|
children: [
|
|
735
758
|
"Why isn't this one for you?",
|
|
736
759
|
" ",
|
|
737
|
-
/* @__PURE__ */
|
|
760
|
+
/* @__PURE__ */ H("span", {
|
|
738
761
|
className: "font-normal text-text-secondary",
|
|
739
762
|
children: "(optional)"
|
|
740
763
|
})
|
|
741
764
|
]
|
|
742
765
|
}),
|
|
743
|
-
/* @__PURE__ */
|
|
766
|
+
/* @__PURE__ */ H("textarea", {
|
|
744
767
|
id: "rec-dismiss-reason",
|
|
745
768
|
rows: 3,
|
|
746
|
-
value:
|
|
747
|
-
onChange: (e) =>
|
|
769
|
+
value: O,
|
|
770
|
+
onChange: (e) => k(e.target.value),
|
|
748
771
|
placeholder: "e.g. already handled, not the right week",
|
|
749
772
|
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"
|
|
750
773
|
}),
|
|
751
|
-
/* @__PURE__ */
|
|
774
|
+
/* @__PURE__ */ H("p", {
|
|
752
775
|
className: "mt-2 text-xs text-text-secondary",
|
|
753
776
|
children: "Saved with the suggestion so you can see why you passed on it later. To stop this kind of suggestion entirely, use Mute this kind."
|
|
754
777
|
})
|
|
755
778
|
]
|
|
756
779
|
}),
|
|
757
|
-
/* @__PURE__ */
|
|
758
|
-
toasts:
|
|
759
|
-
onDismiss:
|
|
780
|
+
/* @__PURE__ */ H(g, {
|
|
781
|
+
toasts: n,
|
|
782
|
+
onDismiss: v
|
|
760
783
|
})
|
|
761
784
|
]
|
|
762
785
|
});
|
|
763
786
|
}
|
|
764
787
|
//#endregion
|
|
765
|
-
export {
|
|
788
|
+
export { we as RecommendationsPage };
|
|
766
789
|
|
|
767
790
|
//# sourceMappingURL=RecommendationsPage.js.map
|