@burdenoff/microfe-timecampus 2026.1030.4 → 2026.1031.2
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/generated/wspace-operations.d.ts +611 -0
- package/dist/generated/wspace-operations.d.ts.map +1 -1
- package/dist/generated/wspace-operations.js +1502 -1191
- package/dist/generated/wspace-operations.js.map +1 -1
- package/dist/generated/wspace-types.d.ts +9 -3
- package/dist/generated/wspace-types.d.ts.map +1 -1
- package/dist/generated/wspace-types.js.map +1 -1
- package/dist/index.js +7 -7
- package/dist/timecampus/TimeCampusRoutes.d.ts.map +1 -1
- package/dist/timecampus/TimeCampusRoutes.js +38 -26
- package/dist/timecampus/TimeCampusRoutes.js.map +1 -1
- package/dist/timecampus/index.js +7 -7
- package/dist/timecampus/pages/extend/AppletStorePage.d.ts +2 -0
- package/dist/timecampus/pages/extend/AppletStorePage.d.ts.map +1 -0
- package/dist/timecampus/pages/extend/AppletStorePage.js +248 -0
- package/dist/timecampus/pages/extend/AppletStorePage.js.map +1 -0
- package/dist/timecampus/pages/extend/TemplateGalleryPage.d.ts +2 -0
- package/dist/timecampus/pages/extend/TemplateGalleryPage.d.ts.map +1 -0
- package/dist/timecampus/pages/extend/TemplateGalleryPage.js +339 -0
- package/dist/timecampus/pages/extend/TemplateGalleryPage.js.map +1 -0
- package/dist/timecampus/pages/extend/WidgetDashboardPage.d.ts +2 -0
- package/dist/timecampus/pages/extend/WidgetDashboardPage.d.ts.map +1 -0
- package/dist/timecampus/pages/extend/WidgetDashboardPage.js +434 -0
- package/dist/timecampus/pages/extend/WidgetDashboardPage.js.map +1 -0
- package/dist/timecampus/pages/extend/extendHelpers.d.ts +36 -0
- package/dist/timecampus/pages/extend/extendHelpers.d.ts.map +1 -0
- package/dist/timecampus/pages/extend/extendHelpers.js +105 -0
- package/dist/timecampus/pages/extend/extendHelpers.js.map +1 -0
- package/dist/timecampus/pages/extend/useOpenRoute.d.ts +7 -0
- package/dist/timecampus/pages/extend/useOpenRoute.d.ts.map +1 -0
- package/dist/timecampus/pages/extend/useOpenRoute.js +19 -0
- package/dist/timecampus/pages/extend/useOpenRoute.js.map +1 -0
- package/dist/timecampus/pages/timeline/TimelinePage.d.ts.map +1 -1
- package/dist/timecampus/pages/timeline/TimelinePage.js +336 -151
- package/dist/timecampus/pages/timeline/TimelinePage.js.map +1 -1
- package/dist/timecampus/pages/timeline/timelineSuggestions.d.ts +41 -0
- package/dist/timecampus/pages/timeline/timelineSuggestions.d.ts.map +1 -0
- package/dist/timecampus/pages/timeline/timelineSuggestions.js +33 -0
- package/dist/timecampus/pages/timeline/timelineSuggestions.js.map +1 -0
- package/package.json +1 -1
|
@@ -3,64 +3,66 @@ import { formatDuration as t, formatTime as n } from "../../utils/helpers.js";
|
|
|
3
3
|
import { StatCard as r } from "../../components/StatCard.js";
|
|
4
4
|
import { LoadingSkeleton as i } from "../../components/LoadingSkeleton.js";
|
|
5
5
|
import { EmptyState as a } from "../../components/EmptyState.js";
|
|
6
|
-
import {
|
|
7
|
-
import { PageLayout as
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
6
|
+
import { useAcceptTimeCampusCaptureEventSuggestionMutation as o, useGetTimeCampusTimelineQuery as s, useListProjectsQuery as c, useRecategorizeTimeCampusCaptureEventMutation as l, useRejectTimeCampusCaptureEventSuggestionMutation as u, useSetTimeCampusCaptureEventProjectMutation as d, useSuggestTimeCampusCaptureEventProjectMutation as f } from "../../../generated/wspace-operations.js";
|
|
7
|
+
import { PageLayout as ee } from "../../components/PageLayout.js";
|
|
8
|
+
import { ToastContainer as te, useToast as p } from "../../components/Toast.js";
|
|
9
|
+
import { calendarHoldLabel as m } from "../focus/focusHelpers.js";
|
|
10
|
+
import { hasAiCategorizedSegment as h, segmentProvenance as g } from "./timelineProvenance.js";
|
|
11
|
+
import { driftLabel as _, focusStatusLabel as ne, plannedDrift as v, protectedPercent as re } from "./timelineFocus.js";
|
|
12
|
+
import { pendingSuggestion as ie, pendingSuggestions as ae } from "./timelineSuggestions.js";
|
|
13
|
+
import { useMemo as y, useState as b } from "react";
|
|
14
|
+
import { Activity as x, Brain as S, Calendar as oe, CalendarClock as C, Check as w, Coffee as T, FolderOpen as se, Github as ce, GripVertical as le, MessageSquare as E, Shield as D, Sparkles as O, Users as k, X as A, Zap as j } from "lucide-react";
|
|
13
15
|
import { jsx as M, jsxs as N } from "react/jsx-runtime";
|
|
14
16
|
import { GlassCard as P } from "@burdenoff/fe-libs/ui";
|
|
15
|
-
import { DndContext as
|
|
17
|
+
import { DndContext as ue, DragOverlay as de, KeyboardSensor as fe, PointerSensor as pe, useDraggable as F, useDroppable as I, useSensor as L, useSensors as me } from "@dnd-kit/core";
|
|
16
18
|
//#region src/timecampus/pages/timeline/TimelinePage.tsx
|
|
17
|
-
var
|
|
19
|
+
var R = {
|
|
18
20
|
DEEP_WORK: {
|
|
19
21
|
label: "Deep work",
|
|
20
|
-
icon:
|
|
22
|
+
icon: S,
|
|
21
23
|
dot: "bg-status-success-bg",
|
|
22
24
|
chip: "bg-status-success-bg text-status-success-text"
|
|
23
25
|
},
|
|
24
26
|
MEETING: {
|
|
25
27
|
label: "Meeting",
|
|
26
|
-
icon:
|
|
28
|
+
icon: k,
|
|
27
29
|
dot: "bg-status-info-bg",
|
|
28
30
|
chip: "bg-status-info-bg text-status-info-text"
|
|
29
31
|
},
|
|
30
32
|
COMMUNICATION: {
|
|
31
33
|
label: "Communication",
|
|
32
|
-
icon:
|
|
34
|
+
icon: E,
|
|
33
35
|
dot: "bg-status-warning-bg",
|
|
34
36
|
chip: "bg-status-warning-bg text-status-warning-text"
|
|
35
37
|
},
|
|
36
38
|
BREAK: {
|
|
37
39
|
label: "Break",
|
|
38
|
-
icon:
|
|
40
|
+
icon: T,
|
|
39
41
|
dot: "bg-bg-sunken",
|
|
40
42
|
chip: "bg-bg-sunken text-text-secondary"
|
|
41
43
|
},
|
|
42
44
|
OTHER: {
|
|
43
45
|
label: "Other",
|
|
44
|
-
icon:
|
|
46
|
+
icon: x,
|
|
45
47
|
dot: "bg-bg-sunken",
|
|
46
48
|
chip: "bg-bg-sunken text-text-secondary"
|
|
47
49
|
}
|
|
48
|
-
},
|
|
50
|
+
}, z = {
|
|
49
51
|
TIME_ENTRY: j,
|
|
50
|
-
MEETING:
|
|
51
|
-
POMODORO:
|
|
52
|
-
EMAIL:
|
|
53
|
-
CAPTURE:
|
|
54
|
-
FOCUS_SESSION:
|
|
55
|
-
FOCUS_BLOCK:
|
|
52
|
+
MEETING: k,
|
|
53
|
+
POMODORO: S,
|
|
54
|
+
EMAIL: E,
|
|
55
|
+
CAPTURE: ce,
|
|
56
|
+
FOCUS_SESSION: D,
|
|
57
|
+
FOCUS_BLOCK: C
|
|
56
58
|
};
|
|
57
|
-
function
|
|
59
|
+
function he(e) {
|
|
58
60
|
return e.source === "FOCUS_SESSION" || e.source === "FOCUS_BLOCK";
|
|
59
61
|
}
|
|
60
|
-
function
|
|
62
|
+
function ge({ segment: e }) {
|
|
61
63
|
let r = e.focus;
|
|
62
64
|
if (!r) return null;
|
|
63
|
-
let i = e.isPlanned, a = i ?
|
|
65
|
+
let i = e.isPlanned, a = i ? C : D, o = ne(i, r, e.endTime), s = i ? null : re(r), c = i ? null : v(e.startTime, e.endTime, r), l = m(r.calendarHoldStatus);
|
|
64
66
|
return /* @__PURE__ */ N("li", {
|
|
65
67
|
className: `flex items-start gap-3 p-4 ${i ? "bg-bg-sunken/30" : ""}`,
|
|
66
68
|
"data-testid": i ? "timeline-focus-block" : "timeline-focus-session",
|
|
@@ -119,8 +121,8 @@ function K({ segment: e }) {
|
|
|
119
121
|
className: "text-xs text-text-tertiary",
|
|
120
122
|
children: [
|
|
121
123
|
"Started ",
|
|
122
|
-
|
|
123
|
-
c.endMinutes !== null && `, ended ${
|
|
124
|
+
_(c.startMinutes),
|
|
125
|
+
c.endMinutes !== null && `, ended ${_(c.endMinutes, "over", "short")}`
|
|
124
126
|
]
|
|
125
127
|
}),
|
|
126
128
|
l && /* @__PURE__ */ M("span", {
|
|
@@ -169,15 +171,61 @@ function K({ segment: e }) {
|
|
|
169
171
|
]
|
|
170
172
|
});
|
|
171
173
|
}
|
|
172
|
-
var
|
|
174
|
+
var B = [
|
|
173
175
|
"DEEP_WORK",
|
|
174
176
|
"MEETING",
|
|
175
177
|
"COMMUNICATION",
|
|
176
178
|
"BREAK",
|
|
177
179
|
"OTHER"
|
|
178
180
|
];
|
|
179
|
-
function
|
|
180
|
-
|
|
181
|
+
function V({ suggestion: e, busy: t, onAccept: n, onReject: r }) {
|
|
182
|
+
return /* @__PURE__ */ N("div", {
|
|
183
|
+
className: "mt-2 flex flex-wrap items-center gap-2 rounded-lg border border-dashed border-border-seam bg-bg-sunken/40 px-2.5 py-1.5",
|
|
184
|
+
"data-testid": "timeline-project-suggestion",
|
|
185
|
+
children: [
|
|
186
|
+
/* @__PURE__ */ M(O, {
|
|
187
|
+
className: "h-3.5 w-3.5 shrink-0 text-primary",
|
|
188
|
+
"aria-hidden": !0
|
|
189
|
+
}),
|
|
190
|
+
/* @__PURE__ */ N("span", {
|
|
191
|
+
className: "text-xs text-text-secondary",
|
|
192
|
+
children: [
|
|
193
|
+
"Suggested project",
|
|
194
|
+
" ",
|
|
195
|
+
/* @__PURE__ */ M("span", {
|
|
196
|
+
className: "font-medium text-text-primary",
|
|
197
|
+
children: e.projectName
|
|
198
|
+
}),
|
|
199
|
+
" ",
|
|
200
|
+
"· ",
|
|
201
|
+
e.confidencePercent,
|
|
202
|
+
"% · ",
|
|
203
|
+
e.reason
|
|
204
|
+
]
|
|
205
|
+
}),
|
|
206
|
+
/* @__PURE__ */ N("span", {
|
|
207
|
+
className: "ml-auto flex items-center gap-1",
|
|
208
|
+
children: [/* @__PURE__ */ N("button", {
|
|
209
|
+
type: "button",
|
|
210
|
+
disabled: t,
|
|
211
|
+
onClick: () => n(e),
|
|
212
|
+
"aria-label": `Accept project ${e.projectName}`,
|
|
213
|
+
className: "inline-flex items-center gap-1 rounded-md bg-action-primary-bg px-2 py-0.5 text-xs font-medium text-action-primary-text hover:bg-action-primary-bg/90 disabled:opacity-50",
|
|
214
|
+
children: [/* @__PURE__ */ M(w, { className: "h-3 w-3" }), "Accept"]
|
|
215
|
+
}), /* @__PURE__ */ N("button", {
|
|
216
|
+
type: "button",
|
|
217
|
+
disabled: t,
|
|
218
|
+
onClick: () => r(e),
|
|
219
|
+
"aria-label": `Dismiss suggested project ${e.projectName}`,
|
|
220
|
+
className: "inline-flex items-center gap-1 rounded-md border border-border-seam bg-bg-surface px-2 py-0.5 text-xs font-medium text-text-secondary hover:bg-bg-sunken disabled:opacity-50",
|
|
221
|
+
children: [/* @__PURE__ */ M(A, { className: "h-3 w-3" }), "Dismiss"]
|
|
222
|
+
})]
|
|
223
|
+
})
|
|
224
|
+
]
|
|
225
|
+
});
|
|
226
|
+
}
|
|
227
|
+
function _e({ category: e, label: n, dotClassName: r, totalSeconds: i }) {
|
|
228
|
+
let { isOver: a, setNodeRef: o } = I({ id: `category:${e}` });
|
|
181
229
|
return /* @__PURE__ */ N("div", {
|
|
182
230
|
ref: o,
|
|
183
231
|
className: `flex items-center gap-2 rounded-lg border px-3 py-2 transition-colors ${a ? "border-action-primary-bg bg-action-primary-bg/10" : "border-border-seam bg-bg-surface"}`,
|
|
@@ -201,15 +249,15 @@ function J({ category: e, label: n, dotClassName: r, totalSeconds: i }) {
|
|
|
201
249
|
]
|
|
202
250
|
});
|
|
203
251
|
}
|
|
204
|
-
function
|
|
205
|
-
let
|
|
252
|
+
function ve({ segment: e, category: r, projectName: i, suggestion: a, recategorizing: o, onRecategorize: s, projectActions: c }) {
|
|
253
|
+
let l = R[r] ?? R.OTHER, u = z[e.source] ?? x, d = g(e), f = e.source === "CAPTURE", ee = f && !e.projectId && !a && c.projects.length > 0, { attributes: te, listeners: p, setNodeRef: m, isDragging: h } = F({
|
|
206
254
|
id: e.id,
|
|
207
255
|
data: { segment: e },
|
|
208
256
|
disabled: !e.isRecategorizable
|
|
209
257
|
});
|
|
210
258
|
return /* @__PURE__ */ N("li", {
|
|
211
|
-
ref:
|
|
212
|
-
className: `flex items-start gap-3 p-4 transition-colors hover:bg-bg-sunken/50 ${
|
|
259
|
+
ref: m,
|
|
260
|
+
className: `flex items-start gap-3 p-4 transition-colors hover:bg-bg-sunken/50 ${h ? "opacity-40" : ""}`,
|
|
213
261
|
children: [
|
|
214
262
|
/* @__PURE__ */ N("div", {
|
|
215
263
|
className: "flex w-16 shrink-0 flex-col items-end pt-0.5 text-xs tabular-nums text-text-secondary",
|
|
@@ -220,131 +268,233 @@ function ee({ segment: e, category: r, projectName: i, recategorizing: a, onReca
|
|
|
220
268
|
}),
|
|
221
269
|
e.isRecategorizable && /* @__PURE__ */ M("button", {
|
|
222
270
|
type: "button",
|
|
223
|
-
"aria-label": `Drag to recategorize ${e.title ||
|
|
271
|
+
"aria-label": `Drag to recategorize ${e.title || l.label}`,
|
|
224
272
|
className: "mt-1.5 shrink-0 cursor-grab touch-none text-text-tertiary hover:text-text-secondary active:cursor-grabbing",
|
|
225
|
-
...
|
|
226
|
-
...
|
|
227
|
-
children: /* @__PURE__ */ M(
|
|
273
|
+
...te,
|
|
274
|
+
...p,
|
|
275
|
+
children: /* @__PURE__ */ M(le, { className: "h-4 w-4" })
|
|
228
276
|
}),
|
|
229
277
|
/* @__PURE__ */ M("div", {
|
|
230
|
-
className: `mt-0.5 flex h-8 w-8 shrink-0 items-center justify-center rounded-lg ${
|
|
231
|
-
children: /* @__PURE__ */ M(
|
|
278
|
+
className: `mt-0.5 flex h-8 w-8 shrink-0 items-center justify-center rounded-lg ${l.chip}`,
|
|
279
|
+
children: /* @__PURE__ */ M(u, { className: "h-4 w-4" })
|
|
232
280
|
}),
|
|
233
281
|
/* @__PURE__ */ N("div", {
|
|
234
282
|
className: "min-w-0 flex-1",
|
|
235
|
-
children: [
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
className: "
|
|
249
|
-
children:
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
283
|
+
children: [
|
|
284
|
+
/* @__PURE__ */ M("p", {
|
|
285
|
+
className: "truncate text-sm font-medium text-text-primary",
|
|
286
|
+
children: e.title || l.label
|
|
287
|
+
}),
|
|
288
|
+
/* @__PURE__ */ N("div", {
|
|
289
|
+
className: "mt-1 flex flex-wrap items-center gap-2",
|
|
290
|
+
children: [
|
|
291
|
+
/* @__PURE__ */ M("span", {
|
|
292
|
+
className: `inline-flex rounded-full px-2 py-0.5 text-xs font-medium ${l.chip}`,
|
|
293
|
+
children: l.label
|
|
294
|
+
}),
|
|
295
|
+
i !== void 0 && /* @__PURE__ */ N("span", {
|
|
296
|
+
className: "inline-flex max-w-[12rem] items-center gap-1 rounded-full bg-bg-sunken px-2 py-0.5 text-xs font-medium text-text-secondary",
|
|
297
|
+
children: [/* @__PURE__ */ M(se, { className: "h-3 w-3 shrink-0" }), /* @__PURE__ */ M("span", {
|
|
298
|
+
className: "truncate",
|
|
299
|
+
children: i
|
|
300
|
+
})]
|
|
301
|
+
}),
|
|
302
|
+
e.app && /* @__PURE__ */ M("span", {
|
|
303
|
+
className: "text-xs text-text-secondary",
|
|
304
|
+
children: e.app
|
|
305
|
+
}),
|
|
306
|
+
d && (d.isAi ? /* @__PURE__ */ N("span", {
|
|
307
|
+
className: "inline-flex items-center gap-1 rounded-full bg-bg-sunken px-2 py-0.5 text-xs font-medium text-text-secondary",
|
|
308
|
+
title: d.detail,
|
|
309
|
+
"data-testid": "timeline-ai-provenance",
|
|
310
|
+
children: [
|
|
311
|
+
/* @__PURE__ */ M(O, {
|
|
312
|
+
className: "h-3 w-3 shrink-0",
|
|
313
|
+
"aria-hidden": !0
|
|
314
|
+
}),
|
|
315
|
+
d.label,
|
|
316
|
+
/* @__PURE__ */ N("span", {
|
|
317
|
+
className: "sr-only",
|
|
318
|
+
children: [". ", d.detail]
|
|
319
|
+
})
|
|
320
|
+
]
|
|
321
|
+
}) : /* @__PURE__ */ M("span", {
|
|
322
|
+
className: "text-xs text-text-tertiary",
|
|
323
|
+
title: d.detail,
|
|
324
|
+
children: d.label
|
|
325
|
+
}))
|
|
326
|
+
]
|
|
327
|
+
}),
|
|
328
|
+
a && /* @__PURE__ */ M(V, {
|
|
329
|
+
suggestion: a,
|
|
330
|
+
busy: c.busy,
|
|
331
|
+
onAccept: c.onAccept,
|
|
332
|
+
onReject: c.onReject
|
|
333
|
+
})
|
|
334
|
+
]
|
|
278
335
|
}),
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
336
|
+
/* @__PURE__ */ N("div", {
|
|
337
|
+
className: "flex shrink-0 flex-col items-end gap-1.5",
|
|
338
|
+
children: [
|
|
339
|
+
e.isRecategorizable && /* @__PURE__ */ M("select", {
|
|
340
|
+
"aria-label": "Recategorize activity",
|
|
341
|
+
disabled: o,
|
|
342
|
+
value: r,
|
|
343
|
+
onChange: (t) => s(e, t.target.value),
|
|
344
|
+
className: "rounded-md border border-border-seam bg-bg-surface px-2 py-1 text-xs text-text-secondary focus:outline-none focus:ring-2 focus:ring-action-primary-bg/40",
|
|
345
|
+
children: B.map((e) => /* @__PURE__ */ M("option", {
|
|
346
|
+
value: e,
|
|
347
|
+
children: R[e].label
|
|
348
|
+
}, e))
|
|
349
|
+
}),
|
|
350
|
+
f && c.projects.length > 0 && /* @__PURE__ */ N("select", {
|
|
351
|
+
"aria-label": "Assign project",
|
|
352
|
+
disabled: c.busy,
|
|
353
|
+
value: e.projectId ?? "",
|
|
354
|
+
onChange: (t) => c.onSetProject(e, t.target.value || null),
|
|
355
|
+
className: "max-w-[10rem] rounded-md border border-border-seam bg-bg-surface px-2 py-1 text-xs text-text-secondary focus:outline-none focus:ring-2 focus:ring-action-primary-bg/40",
|
|
356
|
+
children: [/* @__PURE__ */ M("option", {
|
|
357
|
+
value: "",
|
|
358
|
+
children: "No project"
|
|
359
|
+
}), c.projects.map((e) => /* @__PURE__ */ M("option", {
|
|
360
|
+
value: e.id,
|
|
361
|
+
children: e.name
|
|
362
|
+
}, e.id))]
|
|
363
|
+
}),
|
|
364
|
+
ee && /* @__PURE__ */ N("button", {
|
|
365
|
+
type: "button",
|
|
366
|
+
disabled: c.busy,
|
|
367
|
+
onClick: () => c.onSuggest(e),
|
|
368
|
+
className: "inline-flex items-center gap-1 text-xs font-medium text-primary hover:underline disabled:opacity-50",
|
|
369
|
+
children: [/* @__PURE__ */ M(O, { className: "h-3 w-3" }), "Suggest project"]
|
|
370
|
+
})
|
|
371
|
+
]
|
|
289
372
|
})
|
|
290
373
|
]
|
|
291
374
|
});
|
|
292
375
|
}
|
|
293
|
-
function
|
|
376
|
+
function H(e) {
|
|
377
|
+
return e instanceof Error ? e.message : "Something went wrong";
|
|
378
|
+
}
|
|
379
|
+
function U(e) {
|
|
294
380
|
let t = e.getTimezoneOffset();
|
|
295
381
|
return (/* @__PURE__ */ new Date(e.getTime() - t * 60 * 1e3)).toISOString().slice(0, 10);
|
|
296
382
|
}
|
|
297
|
-
var
|
|
298
|
-
function
|
|
383
|
+
var ye = 14;
|
|
384
|
+
function be() {
|
|
299
385
|
let e = /* @__PURE__ */ new Date();
|
|
300
|
-
return e.setDate(e.getDate() +
|
|
386
|
+
return e.setDate(e.getDate() + ye), U(e);
|
|
301
387
|
}
|
|
302
|
-
function
|
|
388
|
+
function xe(e) {
|
|
303
389
|
let t = /* @__PURE__ */ new Date(`${e}T00:00:00`), n = /* @__PURE__ */ new Date(`${e}T23:59:59.999`);
|
|
304
390
|
return {
|
|
305
391
|
from: t.toISOString(),
|
|
306
392
|
to: n.toISOString()
|
|
307
393
|
};
|
|
308
394
|
}
|
|
309
|
-
function
|
|
310
|
-
let { workspaceId:
|
|
395
|
+
function W() {
|
|
396
|
+
let { workspaceId: m = "" } = e(), { toasts: g, addToast: _, dismissToast: ne } = p(), [v, re] = b(() => U(/* @__PURE__ */ new Date())), [C, T] = b(null), { from: se, to: ce } = y(() => xe(v), [v]), { data: E, loading: D, error: k, refetch: A } = s({
|
|
311
397
|
variables: {
|
|
312
|
-
from:
|
|
313
|
-
to:
|
|
398
|
+
from: se,
|
|
399
|
+
to: ce
|
|
314
400
|
},
|
|
315
|
-
skip: !
|
|
401
|
+
skip: !m,
|
|
316
402
|
fetchPolicy: "cache-and-network"
|
|
317
|
-
}), { data:
|
|
403
|
+
}), { data: F } = c({
|
|
318
404
|
variables: { pagination: { limit: 200 } },
|
|
319
|
-
skip: !
|
|
320
|
-
}), [
|
|
405
|
+
skip: !m
|
|
406
|
+
}), [I, { loading: z }] = l(), [V, { loading: ye }] = o(), [W, { loading: Se }] = u(), [Ce, { loading: we }] = d(), [Te, { loading: Ee }] = f(), G = ye || Se || we || Ee, De = me(L(pe, { activationConstraint: { distance: 6 } }), L(fe)), K = E?.timeCampusTimeline, q = y(() => K?.segments ?? [], [K]), J = K?.summary, Y = y(() => {
|
|
321
407
|
let e = /* @__PURE__ */ new Map();
|
|
322
|
-
for (let t of
|
|
408
|
+
for (let t of F?.projects?.items ?? []) e.set(t.id, t.name);
|
|
323
409
|
return e;
|
|
324
|
-
}, [
|
|
410
|
+
}, [F?.projects?.items]), Oe = y(() => Array.from(Y, ([e, t]) => ({
|
|
411
|
+
id: e,
|
|
412
|
+
name: t
|
|
413
|
+
})), [Y]), X = y(() => ae(q, Y), [q, Y]), ke = y(() => {
|
|
325
414
|
let e = /* @__PURE__ */ new Map();
|
|
326
|
-
for (let t of
|
|
415
|
+
for (let t of J?.byCategory ?? []) e.set(t.category, {
|
|
327
416
|
totalSeconds: t.totalSeconds,
|
|
328
417
|
segmentCount: t.segmentCount
|
|
329
418
|
});
|
|
330
419
|
return e;
|
|
331
|
-
}, [
|
|
332
|
-
!e.isRecategorizable || e.category === t || (await
|
|
420
|
+
}, [J]), Z = async (e, t) => {
|
|
421
|
+
!e.isRecategorizable || e.category === t || (await I({ variables: {
|
|
333
422
|
id: e.sourceId,
|
|
334
423
|
category: t
|
|
335
|
-
} }), await
|
|
336
|
-
},
|
|
424
|
+
} }), await A());
|
|
425
|
+
}, Q = async (e, t) => {
|
|
426
|
+
try {
|
|
427
|
+
await e(), await A(), _({
|
|
428
|
+
title: t,
|
|
429
|
+
variant: "success"
|
|
430
|
+
});
|
|
431
|
+
} catch (e) {
|
|
432
|
+
_({
|
|
433
|
+
title: H(e),
|
|
434
|
+
variant: "error"
|
|
435
|
+
});
|
|
436
|
+
}
|
|
437
|
+
}, Ae = (e) => Q(() => V({ variables: { id: e.captureEventId } }), `Assigned to ${e.projectName}`), je = (e) => Q(() => W({ variables: { id: e.captureEventId } }), "Suggestion dismissed"), Me = (e, t) => {
|
|
438
|
+
if ((e.projectId ?? null) === t) return;
|
|
439
|
+
let n = t ? Y.get(t) : void 0;
|
|
440
|
+
return Q(() => Ce({ variables: {
|
|
441
|
+
id: e.sourceId,
|
|
442
|
+
projectId: t
|
|
443
|
+
} }), n ? `Assigned to ${n}` : "Project removed");
|
|
444
|
+
}, Ne = async (e) => {
|
|
445
|
+
try {
|
|
446
|
+
let t = (await Te({ variables: { id: e.sourceId } })).data?.suggestTimeCampusCaptureEventCategory;
|
|
447
|
+
await A(), _(t?.suggestedProjectId ? {
|
|
448
|
+
title: `Suggested ${t.suggestedProjectName ?? "a project"}`,
|
|
449
|
+
description: "Accept or dismiss it on the activity.",
|
|
450
|
+
variant: "info"
|
|
451
|
+
} : {
|
|
452
|
+
title: "No confident project match",
|
|
453
|
+
description: "Pick a project from the list instead.",
|
|
454
|
+
variant: "info"
|
|
455
|
+
});
|
|
456
|
+
} catch (e) {
|
|
457
|
+
_({
|
|
458
|
+
title: H(e),
|
|
459
|
+
variant: "error"
|
|
460
|
+
});
|
|
461
|
+
}
|
|
462
|
+
}, Pe = async () => {
|
|
463
|
+
let e = 0;
|
|
464
|
+
try {
|
|
465
|
+
for (let t of X) await V({ variables: { id: t.captureEventId } }), e++;
|
|
466
|
+
_({
|
|
467
|
+
title: `Accepted ${e} project ${e === 1 ? "suggestion" : "suggestions"}`,
|
|
468
|
+
variant: "success"
|
|
469
|
+
});
|
|
470
|
+
} catch (t) {
|
|
471
|
+
_({
|
|
472
|
+
title: `Accepted ${e} of ${X.length}`,
|
|
473
|
+
description: H(t),
|
|
474
|
+
variant: "error"
|
|
475
|
+
});
|
|
476
|
+
} finally {
|
|
477
|
+
await A();
|
|
478
|
+
}
|
|
479
|
+
}, Fe = {
|
|
480
|
+
projects: Oe,
|
|
481
|
+
busy: G,
|
|
482
|
+
onAccept: (e) => void Ae(e),
|
|
483
|
+
onReject: (e) => void je(e),
|
|
484
|
+
onSetProject: (e, t) => void Me(e, t),
|
|
485
|
+
onSuggest: (e) => void Ne(e)
|
|
486
|
+
}, Ie = (e) => {
|
|
337
487
|
let t = e.active.data.current?.segment;
|
|
338
|
-
|
|
339
|
-
},
|
|
488
|
+
T(t ?? null);
|
|
489
|
+
}, Le = (e) => {
|
|
340
490
|
let t = e.active.data.current?.segment;
|
|
341
|
-
|
|
491
|
+
T(null);
|
|
342
492
|
let n = e.over?.id;
|
|
343
493
|
if (!t || typeof n != "string") return;
|
|
344
494
|
let r = n.replace(/^category:/, "");
|
|
345
|
-
|
|
346
|
-
},
|
|
347
|
-
return /* @__PURE__ */
|
|
495
|
+
B.includes(r) && Z(t, r);
|
|
496
|
+
}, Re = J && J.focusRatio != null ? Math.round(J.focusRatio * 100) : 0, $ = J?.firstActivityAt && J?.lastActivityAt ? `${n(J.firstActivityAt)} – ${n(J.lastActivityAt)}` : null;
|
|
497
|
+
return /* @__PURE__ */ N(ee, {
|
|
348
498
|
title: "Timeline",
|
|
349
499
|
description: "Your day, assembled automatically",
|
|
350
500
|
purpose: "See where your time actually went — meetings, deep work, communication and breaks stitched into one honest, chronological view from everything TimeCampus captures, so you can spot the patterns worth changing.",
|
|
@@ -352,19 +502,19 @@ function Z() {
|
|
|
352
502
|
className: "flex flex-wrap items-center gap-3",
|
|
353
503
|
children: [$ && /* @__PURE__ */ N("span", {
|
|
354
504
|
className: "inline-flex items-center gap-1.5 rounded-full bg-bg-sunken px-2.5 py-1 text-xs font-medium tabular-nums text-text-secondary",
|
|
355
|
-
children: [/* @__PURE__ */ M(
|
|
505
|
+
children: [/* @__PURE__ */ M(x, { className: "h-3.5 w-3.5" }), $]
|
|
356
506
|
}), /* @__PURE__ */ N("label", {
|
|
357
507
|
className: "flex items-center gap-2 text-sm text-text-secondary",
|
|
358
|
-
children: [/* @__PURE__ */ M(
|
|
508
|
+
children: [/* @__PURE__ */ M(oe, { className: "h-4 w-4" }), /* @__PURE__ */ M("input", {
|
|
359
509
|
type: "date",
|
|
360
|
-
value:
|
|
361
|
-
max:
|
|
362
|
-
onChange: (e) =>
|
|
510
|
+
value: v,
|
|
511
|
+
max: be(),
|
|
512
|
+
onChange: (e) => re(e.target.value),
|
|
363
513
|
className: "rounded-md border border-border-seam bg-bg-surface px-3 py-1.5 text-sm text-text-primary focus:outline-none focus:ring-2 focus:ring-action-primary-bg/40"
|
|
364
514
|
})]
|
|
365
515
|
})]
|
|
366
516
|
}),
|
|
367
|
-
children:
|
|
517
|
+
children: [D && !K ? /* @__PURE__ */ N("div", {
|
|
368
518
|
className: "space-y-6",
|
|
369
519
|
children: [/* @__PURE__ */ M(i, {
|
|
370
520
|
variant: "card",
|
|
@@ -373,13 +523,13 @@ function Z() {
|
|
|
373
523
|
variant: "list",
|
|
374
524
|
count: 6
|
|
375
525
|
})]
|
|
376
|
-
}) :
|
|
526
|
+
}) : k ? /* @__PURE__ */ M("div", {
|
|
377
527
|
className: "rounded-lg border border-status-error-bg/40 bg-status-error-bg p-4 text-sm text-status-error-text",
|
|
378
528
|
children: "Failed to load your timeline. Please try again later."
|
|
379
|
-
}) : /* @__PURE__ */ N(
|
|
380
|
-
sensors:
|
|
381
|
-
onDragStart:
|
|
382
|
-
onDragEnd:
|
|
529
|
+
}) : /* @__PURE__ */ N(ue, {
|
|
530
|
+
sensors: De,
|
|
531
|
+
onDragStart: Ie,
|
|
532
|
+
onDragEnd: Le,
|
|
383
533
|
children: [/* @__PURE__ */ N("div", {
|
|
384
534
|
className: "space-y-6",
|
|
385
535
|
children: [
|
|
@@ -389,31 +539,31 @@ function Z() {
|
|
|
389
539
|
/* @__PURE__ */ M(r, {
|
|
390
540
|
featured: !0,
|
|
391
541
|
title: "Tracked time",
|
|
392
|
-
value: t(
|
|
393
|
-
icon: /* @__PURE__ */ M(
|
|
542
|
+
value: t(J?.totalTrackedSeconds ?? 0),
|
|
543
|
+
icon: /* @__PURE__ */ M(x, { className: "h-5 w-5" }),
|
|
394
544
|
description: "Total activity across the day"
|
|
395
545
|
}),
|
|
396
546
|
/* @__PURE__ */ M(r, {
|
|
397
547
|
title: "Focus ratio",
|
|
398
|
-
value: `${
|
|
399
|
-
icon: /* @__PURE__ */ M(
|
|
548
|
+
value: `${Re}%`,
|
|
549
|
+
icon: /* @__PURE__ */ M(S, { className: "h-5 w-5" }),
|
|
400
550
|
description: "Share of time in deep work"
|
|
401
551
|
}),
|
|
402
552
|
/* @__PURE__ */ M(r, {
|
|
403
553
|
title: "Context switches",
|
|
404
|
-
value:
|
|
554
|
+
value: J?.contextSwitches ?? 0,
|
|
405
555
|
icon: /* @__PURE__ */ M(j, { className: "h-5 w-5" }),
|
|
406
556
|
description: "Category changes through the day"
|
|
407
557
|
}),
|
|
408
558
|
/* @__PURE__ */ M(r, {
|
|
409
559
|
title: "Longest focus block",
|
|
410
|
-
value: t(
|
|
411
|
-
icon: /* @__PURE__ */ M(
|
|
560
|
+
value: t(J?.longestFocusBlockSeconds ?? 0),
|
|
561
|
+
icon: /* @__PURE__ */ M(S, { className: "h-5 w-5" }),
|
|
412
562
|
description: "Your deepest uninterrupted stretch"
|
|
413
563
|
})
|
|
414
564
|
]
|
|
415
565
|
}),
|
|
416
|
-
|
|
566
|
+
q.length > 0 && /* @__PURE__ */ N(P, {
|
|
417
567
|
treatment: "glass",
|
|
418
568
|
className: "p-4 sm:p-6",
|
|
419
569
|
children: [
|
|
@@ -425,10 +575,10 @@ function Z() {
|
|
|
425
575
|
className: "mb-4 text-xs text-text-secondary",
|
|
426
576
|
children: "Drag a segment from the timeline below onto a category to recategorize it — or use its dropdown."
|
|
427
577
|
}),
|
|
428
|
-
|
|
578
|
+
h(q) && /* @__PURE__ */ N("p", {
|
|
429
579
|
className: "mb-4 flex items-start gap-1.5 text-xs text-text-secondary",
|
|
430
580
|
"data-testid": "timeline-ai-disclaimer",
|
|
431
|
-
children: [/* @__PURE__ */ M(
|
|
581
|
+
children: [/* @__PURE__ */ M(O, {
|
|
432
582
|
className: "mt-0.5 h-3 w-3 shrink-0",
|
|
433
583
|
"aria-hidden": !0
|
|
434
584
|
}), /* @__PURE__ */ N("span", { children: [
|
|
@@ -439,9 +589,9 @@ function Z() {
|
|
|
439
589
|
}),
|
|
440
590
|
/* @__PURE__ */ M("div", {
|
|
441
591
|
className: "flex flex-wrap gap-4",
|
|
442
|
-
children:
|
|
443
|
-
let t =
|
|
444
|
-
return /* @__PURE__ */ M(
|
|
592
|
+
children: B.map((e) => {
|
|
593
|
+
let t = R[e], n = ke.get(e);
|
|
594
|
+
return /* @__PURE__ */ M(_e, {
|
|
445
595
|
category: e,
|
|
446
596
|
label: t.label,
|
|
447
597
|
dotClassName: t.dot,
|
|
@@ -451,7 +601,37 @@ function Z() {
|
|
|
451
601
|
})
|
|
452
602
|
]
|
|
453
603
|
}),
|
|
454
|
-
X.length
|
|
604
|
+
X.length > 0 && /* @__PURE__ */ N("div", {
|
|
605
|
+
className: "flex flex-wrap items-center gap-3 rounded-lg border border-border-seam bg-bg-sunken/40 px-4 py-3",
|
|
606
|
+
"data-testid": "timeline-suggestions-banner",
|
|
607
|
+
children: [
|
|
608
|
+
/* @__PURE__ */ M(O, { className: "h-4 w-4 shrink-0 text-primary" }),
|
|
609
|
+
/* @__PURE__ */ N("p", {
|
|
610
|
+
className: "text-sm text-text-secondary",
|
|
611
|
+
children: [
|
|
612
|
+
/* @__PURE__ */ N("span", {
|
|
613
|
+
className: "font-medium text-text-primary",
|
|
614
|
+
children: [
|
|
615
|
+
X.length,
|
|
616
|
+
" project",
|
|
617
|
+
" ",
|
|
618
|
+
X.length === 1 ? "suggestion" : "suggestions"
|
|
619
|
+
]
|
|
620
|
+
}),
|
|
621
|
+
" ",
|
|
622
|
+
"waiting for review. Nothing is assigned until you accept."
|
|
623
|
+
]
|
|
624
|
+
}),
|
|
625
|
+
/* @__PURE__ */ N("button", {
|
|
626
|
+
type: "button",
|
|
627
|
+
disabled: G,
|
|
628
|
+
onClick: () => void Pe(),
|
|
629
|
+
className: "ml-auto inline-flex items-center gap-1 rounded-md bg-action-primary-bg px-3 py-1 text-xs font-medium text-action-primary-text hover:bg-action-primary-bg/90 disabled:opacity-50",
|
|
630
|
+
children: [/* @__PURE__ */ M(w, { className: "h-3.5 w-3.5" }), "Accept all"]
|
|
631
|
+
})
|
|
632
|
+
]
|
|
633
|
+
}),
|
|
634
|
+
q.length === 0 ? /* @__PURE__ */ M(a, {
|
|
455
635
|
illustration: "empty-generic",
|
|
456
636
|
title: "No activity captured for this day",
|
|
457
637
|
description: "As you track time, hold meetings, run focus sessions, and connect shared integrations, your day assembles here automatically — categorized and in order."
|
|
@@ -461,27 +641,32 @@ function Z() {
|
|
|
461
641
|
className: "overflow-hidden",
|
|
462
642
|
children: /* @__PURE__ */ M("ol", {
|
|
463
643
|
className: "divide-y divide-border-seam",
|
|
464
|
-
children:
|
|
644
|
+
children: q.map((e) => he(e) ? /* @__PURE__ */ M(ge, { segment: e }, e.id) : /* @__PURE__ */ M(ve, {
|
|
465
645
|
segment: e,
|
|
466
646
|
category: e.category ?? "OTHER",
|
|
467
|
-
projectName: e.projectId ?
|
|
647
|
+
projectName: e.projectId ? Y.get(e.projectId) : void 0,
|
|
648
|
+
suggestion: ie(e, Y),
|
|
468
649
|
recategorizing: z,
|
|
469
|
-
onRecategorize:
|
|
650
|
+
onRecategorize: Z,
|
|
651
|
+
projectActions: Fe
|
|
470
652
|
}, e.id))
|
|
471
653
|
})
|
|
472
654
|
})
|
|
473
655
|
]
|
|
474
|
-
}), /* @__PURE__ */ M(
|
|
656
|
+
}), /* @__PURE__ */ M(de, { children: C && /* @__PURE__ */ N("div", {
|
|
475
657
|
className: "flex items-center gap-2 rounded-lg border border-border-seam bg-bg-surface px-3 py-2 shadow-pop",
|
|
476
|
-
children: [/* @__PURE__ */ M(
|
|
658
|
+
children: [/* @__PURE__ */ M(le, { className: "h-4 w-4 text-text-tertiary" }), /* @__PURE__ */ M("span", {
|
|
477
659
|
className: "text-sm font-medium text-text-primary",
|
|
478
|
-
children:
|
|
660
|
+
children: C.title || R[C.category ?? "OTHER"].label
|
|
479
661
|
})]
|
|
480
662
|
}) })]
|
|
481
|
-
})
|
|
663
|
+
}), /* @__PURE__ */ M(te, {
|
|
664
|
+
toasts: g,
|
|
665
|
+
onDismiss: ne
|
|
666
|
+
})]
|
|
482
667
|
});
|
|
483
668
|
}
|
|
484
669
|
//#endregion
|
|
485
|
-
export {
|
|
670
|
+
export { W as TimelinePage };
|
|
486
671
|
|
|
487
672
|
//# sourceMappingURL=TimelinePage.js.map
|